-
Notifications
You must be signed in to change notification settings - Fork 199
feat(v5): scaffold expo app #2203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jakehobbs
wants to merge
5
commits into
moldy/v5-base
Choose a base branch
from
jake/scaffold-v5-expo-app
base: moldy/v5-base
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule docs-site
updated
8 files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # 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 | ||
|
|
||
| app-example | ||
|
|
||
| # generated native folders | ||
| /ios | ||
| /android |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Welcome to your Expo app 👋 | ||
|
|
||
| This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app). | ||
|
|
||
| ## Get started | ||
|
|
||
| 1. Install dependencies | ||
|
|
||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| 2. Start the app | ||
|
|
||
| ```bash | ||
| npx expo start | ||
| ``` | ||
|
|
||
| In the output, you'll find options to open the app in a | ||
|
|
||
| - [development build](https://docs.expo.dev/develop/development-builds/introduction/) | ||
| - [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/) | ||
| - [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/) | ||
| - [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo | ||
|
|
||
| You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction). | ||
|
|
||
| ## Get a fresh project | ||
|
|
||
| When you're ready, run: | ||
|
|
||
| ```bash | ||
| npm run reset-project | ||
| ``` | ||
|
|
||
| This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing. | ||
|
|
||
| ## Learn more | ||
|
|
||
| To learn more about developing your project with Expo, look at the following resources: | ||
|
|
||
| - [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides). | ||
| - [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web. | ||
|
|
||
| ## Join the community | ||
|
|
||
| Join our community of developers creating universal apps. | ||
|
|
||
| - [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute. | ||
| - [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| { | ||
| "expo": { | ||
| "name": "rn-expo-example-v5", | ||
| "slug": "rn-expo-example-v5", | ||
| "version": "1.0.0", | ||
| "orientation": "portrait", | ||
| "icon": "./assets/images/icon.png", | ||
| "scheme": "rnexpoexamplev5", | ||
| "userInterfaceStyle": "automatic", | ||
| "newArchEnabled": true, | ||
| "ios": { | ||
| "supportsTablet": true | ||
| }, | ||
| "android": { | ||
| "adaptiveIcon": { | ||
| "backgroundColor": "#E6F4FE", | ||
| "foregroundImage": "./assets/images/android-icon-foreground.png", | ||
| "backgroundImage": "./assets/images/android-icon-background.png", | ||
| "monochromeImage": "./assets/images/android-icon-monochrome.png" | ||
| }, | ||
| "edgeToEdgeEnabled": true, | ||
| "predictiveBackGestureEnabled": false | ||
| }, | ||
| "web": { | ||
| "output": "static", | ||
| "favicon": "./assets/images/favicon.png" | ||
| }, | ||
| "plugins": [ | ||
| "expo-router", | ||
| [ | ||
| "expo-splash-screen", | ||
| { | ||
| "image": "./assets/images/splash-icon.png", | ||
| "imageWidth": 200, | ||
| "resizeMode": "contain", | ||
| "backgroundColor": "#ffffff", | ||
| "dark": { | ||
| "backgroundColor": "#000000" | ||
| } | ||
| } | ||
| ] | ||
| ], | ||
| "experiments": { | ||
| "typedRoutes": true, | ||
| "reactCompiler": true, | ||
| "autolinkingModuleResolution": true | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { Tabs } from "expo-router"; | ||
| import React from "react"; | ||
|
|
||
| import { HapticTab } from "@/components/haptic-tab"; | ||
| import { IconSymbol } from "@/components/ui/icon-symbol"; | ||
| import { Colors } from "@/constants/theme"; | ||
| import { useColorScheme } from "@/hooks/use-color-scheme"; | ||
|
|
||
| export default function TabLayout() { | ||
| const colorScheme = useColorScheme(); | ||
|
|
||
| return ( | ||
| <Tabs | ||
| screenOptions={{ | ||
| tabBarActiveTintColor: Colors[colorScheme ?? "light"].tint, | ||
| headerShown: false, | ||
| tabBarButton: HapticTab, | ||
| }} | ||
| > | ||
| <Tabs.Screen | ||
| name="index" | ||
| options={{ | ||
| title: "Home", | ||
| tabBarIcon: ({ color }) => ( | ||
| <IconSymbol size={28} name="house.fill" color={color} /> | ||
| ), | ||
| }} | ||
| /> | ||
| </Tabs> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import { Image } from "expo-image"; | ||
| import { StyleSheet } from "react-native"; | ||
|
|
||
| import ParallaxScrollView from "@/components/parallax-scroll-view"; | ||
| import { ThemedText } from "@/components/themed-text"; | ||
| import { ThemedView } from "@/components/themed-view"; | ||
|
|
||
| export default function HomeScreen() { | ||
| return ( | ||
| <ParallaxScrollView | ||
| headerBackgroundColor={{ light: "#A1CEDC", dark: "#1D3D47" }} | ||
| headerImage={ | ||
| <Image | ||
| source={require("@/assets/images/partial-react-logo.png")} | ||
| style={styles.reactLogo} | ||
| /> | ||
| } | ||
| > | ||
| <ThemedView style={styles.titleContainer}> | ||
| <ThemedText type="title">Welcome!</ThemedText> | ||
| </ThemedView> | ||
| <ThemedView style={styles.stepContainer}> | ||
| <ThemedText type="subtitle">Alchemy Smart Wallets</ThemedText> | ||
| <ThemedText>TODO</ThemedText> | ||
| </ThemedView> | ||
| </ParallaxScrollView> | ||
| ); | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| titleContainer: { | ||
| flexDirection: "row", | ||
| alignItems: "center", | ||
| gap: 8, | ||
| }, | ||
| stepContainer: { | ||
| gap: 8, | ||
| marginBottom: 8, | ||
| }, | ||
| reactLogo: { | ||
| height: 178, | ||
| width: 290, | ||
| bottom: 0, | ||
| left: 0, | ||
| position: "absolute", | ||
| }, | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { | ||
| DarkTheme, | ||
| DefaultTheme, | ||
| ThemeProvider, | ||
| } from "@react-navigation/native"; | ||
| import { Stack } from "expo-router"; | ||
| import { StatusBar } from "expo-status-bar"; | ||
| import "react-native-reanimated"; | ||
|
|
||
| import { useColorScheme } from "@/hooks/use-color-scheme"; | ||
| import { WagmiProvider } from "wagmi"; | ||
| import { config } from "@/config"; | ||
| import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; | ||
|
|
||
| export const unstable_settings = { | ||
| anchor: "(tabs)", | ||
| }; | ||
|
|
||
| const queryClient = new QueryClient(); | ||
|
|
||
| export default function RootLayout() { | ||
| const colorScheme = useColorScheme(); | ||
|
|
||
| return ( | ||
| <WagmiProvider config={config}> | ||
| <QueryClientProvider client={queryClient}> | ||
| <ThemeProvider | ||
| value={colorScheme === "dark" ? DarkTheme : DefaultTheme} | ||
| > | ||
| <Stack> | ||
| <Stack.Screen name="(tabs)" options={{ headerShown: false }} /> | ||
| <Stack.Screen | ||
| name="modal" | ||
| options={{ presentation: "modal", title: "Modal" }} | ||
| /> | ||
| </Stack> | ||
| <StatusBar style="auto" /> | ||
jakehobbs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </ThemeProvider> | ||
| </QueryClientProvider> | ||
| </WagmiProvider> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import { Link } from "expo-router"; | ||
| import { StyleSheet } from "react-native"; | ||
|
|
||
| import { ThemedText } from "@/components/themed-text"; | ||
| import { ThemedView } from "@/components/themed-view"; | ||
|
|
||
| export default function ModalScreen() { | ||
| return ( | ||
| <ThemedView style={styles.container}> | ||
| <ThemedText type="title">This is a modal</ThemedText> | ||
| <Link href="/" dismissTo 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, | ||
| }, | ||
| }); |
Binary file added
BIN
+17.1 KB
examples/rn-expo-example-v5/assets/images/android-icon-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+76.9 KB
examples/rn-expo-example-v5/assets/images/android-icon-foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.04 KB
examples/rn-expo-example-v5/assets/images/android-icon-monochrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| module.exports = function (api) { | ||
| api.cache(true); | ||
| return { | ||
| presets: ["babel-preset-expo"], | ||
| plugins: ["react-native-reanimated/plugin"], | ||
| }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { Href, Link } from "expo-router"; | ||
| import { | ||
| openBrowserAsync, | ||
| WebBrowserPresentationStyle, | ||
| } from "expo-web-browser"; | ||
| import { type ComponentProps } from "react"; | ||
|
|
||
| type Props = Omit<ComponentProps<typeof Link>, "href"> & { | ||
| href: Href & string; | ||
| }; | ||
|
|
||
| export function ExternalLink({ href, ...rest }: Props) { | ||
| return ( | ||
| <Link | ||
| target="_blank" | ||
| {...rest} | ||
| href={href} | ||
| onPress={async (event) => { | ||
| if (process.env.EXPO_OS !== "web") { | ||
| // Prevent the default behavior of linking to the default browser on native. | ||
| event.preventDefault(); | ||
| // Open the link in an in-app browser. | ||
| await openBrowserAsync(href, { | ||
| presentationStyle: WebBrowserPresentationStyle.AUTOMATIC, | ||
| }); | ||
| } | ||
| }} | ||
| /> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { BottomTabBarButtonProps } from "@react-navigation/bottom-tabs"; | ||
| import { PlatformPressable } from "@react-navigation/elements"; | ||
| import * as Haptics from "expo-haptics"; | ||
|
|
||
| export function HapticTab(props: BottomTabBarButtonProps) { | ||
| return ( | ||
| <PlatformPressable | ||
| {...props} | ||
| onPressIn={(ev) => { | ||
| if (process.env.EXPO_OS === "ios") { | ||
| // Add a soft haptic feedback when pressing down on the tabs. | ||
| Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); | ||
| } | ||
| props.onPressIn?.(ev); | ||
| }} | ||
| /> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.