-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.jsx
More file actions
41 lines (34 loc) · 1.21 KB
/
App.jsx
File metadata and controls
41 lines (34 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import {useState} from "react";
import {Button, StatusBar, View} from 'react-native';
import GoalInput from "./components/GoalInput/GoalInput";
import ClearBtn from "./components/ClearBtn/ClearBtn";
import GoalList from "./components/GoalList/GoalList";
import styles from "./assets/AppStyle";
export default function App() {
const [modalIsVisible, setModalIsVisible] = useState(false);
const [courseGoals, setCourseGoals] = useState([]);
const showAddNewGoalModal = () => setModalIsVisible(true);
const hideAddNewGoalModal = () => setModalIsVisible(false);
return (
<>
<StatusBar style={'auto'}/>
<View style={styles.appContainer}>
<Button
title={'Add new goal'}
color={'#5e0acc'}
onPress={showAddNewGoalModal}
/>
<GoalInput
setCourseGoals={setCourseGoals}
visible={modalIsVisible}
hideModal={hideAddNewGoalModal}
/>
<GoalList
courseGoals={courseGoals}
setCourseGoals={setCourseGoals}
/>
<ClearBtn setCourseGoals={setCourseGoals}/>
</View>
</>
);
}