Add initial first test screen
This commit is contained in:
32
ArtisanConnect/app/+not-found.tsx
Normal file
32
ArtisanConnect/app/+not-found.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Link, Stack } from 'expo-router';
|
||||
import { StyleSheet } from 'react-native';
|
||||
|
||||
import { ThemedText } from '@/components/ThemedText';
|
||||
import { ThemedView } from '@/components/ThemedView';
|
||||
|
||||
export default function NotFoundScreen() {
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen options={{ title: 'Oops!' }} />
|
||||
<ThemedView style={styles.container}>
|
||||
<ThemedText type="title">This screen doesn't exist.</ThemedText>
|
||||
<Link href="/" style={styles.link}>
|
||||
<ThemedText type="link">Go to home screen!</ThemedText>
|
||||
</Link>
|
||||
</ThemedView>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: 20,
|
||||
},
|
||||
link: {
|
||||
marginTop: 15,
|
||||
paddingVertical: 15,
|
||||
},
|
||||
});
|
||||
@@ -1,5 +1,17 @@
|
||||
import { Stack } from "expo-router";
|
||||
import { Appearance } from "react-native";
|
||||
import {Colors} from "@/constants/Colors"
|
||||
|
||||
export default function RootLayout() {
|
||||
return <Stack />;
|
||||
const colorScheme = Appearance.getColorScheme();
|
||||
|
||||
const theme = colorScheme === 'dark' ? Colors.dark :
|
||||
Colors.light;
|
||||
return <Stack screenOptions={{ headerStyle: {backgroundColor:theme.background},
|
||||
headerTintColor: theme.text
|
||||
}}>
|
||||
<Stack.Screen name="index"/>
|
||||
<Stack.Screen name="+not-found" options={{headerShown:false}}/>
|
||||
|
||||
</Stack>;
|
||||
}
|
||||
|
||||
14
ArtisanConnect/app/index.jsx
Normal file
14
ArtisanConnect/app/index.jsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Text, View, Pressable } from "react-native";
|
||||
import { Link } from "expo-router";
|
||||
export default function Index() {
|
||||
return (
|
||||
<View>
|
||||
|
||||
<Link href="/notices" asChild>
|
||||
<Pressable>
|
||||
<Text>Notices</Text>
|
||||
</Pressable>
|
||||
</Link>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import { Text, View } from "react-native";
|
||||
|
||||
export default function Index() {
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Text>Edit app/index.tsx to edit this screen.</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
27
ArtisanConnect/app/notices.jsx
Normal file
27
ArtisanConnect/app/notices.jsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Appearance, StyleSheet, Platform,
|
||||
SafeAreaView,FlatList, ScrollView, View, Text } from "react-native";
|
||||
|
||||
import { Colors } from "@/constants/Colors";
|
||||
import { MENU_ITEMS } from "@/constants/NoticeItems";
|
||||
|
||||
export default function MenuScreen(){
|
||||
const colorScheme = Appearance.getColorScheme();
|
||||
|
||||
const theme = colorScheme === 'dark' ? Colors.dark : Colors.light;
|
||||
|
||||
const Container = Platform.OS === 'web' ? ScrollView : SafeAreaView;
|
||||
|
||||
return(
|
||||
<Container>
|
||||
<FlatList
|
||||
data={MENU_ITEMS}
|
||||
keyExtractor={(item) => item.id.toString()}
|
||||
renderItem={({ item }) => (
|
||||
<View>
|
||||
<Text>{item.title}</Text>
|
||||
</View>
|
||||
)}
|
||||
></FlatList>
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user