83 lines
2.0 KiB
JavaScript
83 lines
2.0 KiB
JavaScript
import "react-native-gesture-handler";
|
|
import { useState } from "react";
|
|
import { NavigationContainer } from "@react-navigation/native";
|
|
import { createDrawerNavigator } from "@react-navigation/drawer";
|
|
import { SettingsProvider } from "./context/SettingsContext";
|
|
import LandingScreen from "./screens/LandingScreen";
|
|
import MainScreen from "./screens/MainScreen";
|
|
import SettingsScreen from "./screens/SettingsScreen";
|
|
|
|
const Drawer = createDrawerNavigator();
|
|
|
|
export default function App() {
|
|
const [showLanding, setShowLanding] = useState(true);
|
|
|
|
if (showLanding) {
|
|
return <LandingScreen onFinish={() => setShowLanding(false)} />;
|
|
}
|
|
|
|
return (
|
|
<SettingsProvider>
|
|
<NavigationContainer>
|
|
<Drawer.Navigator
|
|
initialRouteName="Main"
|
|
screenOptions={{
|
|
headerStyle: {
|
|
backgroundColor: "#f4511e",
|
|
},
|
|
headerTintColor: "#fff",
|
|
}}
|
|
>
|
|
<Drawer.Screen name="Main" component={MainScreen} />
|
|
<Drawer.Screen name="Settings" component={SettingsScreen} />
|
|
</Drawer.Navigator>
|
|
</NavigationContainer>
|
|
</SettingsProvider>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
backgroundColor: "#E8EAED",
|
|
},
|
|
tasksWrapper: {
|
|
paddingTop: 80,
|
|
paddingHorizontal: 20,
|
|
},
|
|
sectionTitle: {
|
|
fontSize: 24,
|
|
fontWeight: "bold",
|
|
},
|
|
items: {
|
|
marginTop: 30,
|
|
},
|
|
writeTaskWrapper: {
|
|
position: "absolute",
|
|
bottom: 60,
|
|
width: "100%",
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
justifyContent: "space-around",
|
|
},
|
|
input: {
|
|
paddingVertical: 15,
|
|
paddingHorizontal: 15,
|
|
backgroundColor: "#FFF",
|
|
borderRadius: 60,
|
|
borderColor: "#C0C0C0",
|
|
borderWidth: 1,
|
|
width: 250,
|
|
},
|
|
addWrapper: {
|
|
width: 60,
|
|
height: 60,
|
|
backgroundColor: "#FFF",
|
|
borderRadius: 60,
|
|
justifyContent: "center",
|
|
alignItems: "center",
|
|
borderColor: "#C0C0C0",
|
|
borderWidth: 1,
|
|
},
|
|
});
|