Skip to content

Commit 1377f97

Browse files
committed
refactor(example): switch to default template example with similar monorepo package
1 parent 51b9aa6 commit 1377f97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+5886
-3538
lines changed

apps/example/.expo-shared/assets.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

apps/example/.gitignore

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
1+
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2+
3+
# dependencies
4+
node_modules/
5+
16
# Expo
2-
/android
3-
/ios
7+
.expo/
8+
dist/
9+
web-build/
10+
expo-env.d.ts
411

5-
__generated__
6-
node_modules
7-
.expo/*
8-
npm-debug.*
12+
# Native
13+
*.orig.*
914
*.jks
1015
*.p8
1116
*.p12
1217
*.key
1318
*.mobileprovision
14-
*.orig.*
15-
web-build/
19+
20+
# Metro
21+
.metro-health-check*
22+
23+
# debug
24+
npm-debug.*
25+
yarn-debug.*
26+
yarn-error.*
1627

1728
# macOS
1829
.DS_Store
30+
*.pem
31+
32+
# local env files
33+
.env*.local
34+
35+
# typescript
36+
*.tsbuildinfo
37+
38+
app-example

apps/example/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node-linker=hoisted

apps/example/App.tsx

Lines changed: 0 additions & 22 deletions
This file was deleted.

apps/example/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Welcome to your Expo app 👋
2+
3+
This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app).
4+
5+
## Get started
6+
7+
1. Install dependencies
8+
9+
```bash
10+
npm install
11+
```
12+
13+
2. Start the app
14+
15+
```bash
16+
npx expo start
17+
```
18+
19+
In the output, you'll find options to open the app in a
20+
21+
- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
22+
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
23+
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
24+
- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo
25+
26+
You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).
27+
28+
## Get a fresh project
29+
30+
When you're ready, run:
31+
32+
```bash
33+
npm run reset-project
34+
```
35+
36+
This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing.
37+
38+
## Learn more
39+
40+
To learn more about developing your project with Expo, look at the following resources:
41+
42+
- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
43+
- [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.
44+
45+
## Join the community
46+
47+
Join our community of developers creating universal apps.
48+
49+
- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
50+
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.

apps/example/app.json

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,41 @@
11
{
22
"expo": {
3-
"name": "expo-monorepo",
4-
"slug": "expo-monorepo",
3+
"name": "example",
4+
"slug": "example",
55
"version": "1.0.0",
66
"orientation": "portrait",
7-
"icon": "./assets/icon.png",
8-
"splash": {
9-
"image": "./assets/splash.png",
10-
"resizeMode": "contain",
11-
"backgroundColor": "#ffffff"
12-
},
13-
"updates": {
14-
"fallbackToCacheTimeout": 0
15-
},
16-
"assetBundlePatterns": [
17-
"**/*"
18-
],
7+
"icon": "./assets/images/icon.png",
8+
"scheme": "myapp",
9+
"userInterfaceStyle": "automatic",
10+
"newArchEnabled": true,
1911
"ios": {
20-
"bundleIdentifier": "com.bycedric.expomonorepo",
21-
"buildNumber": "1.0.0",
2212
"supportsTablet": true
2313
},
2414
"android": {
25-
"package": "com.bycedric.expomonorepo",
2615
"adaptiveIcon": {
27-
"foregroundImage": "./assets/adaptive-icon.png",
28-
"backgroundColor": "#FFFFFF"
16+
"foregroundImage": "./assets/images/adaptive-icon.png",
17+
"backgroundColor": "#ffffff"
2918
}
3019
},
3120
"web": {
32-
"favicon": "./assets/favicon.png"
21+
"bundler": "metro",
22+
"output": "static",
23+
"favicon": "./assets/images/favicon.png"
24+
},
25+
"plugins": [
26+
"expo-router",
27+
[
28+
"expo-splash-screen",
29+
{
30+
"image": "./assets/images/splash-icon.png",
31+
"imageWidth": 200,
32+
"resizeMode": "contain",
33+
"backgroundColor": "#ffffff"
34+
}
35+
]
36+
],
37+
"experiments": {
38+
"typedRoutes": true
3339
}
3440
}
3541
}

apps/example/app/(tabs)/_layout.tsx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { Tabs } from 'expo-router';
2+
import React from 'react';
3+
import { Platform } from 'react-native';
4+
5+
import { HapticTab } from '@/components/HapticTab';
6+
import { IconSymbol } from '@/components/ui/IconSymbol';
7+
import TabBarBackground from '@/components/ui/TabBarBackground';
8+
import { Colors } from '@/constants/Colors';
9+
import { useColorScheme } from '@/hooks/useColorScheme';
10+
11+
export default function TabLayout() {
12+
const colorScheme = useColorScheme();
13+
14+
return (
15+
<Tabs
16+
screenOptions={{
17+
tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
18+
headerShown: false,
19+
tabBarButton: HapticTab,
20+
tabBarBackground: TabBarBackground,
21+
tabBarStyle: Platform.select({
22+
ios: {
23+
// Use a transparent background on iOS to show the blur effect
24+
position: 'absolute',
25+
},
26+
default: {},
27+
}),
28+
}}
29+
>
30+
<Tabs.Screen
31+
name="index"
32+
options={{
33+
title: 'Home',
34+
tabBarIcon: ({ color }) => <IconSymbol size={28} name="house.fill" color={color} />,
35+
}}
36+
/>
37+
<Tabs.Screen
38+
name="explore"
39+
options={{
40+
title: 'Explore',
41+
tabBarIcon: ({ color }) => <IconSymbol size={28} name="paperplane.fill" color={color} />,
42+
}}
43+
/>
44+
</Tabs>
45+
);
46+
}

apps/example/app/(tabs)/explore.tsx

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
import { StyleSheet, Image, Platform } from 'react-native';
2+
3+
import { Collapsible } from '@/components/Collapsible';
4+
import { ExternalLink } from '@/components/ExternalLink';
5+
import ParallaxScrollView from '@/components/ParallaxScrollView';
6+
import { ThemedText } from '@/components/ThemedText';
7+
import { ThemedView } from '@/components/ThemedView';
8+
import { IconSymbol } from '@/components/ui/IconSymbol';
9+
10+
export default function TabTwoScreen() {
11+
return (
12+
<ParallaxScrollView
13+
headerBackgroundColor={{ light: '#D0D0D0', dark: '#353636' }}
14+
headerImage={
15+
<IconSymbol
16+
size={310}
17+
color="#808080"
18+
name="chevron.left.forwardslash.chevron.right"
19+
style={styles.headerImage}
20+
/>
21+
}
22+
>
23+
<ThemedView style={styles.titleContainer}>
24+
<ThemedText type="title">Explore</ThemedText>
25+
</ThemedView>
26+
<ThemedText>This app includes example code to help you get started.</ThemedText>
27+
<Collapsible title="File-based routing">
28+
<ThemedText>
29+
This app has two screens:{' '}
30+
<ThemedText type="defaultSemiBold">app/(tabs)/index.tsx</ThemedText> and{' '}
31+
<ThemedText type="defaultSemiBold">app/(tabs)/explore.tsx</ThemedText>
32+
</ThemedText>
33+
<ThemedText>
34+
The layout file in <ThemedText type="defaultSemiBold">app/(tabs)/_layout.tsx</ThemedText>{' '}
35+
sets up the tab navigator.
36+
</ThemedText>
37+
<ExternalLink href="https://docs.expo.dev/router/introduction">
38+
<ThemedText type="link">Learn more</ThemedText>
39+
</ExternalLink>
40+
</Collapsible>
41+
<Collapsible title="Android, iOS, and web support">
42+
<ThemedText>
43+
You can open this project on Android, iOS, and the web. To open the web version, press{' '}
44+
<ThemedText type="defaultSemiBold">w</ThemedText> in the terminal running this project.
45+
</ThemedText>
46+
</Collapsible>
47+
<Collapsible title="Images">
48+
<ThemedText>
49+
For static images, you can use the <ThemedText type="defaultSemiBold">@2x</ThemedText> and{' '}
50+
<ThemedText type="defaultSemiBold">@3x</ThemedText> suffixes to provide files for
51+
different screen densities
52+
</ThemedText>
53+
<Image source={require('@/assets/images/react-logo.png')} style={{ alignSelf: 'center' }} />
54+
<ExternalLink href="https://reactnative.dev/docs/images">
55+
<ThemedText type="link">Learn more</ThemedText>
56+
</ExternalLink>
57+
</Collapsible>
58+
<Collapsible title="Custom fonts">
59+
<ThemedText>
60+
Open <ThemedText type="defaultSemiBold">app/_layout.tsx</ThemedText> to see how to load{' '}
61+
<ThemedText style={{ fontFamily: 'SpaceMono' }}>
62+
custom fonts such as this one.
63+
</ThemedText>
64+
</ThemedText>
65+
<ExternalLink href="https://docs.expo.dev/versions/latest/sdk/font">
66+
<ThemedText type="link">Learn more</ThemedText>
67+
</ExternalLink>
68+
</Collapsible>
69+
<Collapsible title="Light and dark mode components">
70+
<ThemedText>
71+
This template has light and dark mode support. The{' '}
72+
<ThemedText type="defaultSemiBold">useColorScheme()</ThemedText> hook lets you inspect
73+
what the user's current color scheme is, and so you can adjust UI colors accordingly.
74+
</ThemedText>
75+
<ExternalLink href="https://docs.expo.dev/develop/user-interface/color-themes/">
76+
<ThemedText type="link">Learn more</ThemedText>
77+
</ExternalLink>
78+
</Collapsible>
79+
<Collapsible title="Animations">
80+
<ThemedText>
81+
This template includes an example of an animated component. The{' '}
82+
<ThemedText type="defaultSemiBold">components/HelloWave.tsx</ThemedText> component uses
83+
the powerful <ThemedText type="defaultSemiBold">react-native-reanimated</ThemedText>{' '}
84+
library to create a waving hand animation.
85+
</ThemedText>
86+
{Platform.select({
87+
ios: (
88+
<ThemedText>
89+
The <ThemedText type="defaultSemiBold">components/ParallaxScrollView.tsx</ThemedText>{' '}
90+
component provides a parallax effect for the header image.
91+
</ThemedText>
92+
),
93+
})}
94+
</Collapsible>
95+
</ParallaxScrollView>
96+
);
97+
}
98+
99+
const styles = StyleSheet.create({
100+
headerImage: {
101+
color: '#808080',
102+
bottom: -90,
103+
left: -35,
104+
position: 'absolute',
105+
},
106+
titleContainer: {
107+
flexDirection: 'row',
108+
gap: 8,
109+
},
110+
});

0 commit comments

Comments
 (0)