Skip to content

Commit 61d1e2a

Browse files
committed
Edit README
1 parent 9119589 commit 61d1e2a

File tree

3 files changed

+109
-3
lines changed

3 files changed

+109
-3
lines changed

App.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import { StatusBar } from "expo-status-bar";
21
import { StyleSheet } from "react-native";
32
import { SafeAreaProvider } from "react-native-safe-area-context";
43

54
import { RootNavigator } from "./navigation";
6-
import { COLORS_LIGHT } from "./constants";
75
import { ThemeProvider } from "./contexts";
86

97
export default function App() {

README.md

+109-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,110 @@
1-
# bsa-rn-base
1+
# BSA React Native Base Lecture
2+
Just clone the repository and install all dependencies.
23

4+
Then you run `npm start` to start the application:
5+
6+
# Application
7+
Your task will be to implement the Inspiration App that can help you to find the inspiration or motivation. The app will provide a possibility to generate random inspiration card or create it from scratch by the users:
8+
<img src="./assets/demo/app.png" width="200">
9+
10+
## Tasks
11+
### App structure description
12+
- ***/assets*** - here you can find all the necessary images and fonts to use within the application (you'll need to apply and use given fonts in the app);
13+
- ***/constants*** - there are color constants for the light and the dark modes;
14+
- ***/contexts*** - there is the ThemeContext, please replace all TODOs with the required logic for theme switching;
15+
- ***/enums*** - here you can find the api and route names enums which you should use while implementing the task;
16+
- ***/helpers*** - there is a helper that generates a random Number within the provided range (if you decide to create a new helper - declare it here);
17+
- ***/hooks*** - there is a useTheme hook that uses the ThemeContext you need to complete (if you decide to create a new hook - declare it here);
18+
- ***/navigation*** - there are two navigator files, that you need to add logic into;
19+
- ***/screens*** - here you'll find three screen files you need to fill in (if you want to move some screen components outside - then create a */components* folder inside the corresponding screen folder; if the component you're going to create will be used on several screens - create the */components* folder in the root of the project and place it there);
20+
- ***/services*** - there are two already created services you should use inside *add-inspiration* screen to get random image and quote;
21+
- ***/types*** - there are also some created types (look carefully through them, and also if you need to add a new one - do it here)
22+
23+
24+
### Theme context
25+
26+
- use AsyncStorage to save the theme initializer
27+
- initially the application should use the light theme
28+
- you are feel free to choose the type of the stored item in the AsyncStorage - it can be string or boolean
29+
- `ThemeContext` can return additional values if you need
30+
- `StatusBar` text color should change depending on the selected theme
31+
32+
33+
### Bottom Tabs Navigator
34+
35+
- navigator should consist of two tabs 'Home' with the ***dashboard*** component and 'Settings' with the ***settings*** component
36+
- each tab should have an icon (you can use `Ionicons` from "@expo/vector-icons"; to follow the example use `home` and `settings` icon names)
37+
- active tab icon and text should have `PRIMARY` color, and inactive ones - `SECONDARY`
38+
- tabs background should be the same for active tab and not active - `APP_BACKGROUND`
39+
- the font for the screen headers and bottom tabs should be `LobsterTwo-Regular` and have `PRIMARY` color
40+
- the background of the screens header should be `APP_BACKGROUND`
41+
- all colors should change depending on the selected theme
42+
43+
44+
### Root Navigator
45+
46+
- should consist the bottom tabs navigator and the `add-inspiration` screen
47+
- the font for the screen headers should be `LobsterTwo-Regular` and have `PRIMARY` color
48+
- the background of the screens header should be `APP_BACKGROUND`
49+
- all colors should change depending on the selected theme
50+
51+
52+
***Every screen should have the background with two `leaf.png` images placed as shown in the example*** (consider create a separate `<ScreenBackground />` component and reuse it)
53+
54+
55+
### Dashboard screen
56+
<img src="./assets/demo/demo_1.gif" width="200">
57+
<img src="./assets/demo/demo_6.gif" width="200">
58+
59+
- the `dashboard` screen header should have the the `add-circle` button and after pressing it the user should be navigated to the `add-inspiration` screen
60+
- `dashboard` screen should get the created *Inspiration* as a route params, store it in the state and render as a scrollable list.
61+
- if there are no created inspiration cards, the placeholder with the `empty-placeholder.png` image and **"No inspirations yet"** text should be shown.
62+
- placeholder's text should have `LobsterTwo-Italic` font family
63+
64+
### Inspiration Card
65+
66+
- has a background image with an additional blur layer with the 30% of the `APP_BACKGROUND` color
67+
- the card should have rounded border
68+
- the quote text is placed at the center of the card, should be shown on the half-transparent background and have minimum height 50% of card height
69+
- the font color is always `FONT_INVERSE`
70+
71+
### Settings screen
72+
<img src="./assets/demo/demo_1.gif" width="200">
73+
74+
- should have a `Switch` to toggle the current theme
75+
- on the left of the switch the `sunny` icon is placed, on the right - `moon` icon
76+
- ***Pay attention***: for the *light* theme the trackColor should be `GREY` and for the *dark* one - `SECONDARY`
77+
78+
79+
### AddInspiration screen
80+
81+
- screen header should contain the `arrow` back button after pressing on which the user should be navigated back to the ***dashboard***
82+
- the back-button should have the `PRIMARY` color
83+
- the `Save` button should be disabled if there are no image and quote.
84+
85+
- #### Elements:
86+
- inspiration card preview (you can reuse the same component as for the dashboard list):
87+
- while there is no image selected `no-image.jpg` should be used as a placeholder
88+
- while the quote is not added the text block on the card is not shown (meaning the half-transparent wrapper for the quote)
89+
- two buttons to manage the image adding:
90+
- the `Choose image` button is used to select the image from the device gallery or camera
91+
- after pressing the `Alert` is shown with 3 possible options: 'Gallery', 'Camera' and 'Cancel'
92+
- after choosing the **Gallery** the permission should be requested and after it is granted user should be led to the gallery, choose the image and after applying it should be set as a card background
93+
<img src="./assets/demo/demo_2.gif" width="200">
94+
- after choosing the **Camera** the permission should be requested and after it is granted user should be led to the camera, taka a photo and after applying it should be set as a card background
95+
<img src="./assets/demo/demo_3.gif" width="200">
96+
- after choosing the **Cancel** the Alert is hidden and the image isn't set
97+
- the `Get random image` button uses `getRandomImage` service as an onPress handler - after pressing the user should get the random image and it is set as a card background (**hint**: use `download_url` from the response)
98+
<img src="./assets/demo/demo_4.gif" width="200">
99+
- to work with gallery and permissions you have `expo-image-picker` library installed
100+
- text input to add your own quote - should have placeholder with **Enter your quote here...** text, color for the placeholder - `SECONDARY`, text color for the light theme - `FONT_MAIN`, for the dark - `FONT_INVERSE`
101+
- <img src="./assets/demo/demo_5.gif" width="200">
102+
- the `Get random quote` button uses `getRandomQuote` service as an onPress handler - after pressing the user should get the random quote and it is set as a card quote (**Pay attention**: if previously the user has entered a quote in the input it should be cleared after pressing this button)
103+
- `Save` button - after pressing it the user should be navigated to the dashboard and the inspiration card should appear in the list. When disabled the opacity is set to `0.5`. It should be filled, not outlined as other buttons on the screen.
104+
- all the buttons, except the `Save` should have the thinnest available border width and border color set to `PRIMARY`
105+
106+
107+
### Additional points
108+
To get additional points you can:
109+
- add the ability to edit existing inspiration card
110+
- add keyboard avoiding logic for the `app-inspiration` screen

assets/demo/app.png

326 KB
Loading

0 commit comments

Comments
 (0)