Skip to content

Commit 1d251b2

Browse files
committed
Initial commit
Generated by create-expo-app 2.1.1.
0 parents  commit 1d251b2

28 files changed

+19218
-0
lines changed

.gitignore

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2+
3+
# dependencies
4+
node_modules/
5+
6+
# Expo
7+
.expo/
8+
dist/
9+
web-build/
10+
11+
# Native
12+
*.orig.*
13+
*.jks
14+
*.p8
15+
*.p12
16+
*.key
17+
*.mobileprovision
18+
19+
# Metro
20+
.metro-health-check*
21+
22+
# debug
23+
npm-debug.*
24+
yarn-debug.*
25+
yarn-error.*
26+
27+
# macOS
28+
.DS_Store
29+
*.pem
30+
31+
# local env files
32+
.env*.local
33+
34+
# typescript
35+
*.tsbuildinfo

app.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"expo": {
3+
"name": "jlpt-practice-v2",
4+
"slug": "jlpt-practice-v2",
5+
"version": "1.0.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/images/icon.png",
8+
"scheme": "myapp",
9+
"userInterfaceStyle": "automatic",
10+
"splash": {
11+
"image": "./assets/images/splash.png",
12+
"resizeMode": "contain",
13+
"backgroundColor": "#ffffff"
14+
},
15+
"assetBundlePatterns": [
16+
"**/*"
17+
],
18+
"ios": {
19+
"supportsTablet": true
20+
},
21+
"android": {
22+
"adaptiveIcon": {
23+
"foregroundImage": "./assets/images/adaptive-icon.png",
24+
"backgroundColor": "#ffffff"
25+
}
26+
},
27+
"web": {
28+
"bundler": "metro",
29+
"output": "static",
30+
"favicon": "./assets/images/favicon.png"
31+
},
32+
"plugins": [
33+
"expo-router"
34+
],
35+
"experiments": {
36+
"typedRoutes": true
37+
}
38+
}
39+
}

app/(tabs)/_layout.tsx

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import React from 'react';
2+
import FontAwesome from '@expo/vector-icons/FontAwesome';
3+
import { Link, Tabs } from 'expo-router';
4+
import { Pressable } from 'react-native';
5+
6+
import Colors from '@/constants/Colors';
7+
import { useColorScheme } from '@/components/useColorScheme';
8+
import { useClientOnlyValue } from '@/components/useClientOnlyValue';
9+
10+
// You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/
11+
function TabBarIcon(props: {
12+
name: React.ComponentProps<typeof FontAwesome>['name'];
13+
color: string;
14+
}) {
15+
return <FontAwesome size={28} style={{ marginBottom: -3 }} {...props} />;
16+
}
17+
18+
export default function TabLayout() {
19+
const colorScheme = useColorScheme();
20+
21+
return (
22+
<Tabs
23+
screenOptions={{
24+
tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
25+
// Disable the static render of the header on web
26+
// to prevent a hydration error in React Navigation v6.
27+
headerShown: useClientOnlyValue(false, true),
28+
}}>
29+
<Tabs.Screen
30+
name="index"
31+
options={{
32+
title: 'Tab One',
33+
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
34+
headerRight: () => (
35+
<Link href="/modal" asChild>
36+
<Pressable>
37+
{({ pressed }) => (
38+
<FontAwesome
39+
name="info-circle"
40+
size={25}
41+
color={Colors[colorScheme ?? 'light'].text}
42+
style={{ marginRight: 15, opacity: pressed ? 0.5 : 1 }}
43+
/>
44+
)}
45+
</Pressable>
46+
</Link>
47+
),
48+
}}
49+
/>
50+
<Tabs.Screen
51+
name="two"
52+
options={{
53+
title: 'Tab Two',
54+
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
55+
}}
56+
/>
57+
</Tabs>
58+
);
59+
}

app/(tabs)/index.tsx

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { StyleSheet } from 'react-native';
2+
3+
import EditScreenInfo from '@/components/EditScreenInfo';
4+
import { Text, View } from '@/components/Themed';
5+
6+
export default function TabOneScreen() {
7+
return (
8+
<View style={styles.container}>
9+
<Text style={styles.title}>Tab One</Text>
10+
<View style={styles.separator} lightColor="#eee" darkColor="rgba(255,255,255,0.1)" />
11+
<EditScreenInfo path="app/(tabs)/index.tsx" />
12+
</View>
13+
);
14+
}
15+
16+
const styles = StyleSheet.create({
17+
container: {
18+
flex: 1,
19+
alignItems: 'center',
20+
justifyContent: 'center',
21+
},
22+
title: {
23+
fontSize: 20,
24+
fontWeight: 'bold',
25+
},
26+
separator: {
27+
marginVertical: 30,
28+
height: 1,
29+
width: '80%',
30+
},
31+
});

app/(tabs)/two.tsx

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { StyleSheet } from 'react-native';
2+
3+
import EditScreenInfo from '@/components/EditScreenInfo';
4+
import { Text, View } from '@/components/Themed';
5+
6+
export default function TabTwoScreen() {
7+
return (
8+
<View style={styles.container}>
9+
<Text style={styles.title}>Tab Two</Text>
10+
<View style={styles.separator} lightColor="#eee" darkColor="rgba(255,255,255,0.1)" />
11+
<EditScreenInfo path="app/(tabs)/two.tsx" />
12+
</View>
13+
);
14+
}
15+
16+
const styles = StyleSheet.create({
17+
container: {
18+
flex: 1,
19+
alignItems: 'center',
20+
justifyContent: 'center',
21+
},
22+
title: {
23+
fontSize: 20,
24+
fontWeight: 'bold',
25+
},
26+
separator: {
27+
marginVertical: 30,
28+
height: 1,
29+
width: '80%',
30+
},
31+
});

app/+html.tsx

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { ScrollViewStyleReset } from 'expo-router/html';
2+
3+
// This file is web-only and used to configure the root HTML for every
4+
// web page during static rendering.
5+
// The contents of this function only run in Node.js environments and
6+
// do not have access to the DOM or browser APIs.
7+
export default function Root({ children }: { children: React.ReactNode }) {
8+
return (
9+
<html lang="en">
10+
<head>
11+
<meta charSet="utf-8" />
12+
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
13+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
14+
15+
{/*
16+
Disable body scrolling on web. This makes ScrollView components work closer to how they do on native.
17+
However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line.
18+
*/}
19+
<ScrollViewStyleReset />
20+
21+
{/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */}
22+
<style dangerouslySetInnerHTML={{ __html: responsiveBackground }} />
23+
{/* Add any additional <head> elements that you want globally available on web... */}
24+
</head>
25+
<body>{children}</body>
26+
</html>
27+
);
28+
}
29+
30+
const responsiveBackground = `
31+
body {
32+
background-color: #fff;
33+
}
34+
@media (prefers-color-scheme: dark) {
35+
body {
36+
background-color: #000;
37+
}
38+
}`;

app/+not-found.tsx

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { Link, Stack } from 'expo-router';
2+
import { StyleSheet } from 'react-native';
3+
4+
import { Text, View } from '@/components/Themed';
5+
6+
export default function NotFoundScreen() {
7+
return (
8+
<>
9+
<Stack.Screen options={{ title: 'Oops!' }} />
10+
<View style={styles.container}>
11+
<Text style={styles.title}>This screen doesn't exist.</Text>
12+
13+
<Link href="/" style={styles.link}>
14+
<Text style={styles.linkText}>Go to home screen!</Text>
15+
</Link>
16+
</View>
17+
</>
18+
);
19+
}
20+
21+
const styles = StyleSheet.create({
22+
container: {
23+
flex: 1,
24+
alignItems: 'center',
25+
justifyContent: 'center',
26+
padding: 20,
27+
},
28+
title: {
29+
fontSize: 20,
30+
fontWeight: 'bold',
31+
},
32+
link: {
33+
marginTop: 15,
34+
paddingVertical: 15,
35+
},
36+
linkText: {
37+
fontSize: 14,
38+
color: '#2e78b7',
39+
},
40+
});

app/_layout.tsx

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import FontAwesome from '@expo/vector-icons/FontAwesome';
2+
import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native';
3+
import { useFonts } from 'expo-font';
4+
import { Stack } from 'expo-router';
5+
import * as SplashScreen from 'expo-splash-screen';
6+
import { useEffect } from 'react';
7+
8+
import { useColorScheme } from '@/components/useColorScheme';
9+
10+
export {
11+
// Catch any errors thrown by the Layout component.
12+
ErrorBoundary,
13+
} from 'expo-router';
14+
15+
export const unstable_settings = {
16+
// Ensure that reloading on `/modal` keeps a back button present.
17+
initialRouteName: '(tabs)',
18+
};
19+
20+
// Prevent the splash screen from auto-hiding before asset loading is complete.
21+
SplashScreen.preventAutoHideAsync();
22+
23+
export default function RootLayout() {
24+
const [loaded, error] = useFonts({
25+
SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'),
26+
...FontAwesome.font,
27+
});
28+
29+
// Expo Router uses Error Boundaries to catch errors in the navigation tree.
30+
useEffect(() => {
31+
if (error) throw error;
32+
}, [error]);
33+
34+
useEffect(() => {
35+
if (loaded) {
36+
SplashScreen.hideAsync();
37+
}
38+
}, [loaded]);
39+
40+
if (!loaded) {
41+
return null;
42+
}
43+
44+
return <RootLayoutNav />;
45+
}
46+
47+
function RootLayoutNav() {
48+
const colorScheme = useColorScheme();
49+
50+
return (
51+
<ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
52+
<Stack>
53+
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
54+
<Stack.Screen name="modal" options={{ presentation: 'modal' }} />
55+
</Stack>
56+
</ThemeProvider>
57+
);
58+
}

app/modal.tsx

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { StatusBar } from 'expo-status-bar';
2+
import { Platform, StyleSheet } from 'react-native';
3+
4+
import EditScreenInfo from '@/components/EditScreenInfo';
5+
import { Text, View } from '@/components/Themed';
6+
7+
export default function ModalScreen() {
8+
return (
9+
<View style={styles.container}>
10+
<Text style={styles.title}>Modal</Text>
11+
<View style={styles.separator} lightColor="#eee" darkColor="rgba(255,255,255,0.1)" />
12+
<EditScreenInfo path="app/modal.tsx" />
13+
14+
{/* Use a light status bar on iOS to account for the black space above the modal */}
15+
<StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
16+
</View>
17+
);
18+
}
19+
20+
const styles = StyleSheet.create({
21+
container: {
22+
flex: 1,
23+
alignItems: 'center',
24+
justifyContent: 'center',
25+
},
26+
title: {
27+
fontSize: 20,
28+
fontWeight: 'bold',
29+
},
30+
separator: {
31+
marginVertical: 30,
32+
height: 1,
33+
width: '80%',
34+
},
35+
});

assets/fonts/SpaceMono-Regular.ttf

91.1 KB
Binary file not shown.

assets/images/adaptive-icon.png

17.1 KB
Loading

assets/images/favicon.png

1.43 KB
Loading

assets/images/icon.png

21.9 KB
Loading

assets/images/splash.png

46.2 KB
Loading

babel.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = function (api) {
2+
api.cache(true);
3+
return {
4+
presets: ['babel-preset-expo']
5+
};
6+
};

0 commit comments

Comments
 (0)