Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.8.0
4 changes: 0 additions & 4 deletions apps/mobile/.expo-shared/assets.json

This file was deleted.

39 changes: 31 additions & 8 deletions apps/mobile/.gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
/android
/ios
.expo/
dist/
web-build/

__generated__
node_modules
.expo/*
npm-debug.*
# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
# The following patterns were generated by expo-cli

expo-env.d.ts
# @end expo-cli
22 changes: 0 additions & 22 deletions apps/mobile/App.tsx

This file was deleted.

18 changes: 13 additions & 5 deletions apps/mobile/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"expo": {
"name": "expo-monorepo",
"slug": "expo-monorepo",
"scheme": "expo-monorepo",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "automatic",
"icon": "./assets/images/icon.png",
"splash": {
"image": "./assets/splash.png",
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
Expand All @@ -24,12 +26,18 @@
"android": {
"package": "com.bycedric.expomonorepo",
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
}
},
"web": {
"favicon": "./assets/favicon.png"
"output": "static",
"bundler": "metro",
"favicon": "./assets/images/favicon.png"
},
"experiments": {
"tsconfigPaths": true,
"typedRoutes": true
}
}
}
}
57 changes: 57 additions & 0 deletions apps/mobile/app/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import FontAwesome from '@expo/vector-icons/FontAwesome';
import { Link, Tabs } from 'expo-router';
import { Pressable, useColorScheme } from 'react-native';

// import Colors from "@/constants/Colors";

/**
* You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/
*/
function TabBarIcon(props: {
name: React.ComponentProps<typeof FontAwesome>['name'];
color: string;
}) {
return <FontAwesome size={28} style={{ marginBottom: -3 }} {...props} />;
}

export default function TabLayout() {
const colorScheme = useColorScheme();

return (
<Tabs
screenOptions={
{
// tabBarActiveTintColor: Colors[colorScheme ?? "light"].tint,
}
}
>
<Tabs.Screen
name="index"
options={{
title: 'Home',
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
headerRight: () => (
<Link href="/modal" asChild>
<Pressable>
{({ pressed }) => (
<FontAwesome
name="info-circle"
size={25}
style={{ marginRight: 15, opacity: pressed ? 0.5 : 1 }}
/>
)}
</Pressable>
</Link>
),
}}
/>
<Tabs.Screen
name="two"
options={{
title: 'Tab Two',
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
}}
/>
</Tabs>
);
}
20 changes: 20 additions & 0 deletions apps/mobile/app/(tabs)/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { vars } from 'nativewind';
import { Pressable, Text, View } from 'react-native';

const theme = vars({
'--theme-fg': 'red',
});

const App = () => {
return (
<View className="flex-1 items-center justify-center" style={theme}>
<Text className="font-bold text-[--theme-fg]">Variables!</Text>
<Text className="font-bold active:scale-150 active:text-[--theme-fg] transition duration-[500ms]">
Transitions
</Text>
<Text className="font-bold animate-bounce placeholder:text-white">Animations</Text>
</View>
);
};

export default App;
9 changes: 9 additions & 0 deletions apps/mobile/app/(tabs)/two.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Text, View } from 'react-native';

export default function TabTwoScreen() {
return (
<View>
<Text className="text-black-400">Tab two!!</Text>
</View>
);
}
46 changes: 46 additions & 0 deletions apps/mobile/app/+html.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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 (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />

{/*
This viewport disables scaling which makes the mobile website act more like a native app.
However this does reduce built-in accessibility. If you want to enable scaling, use this instead:
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
*/}
<meta
name="viewport"
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1.00001,viewport-fit=cover"
/>
{/*
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.
*/}
<ScrollViewStyleReset />

{/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */}
<style dangerouslySetInnerHTML={{ __html: responsiveBackground }} />
{/* Add any additional <head> elements that you want globally available on web... */}
</head>
<body>{children}</body>
</html>
);
}

const responsiveBackground = `
body {
background-color: #fff;
}
@media (prefers-color-scheme: dark) {
body {
background-color: #000;
}
}`;
38 changes: 38 additions & 0 deletions apps/mobile/app/[...missing].tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { Link, Stack } from 'expo-router';
import { StyleSheet, Text, View } from 'react-native';

export default function NotFoundScreen() {
return (
<>
<Stack.Screen options={{ title: 'Oops!' }} />
<View style={styles.container}>
<Text style={styles.title}>This screen doesn't exist.</Text>

<Link href="/" style={styles.link}>
<Text style={styles.linkText}>Go to home screen!</Text>
</Link>
</View>
</>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
padding: 20,
},
title: {
fontSize: 20,
fontWeight: 'bold',
},
link: {
marginTop: 15,
paddingVertical: 15,
},
linkText: {
fontSize: 14,
color: '#2e78b7',
},
});
55 changes: 55 additions & 0 deletions apps/mobile/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import '../global.css';
import FontAwesome from '@expo/vector-icons/FontAwesome';
import { useFonts } from 'expo-font';
import { SplashScreen, Stack } from 'expo-router';
import { vars } from 'nativewind';
import { memo, useEffect } from 'react';
import { View, StyleSheet } from 'react-native';

export {
// Catch any errors thrown by the Layout component.
ErrorBoundary,
} from 'expo-router';

export const unstable_settings = {
// Ensure that reloading on `/modal` keeps a back button present.
initialRouteName: '(tabs)',
};

// Prevent the splash screen from auto-hiding before asset loading is complete.
SplashScreen.preventAutoHideAsync();

export default memo(function RootLayout() {
const [loaded, error] = useFonts({
SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'),
...FontAwesome.font,
});

// Expo Router uses Error Boundaries to catch errors in the navigation tree.
useEffect(() => {
if (error) throw error;
}, [error]);

useEffect(() => {
if (loaded) {
SplashScreen.hideAsync();
}
}, [loaded]);

if (!loaded) {
return null;
}

return <RootLayoutNav />;
});

function RootLayoutNav() {
return (
<View style={StyleSheet.absoluteFill}>
<Stack>
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen name="modal" options={{ presentation: 'modal' }} />
</Stack>
</View>
);
}
9 changes: 9 additions & 0 deletions apps/mobile/app/modal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Text, View } from 'react-native';

export default function Modal() {
return (
<View className="flex-1 items-center justify-center">
<Text className="text-3xl font-bold mb-[30px]">Modal</Text>
</View>
);
}
Binary file added apps/mobile/assets/fonts/SpaceMono-Regular.ttf
Binary file not shown.
File renamed without changes
File renamed without changes
Binary file added apps/mobile/assets/images/splash.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 removed apps/mobile/assets/splash.png
Binary file not shown.
15 changes: 14 additions & 1 deletion apps/mobile/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
presets: [
[
'babel-preset-expo',
{
jsxImportSource: 'nativewind',
},
],
'nativewind/babel',
],
plugins: [
// Required for expo-router
'expo-router/babel',
'react-native-reanimated/plugin',
],
};
};
Loading