From c71bd5462a1198962711e2d2fb8c49fdabd1e127 Mon Sep 17 00:00:00 2001 From: Peace Date: Tue, 1 Jul 2025 22:12:10 +0900 Subject: [PATCH] first sample --- my-expo-sample/.gitignore | 37 + my-expo-sample/app.json | 38 + my-expo-sample/app/(tabs)/_layout.tsx | 59 + my-expo-sample/app/(tabs)/index.tsx | 31 + my-expo-sample/app/(tabs)/two.tsx | 31 + my-expo-sample/app/+html.tsx | 38 + my-expo-sample/app/+not-found.tsx | 40 + my-expo-sample/app/_layout.tsx | 59 + my-expo-sample/app/modal.tsx | 35 + .../assets/fonts/SpaceMono-Regular.ttf | Bin 0 -> 93252 bytes .../assets/images/adaptive-icon.png | Bin 0 -> 17547 bytes my-expo-sample/assets/images/favicon.png | Bin 0 -> 1466 bytes my-expo-sample/assets/images/icon.png | Bin 0 -> 22380 bytes my-expo-sample/assets/images/splash-icon.png | Bin 0 -> 17547 bytes my-expo-sample/components/EditScreenInfo.tsx | 77 + my-expo-sample/components/ExternalLink.tsx | 25 + my-expo-sample/components/StyledText.tsx | 5 + my-expo-sample/components/Themed.tsx | 45 + .../components/__tests__/StyledText-test.js | 10 + .../components/useClientOnlyValue.ts | 4 + .../components/useClientOnlyValue.web.ts | 12 + my-expo-sample/components/useColorScheme.ts | 1 + .../components/useColorScheme.web.ts | 8 + my-expo-sample/constants/Colors.ts | 19 + my-expo-sample/package-lock.json | 11848 ++++++++++++++++ my-expo-sample/package.json | 43 + my-expo-sample/tsconfig.json | 17 + 27 files changed, 12482 insertions(+) create mode 100644 my-expo-sample/.gitignore create mode 100644 my-expo-sample/app.json create mode 100644 my-expo-sample/app/(tabs)/_layout.tsx create mode 100644 my-expo-sample/app/(tabs)/index.tsx create mode 100644 my-expo-sample/app/(tabs)/two.tsx create mode 100644 my-expo-sample/app/+html.tsx create mode 100644 my-expo-sample/app/+not-found.tsx create mode 100644 my-expo-sample/app/_layout.tsx create mode 100644 my-expo-sample/app/modal.tsx create mode 100644 my-expo-sample/assets/fonts/SpaceMono-Regular.ttf create mode 100644 my-expo-sample/assets/images/adaptive-icon.png create mode 100644 my-expo-sample/assets/images/favicon.png create mode 100644 my-expo-sample/assets/images/icon.png create mode 100644 my-expo-sample/assets/images/splash-icon.png create mode 100644 my-expo-sample/components/EditScreenInfo.tsx create mode 100644 my-expo-sample/components/ExternalLink.tsx create mode 100644 my-expo-sample/components/StyledText.tsx create mode 100644 my-expo-sample/components/Themed.tsx create mode 100644 my-expo-sample/components/__tests__/StyledText-test.js create mode 100644 my-expo-sample/components/useClientOnlyValue.ts create mode 100644 my-expo-sample/components/useClientOnlyValue.web.ts create mode 100644 my-expo-sample/components/useColorScheme.ts create mode 100644 my-expo-sample/components/useColorScheme.web.ts create mode 100644 my-expo-sample/constants/Colors.ts create mode 100644 my-expo-sample/package-lock.json create mode 100644 my-expo-sample/package.json create mode 100644 my-expo-sample/tsconfig.json diff --git a/my-expo-sample/.gitignore b/my-expo-sample/.gitignore new file mode 100644 index 0000000..954fc66 --- /dev/null +++ b/my-expo-sample/.gitignore @@ -0,0 +1,37 @@ +# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files + +# dependencies +node_modules/ + +# Expo +.expo/ +dist/ +web-build/ +expo-env.d.ts + +# Native +.kotlin/ +*.orig.* +*.jks +*.p8 +*.p12 +*.key +*.mobileprovision + +# Metro +.metro-health-check* + +# debug +npm-debug.* +yarn-debug.* +yarn-error.* + +# macOS +.DS_Store +*.pem + +# local env files +.env*.local + +# typescript +*.tsbuildinfo diff --git a/my-expo-sample/app.json b/my-expo-sample/app.json new file mode 100644 index 0000000..63bd726 --- /dev/null +++ b/my-expo-sample/app.json @@ -0,0 +1,38 @@ +{ + "expo": { + "name": "my-expo-sample", + "slug": "my-expo-sample", + "version": "1.0.0", + "orientation": "portrait", + "icon": "./assets/images/icon.png", + "scheme": "myexposample", + "userInterfaceStyle": "automatic", + "newArchEnabled": true, + "splash": { + "image": "./assets/images/splash-icon.png", + "resizeMode": "contain", + "backgroundColor": "#ffffff" + }, + "ios": { + "supportsTablet": true + }, + "android": { + "adaptiveIcon": { + "foregroundImage": "./assets/images/adaptive-icon.png", + "backgroundColor": "#ffffff" + }, + "edgeToEdgeEnabled": true + }, + "web": { + "bundler": "metro", + "output": "static", + "favicon": "./assets/images/favicon.png" + }, + "plugins": [ + "expo-router" + ], + "experiments": { + "typedRoutes": true + } + } +} diff --git a/my-expo-sample/app/(tabs)/_layout.tsx b/my-expo-sample/app/(tabs)/_layout.tsx new file mode 100644 index 0000000..30914fb --- /dev/null +++ b/my-expo-sample/app/(tabs)/_layout.tsx @@ -0,0 +1,59 @@ +import React from 'react'; +import FontAwesome from '@expo/vector-icons/FontAwesome'; +import { Link, Tabs } from 'expo-router'; +import { Pressable } from 'react-native'; + +import Colors from '@/constants/Colors'; +import { useColorScheme } from '@/components/useColorScheme'; +import { useClientOnlyValue } from '@/components/useClientOnlyValue'; + +// You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/ +function TabBarIcon(props: { + name: React.ComponentProps['name']; + color: string; +}) { + return ; +} + +export default function TabLayout() { + const colorScheme = useColorScheme(); + + return ( + + , + headerRight: () => ( + + + {({ pressed }) => ( + + )} + + + ), + }} + /> + , + }} + /> + + ); +} diff --git a/my-expo-sample/app/(tabs)/index.tsx b/my-expo-sample/app/(tabs)/index.tsx new file mode 100644 index 0000000..6cbee6d --- /dev/null +++ b/my-expo-sample/app/(tabs)/index.tsx @@ -0,0 +1,31 @@ +import { StyleSheet } from 'react-native'; + +import EditScreenInfo from '@/components/EditScreenInfo'; +import { Text, View } from '@/components/Themed'; + +export default function TabOneScreen() { + return ( + + Tab One + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + }, + title: { + fontSize: 20, + fontWeight: 'bold', + }, + separator: { + marginVertical: 30, + height: 1, + width: '80%', + }, +}); diff --git a/my-expo-sample/app/(tabs)/two.tsx b/my-expo-sample/app/(tabs)/two.tsx new file mode 100644 index 0000000..f2ea47e --- /dev/null +++ b/my-expo-sample/app/(tabs)/two.tsx @@ -0,0 +1,31 @@ +import { StyleSheet } from 'react-native'; + +import EditScreenInfo from '@/components/EditScreenInfo'; +import { Text, View } from '@/components/Themed'; + +export default function TabTwoScreen() { + return ( + + Tab Two + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + }, + title: { + fontSize: 20, + fontWeight: 'bold', + }, + separator: { + marginVertical: 30, + height: 1, + width: '80%', + }, +}); diff --git a/my-expo-sample/app/+html.tsx b/my-expo-sample/app/+html.tsx new file mode 100644 index 0000000..cb31090 --- /dev/null +++ b/my-expo-sample/app/+html.tsx @@ -0,0 +1,38 @@ +import { ScrollViewStyleReset } from 'expo-router/html'; + +// This file is web-only and used to configure the root HTML for every +// web page during static rendering. +// The contents of this function only run in Node.js environments and +// do not have access to the DOM or browser APIs. +export default function Root({ children }: { children: React.ReactNode }) { + return ( + + + + + + + {/* + Disable body scrolling on web. This makes ScrollView components work closer to how they do on native. + However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line. + */} + + + {/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */} +