Skip to content

Commit 313609c

Browse files
authored
feat(native): ✨ create basic react native app showcase (#92)
1 parent e4deeb9 commit 313609c

Some content is hidden

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

71 files changed

+18122
-4
lines changed

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ pnpm-lock.yaml
1313
public
1414
**/*/CHANGELOG.md
1515
**/types/generated/*.d.ts
16+
17+
# Native app
18+
native-app

cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"Faris",
3939
"fbca",
4040
"folke",
41+
"frappeuireactnative",
4142
"gacp",
4243
"gifv",
4344
"groupby",
@@ -69,6 +70,7 @@
6970
"Rushabh",
7071
"sentryclirc",
7172
"shadcn",
73+
"springify",
7274
"styl",
7375
"svgz",
7476
"syncer",

eslint.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ export default [
9595
// no ignore
9696
"!**/.*",
9797
"!monorepo.code-workspace",
98-
// Node.js
98+
// Native app
99+
"native-app",
100+
// Node.js
99101
".npmrc",
100102
".nvmrc",
101103
// Lock files

native-app/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
node_modules/
2+
.expo/
3+
dist/
4+
npm-debug.*
5+
*.jks
6+
*.p8
7+
*.p12
8+
*.key
9+
*.mobileprovision
10+
*.orig.*
11+
web-build/
12+
13+
14+
15+
16+
ios
17+
android
18+
19+
# macOS
20+
.DS_Store
21+
22+
# Temporary files created by Metro to check the health of the file watcher
23+
.metro-health-check*

native-app/App.tsx

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import { createDrawerNavigator } from '@react-navigation/drawer';
2+
import { NavigationContainer } from '@react-navigation/native';
3+
import { StatusBar } from 'expo-status-bar';
4+
import React from 'react';
5+
import { SafeAreaView, useColorScheme } from 'react-native';
6+
import Animated from 'react-native-reanimated';
7+
import { SafeAreaProvider } from 'react-native-safe-area-context';
8+
import './gesture-handler';
9+
import './global.css';
10+
11+
import { AvatarUI } from '@/AvatarUI';
12+
import { ButtonUI } from '@/ButtonUI';
13+
import { GamePlanUI } from '@/GamePlanUI';
14+
import { TagUI } from '@/TagUI';
15+
import { Button } from '@/components/ui/button';
16+
import Icon from '@/components/ui/icon';
17+
import { cx } from '@/lib/utils';
18+
import { CaretRight } from '@/svg/CaretRight';
19+
20+
const Drawer = createDrawerNavigator();
21+
22+
const CustomDrawer = ({ navigation }: { navigation: any }) => {
23+
return (
24+
<SafeAreaView className="flex-1 px-4">
25+
<Button
26+
onPress={() => navigation.navigate('Button')}
27+
className="flex-row items-start justify-between"
28+
suffix={<Icon icon={<CaretRight />} />}
29+
size="xl"
30+
variant="ghost">
31+
Button
32+
</Button>
33+
<Button
34+
onPress={() => navigation.navigate('Avatar')}
35+
suffix={<Icon icon={<CaretRight />} />}
36+
className="flex-row items-start justify-between"
37+
size="xl"
38+
variant="ghost">
39+
Avatar
40+
</Button>
41+
<Button
42+
onPress={() => navigation.navigate('Tag')}
43+
suffix={<Icon icon={<CaretRight />} />}
44+
className="flex-row items-start justify-between"
45+
size="xl"
46+
variant="ghost">
47+
Tag
48+
</Button>
49+
<Button
50+
onPress={() => navigation.navigate('GamePlan')}
51+
suffix={<Icon icon={<CaretRight />} />}
52+
className="flex-row items-start justify-between"
53+
size="xl"
54+
variant="ghost">
55+
Game Plan
56+
</Button>
57+
</SafeAreaView>
58+
);
59+
};
60+
61+
function MyDrawer() {
62+
return (
63+
<Drawer.Navigator
64+
initialRouteName="GamePlan"
65+
screenOptions={{ headerShown: false }}
66+
drawerContent={(props) => <CustomDrawer {...props} />}>
67+
<Drawer.Screen name="Button" component={ButtonUI} />
68+
<Drawer.Screen name="Avatar" component={AvatarUI} />
69+
<Drawer.Screen name="Tag" component={TagUI} />
70+
<Drawer.Screen name="GamePlan" component={GamePlanUI} />
71+
</Drawer.Navigator>
72+
);
73+
}
74+
75+
export default function App() {
76+
const colorScheme = useColorScheme();
77+
return (
78+
<NavigationContainer>
79+
<SafeAreaProvider>
80+
<Animated.View
81+
className={cx('flex-1', colorScheme === 'dark' ? 'bg-black dark' : 'bg-white')}>
82+
<StatusBar style="auto" />
83+
<MyDrawer />
84+
</Animated.View>
85+
</SafeAreaProvider>
86+
</NavigationContainer>
87+
);
88+
}

native-app/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Timeless
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

native-app/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Frappe UI React Native Registry
2+
3+
## Development
4+
5+
You can run the app using Expo. 🎉🎉
6+
7+
Clone the repository and run the following commands:
8+
9+
```bash
10+
# Clone the repository
11+
git clone [email protected]:timelessco/frappe-ui-react.git
12+
13+
# Navigate to the native app
14+
cd frappe-ui-react/apps/native-app
15+
16+
# Install dependencies
17+
### Make sure you have node version v20
18+
npm install
19+
20+
21+
# Build the app
22+
eas build --profile development
23+
24+
# Start the development server
25+
npm run start
26+
27+
```

native-app/app.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"expo": {
3+
"name": "frappe-ui-react-native",
4+
"slug": "frappe-ui-react-native",
5+
"version": "1.0.0",
6+
"web": {
7+
"favicon": "./assets/favicon.png",
8+
"bundler": "metro"
9+
},
10+
"experiments": {
11+
"tsconfigPaths": true
12+
},
13+
"plugins": [
14+
[
15+
"expo-dev-launcher",
16+
{
17+
"launchMode": "most-recent"
18+
}
19+
],
20+
[
21+
"expo-font",
22+
{
23+
"fonts": [
24+
"./assets/fonts/InterDisplay-Black.ttf",
25+
"./assets/fonts/InterDisplay-Bold.ttf",
26+
"./assets/fonts/InterDisplay-Medium.ttf",
27+
"./assets/fonts/InterDisplay-Regular.ttf",
28+
"./assets/fonts/InterDisplay-SemiBold.ttf"
29+
]
30+
}
31+
]
32+
],
33+
"orientation": "portrait",
34+
"icon": "./assets/icon.png",
35+
"userInterfaceStyle": "automatic",
36+
"splash": {
37+
"image": "./assets/splash.png",
38+
"resizeMode": "contain",
39+
"backgroundColor": "#ffffff"
40+
},
41+
"assetBundlePatterns": ["**/*"],
42+
"ios": {
43+
"supportsTablet": true,
44+
"bundleIdentifier": "com.timelessco.frappeuireactnative"
45+
},
46+
"android": {
47+
"adaptiveIcon": {
48+
"foregroundImage": "./assets/adaptive-icon.png",
49+
"backgroundColor": "#ffffff"
50+
},
51+
"package": "com.timelessco.frappeuireactnative"
52+
},
53+
"extra": {
54+
"eas": {
55+
"projectId": "99094a05-1c65-447d-b0ea-933f14c098f7"
56+
}
57+
}
58+
}
59+
}
17.1 KB
Loading

native-app/assets/favicon.png

1.43 KB
Loading

0 commit comments

Comments
 (0)