main
root 2023-07-08 17:10:12 +00:00
parent fd422b74cd
commit d137f04754
10 changed files with 90 additions and 20 deletions

22
App.js
View File

@ -1,11 +1,14 @@
import "react-native-gesture-handler"; import "react-native-gesture-handler";
import { StatusBar } from "expo-status-bar"; import { StatusBar } from "expo-status-bar";
import { StyleSheet, Text, View } from "react-native"; import { StyleSheet } from "react-native";
import HomeScreen from "./src/Pages/Home"; import HomeScreen from "./src/Screens/Home";
import { NativeBaseProvider } from "native-base"; import { NativeBaseProvider } from "native-base";
import { NavigationContainer } from "@react-navigation/native";
import { createDrawerNavigator } from "@react-navigation/drawer"; import { createDrawerNavigator } from "@react-navigation/drawer";
import TestScreen from "./src/Pages/Test"; import TestScreen from "./src/Screens/Test";
import { NavigationContainer } from "@react-navigation/native";
import SideBar from "./src/Components/SideBar";
import FaqScreen from "./src/Screens/FAQ";
import FeedbackScreen from "./src/Screens/Feedback";
// fix: https://github.com/GeekyAnts/NativeBase/issues/5758 // fix: https://github.com/GeekyAnts/NativeBase/issues/5758
@ -15,13 +18,14 @@ export default function App() {
return ( return (
<NativeBaseProvider> <NativeBaseProvider>
<NavigationContainer> <NavigationContainer>
<Drawer.Navigator> <Drawer.Navigator drawerContent={(props) => <SideBar {...props} />}>
<Drawer.Screen name="Home" component={HomeScreen} /> <Drawer.Screen name="Spinner V6" component={HomeScreen} />
<Drawer.Screen name="Test" component={TestScreen} /> <Drawer.Screen name="FAQ" component={FaqScreen} />
<Drawer.Screen name="Feedback" component={FeedbackScreen} />
</Drawer.Navigator> </Drawer.Navigator>
<StatusBar style="dark" />
</NavigationContainer> </NavigationContainer>
<StatusBar style="dark" />
</NativeBaseProvider> </NativeBaseProvider>
); );
} }

7
README.md Normal file
View File

@ -0,0 +1,7 @@
# Clear cache on startup
npx expo start -c
# Icons
https://pictogrammers.com/library/mdi/

BIN
assets/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

BIN
assets/image2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

View File

@ -0,0 +1,51 @@
import {
DrawerContentScrollView,
DrawerItem,
DrawerItemList,
} from "@react-navigation/drawer";
import { Icon, Text } from "native-base";
import { Image, StyleSheet, View } from "react-native";
import { Divider } from "react-native-paper";
export default function Sidebar(props) {
return (
<>
{console.log(props.descriptors)}
<Image
source={require("../../../assets/image.png")}
style={styles.image}
/>
<Text fontSize="md" style={{ fontWeight: "bold", marginLeft: 10 }}>
Geräte
</Text>
<DrawerContentScrollView contentContainerStyle={{ paddingTop: 0 }}>
{["Spinner V6"].map((item, i) => (
<DrawerItem
key={i}
label={item}
onPress={() => props.navigation.navigate(item)}
/>
))}
</DrawerContentScrollView>
<View style={{ justifyContent: "flex-end" }}>
<Divider style={{ marginLeft: 10, marginRight: 10 }} />
<DrawerItem
label={"FAQ"}
onPress={() => props.navigation.navigate("FAQ")}
/>
<DrawerItem
label={"Feedback geben"}
onPress={() => props.navigation.navigate("Feedback")}
/>
</View>
</>
);
}
const styles = StyleSheet.create({
image: {
width: "100%",
height: 250,
},
});

5
src/Screens/FAQ/index.js Normal file
View File

@ -0,0 +1,5 @@
import { Text } from "react-native";
export default function FaqScreen() {
return <Text>FAQ</Text>;
}

View File

@ -0,0 +1,5 @@
import { Text } from "react-native";
export default function FeedbackScreen() {
return <Text>Feedback</Text>;
}

View File

@ -5,7 +5,7 @@ import { Avatar, Button } from "react-native-paper";
export default function HomeScreen() { export default function HomeScreen() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Avatar.Icon size={82} icon="frequently-asked-questions" /> <Avatar.Icon size={82} icon="help" />
<Text fontSize="xl" style={{ marginBottom: 10 }}> <Text fontSize="xl" style={{ marginBottom: 10 }}>
Kein Gerät gefunden Kein Gerät gefunden
</Text> </Text>

View File

@ -1,4 +1,4 @@
import { Text } from "react-native"; import { Text, View } from "react-native";
export default function TestScreen() { export default function TestScreen() {
return ( return (

View File

@ -1,10 +1,8 @@
const Styles = StyleSheet.create({ const Styles = StyleSheet.create({
container: { container: {
flex: 1, flex: 1,
backgroundColor: "#fff", backgroundColor: "#fff",
alignItems: "center", alignItems: "center",
justifyContent: "center", justifyContent: "center",
}, },
}); });
export function Styles