feat: iphone app
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { Stack } from 'expo-router';
|
||||
import { StatusBar } from 'expo-status-bar';
|
||||
import { useFonts } from 'expo-font';
|
||||
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
||||
import { AppProvider } from '../src/state/app-state';
|
||||
import { theme } from '../src/design/theme';
|
||||
|
||||
export default function Layout() {
|
||||
const [loaded, error] = useFonts({Inter: require('../assets/fonts/Inter.ttf')});
|
||||
if (!loaded && !error) return null;
|
||||
return <SafeAreaProvider><AppProvider><StatusBar style="light" /><Stack screenOptions={{headerShown: false, contentStyle: {backgroundColor: theme.background}, animation: 'fade', gestureEnabled: true}} /></AppProvider></SafeAreaProvider>;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { Redirect } from 'expo-router';
|
||||
import { useAppState } from '../src/state/app-state';
|
||||
export default function Index() {
|
||||
const {state, ready} = useAppState();
|
||||
if (!ready) return null;
|
||||
return <Redirect href={{pathname: '/screen/[id]', params: {id: state.onboarded ? (state.variant === 'watch' ? '560-251' : '431-2') : '2-2'}}} />;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { useLocalSearchParams } from 'expo-router';
|
||||
import { DesignScreen } from '../../src/components/design-screen';
|
||||
export default function Screen() {
|
||||
const {id, preview} = useLocalSearchParams<{id: string; preview?: string}>();
|
||||
return <DesignScreen id={id.replace('-', ':')} preview={preview === '1'} />;
|
||||
}
|
||||
Reference in New Issue
Block a user