refactored layout to be screens. work on jest tests.
This commit is contained in:
@ -1,26 +0,0 @@
|
||||
import { Tabs } from 'expo-router';
|
||||
import React from 'react';
|
||||
import { Platform } from 'react-native';
|
||||
|
||||
import { Colors } from '@/constants/Colors';
|
||||
import { useColorScheme } from '@/hooks/useColorScheme';
|
||||
|
||||
export default function TabLayout() {
|
||||
const colorScheme = useColorScheme();
|
||||
|
||||
return (
|
||||
<Tabs
|
||||
screenOptions={{
|
||||
tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
|
||||
headerShown: false,
|
||||
tabBarStyle: Platform.select({
|
||||
ios: {
|
||||
// Use a transparent background on iOS to show the blur effect
|
||||
position: 'absolute',
|
||||
},
|
||||
default: {},
|
||||
}),
|
||||
}}>
|
||||
</Tabs>
|
||||
);
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
import { LanguageSelection } from '@/components/LanguageSelection';
|
||||
import { useState } from 'react';
|
||||
import { Text } from 'react-native';
|
||||
import { Image, StyleSheet, Platform } from 'react-native';
|
||||
import { Conversation, Speaker } from '../lib/conversation';
|
||||
import { language_matrix_entry, Translator } from '../i18n/api';
|
||||
import ConversationThread from '@/components/ConversationThread';
|
||||
|
||||
export default function HomeScreen() {
|
||||
|
||||
const [language, setLanguage] = useState<language_matrix_entry | undefined>()
|
||||
const [conversation, setConversation] = useState<Conversation|undefined>();
|
||||
|
||||
return (
|
||||
conversation ? <ConversationThread conversation={conversation} /> :
|
||||
<LanguageSelection onLanguageSelected={
|
||||
(language) => {
|
||||
setConversation(new Conversation(
|
||||
new Translator("en", language.code),
|
||||
{id: "host", language: "en"},
|
||||
{id: "guest", language: language.code},
|
||||
))
|
||||
}
|
||||
} />
|
||||
);
|
||||
}
|
||||
|
||||
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',
|
||||
},
|
||||
});
|
@ -30,10 +30,9 @@ export default function RootLayout() {
|
||||
return (
|
||||
<ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
|
||||
<Stack>
|
||||
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
||||
<Stack.Screen name="(screens)" options={{ headerShown: false }} />
|
||||
<Stack.Screen name="+not-found" />
|
||||
</Stack>
|
||||
<StatusBar style="auto" />
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
|
@ -30,4 +30,6 @@ export async function getDb(migrationDirection : "up" | "down" = "up") {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return db;
|
||||
}
|
Reference in New Issue
Block a user