-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a40062a
commit 093eb8d
Showing
7 changed files
with
17,522 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,26 @@ | ||
import React from 'react'; | ||
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; | ||
import { DefaultTheme, NavigationContainer } from '@react-navigation/native'; | ||
import { createNativeStackNavigator } from '@react-navigation/native-stack'; | ||
import SvgContactSelected from '@/icons/ContactSelected'; | ||
import SvgContactUnselected from '@/icons/ContactUnselected'; | ||
import SvgHomeSelected from '@/icons/HomeSelected'; | ||
import SvgHomeUnselected from '@/icons/HomeUnselected'; | ||
import ContactScreen from '@/screens/contact/ContactScreen'; | ||
import LoginScreen from '@/screens/login/LoginScreen'; | ||
import TreeSearchScreen from '@/screens/tree_search/TreeSearchScreen'; | ||
import { LoginStackParamList } from '@/types/navigation'; | ||
import { Text } from 'react-native'; | ||
import { useFonts } from 'expo-font'; | ||
import { DMSans_400Regular, DMSans_700Bold } from '@expo-google-fonts/dm-sans'; | ||
import { DefaultTheme } from '@react-navigation/native'; | ||
import AppNavigator from '@/navigation/AppNavigator'; | ||
import colors from '@/styles/colors'; | ||
|
||
DefaultTheme.colors.background = '#FFFFFF'; | ||
const LoginStack = createNativeStackNavigator<LoginStackParamList>(); | ||
const NavigationTab = createBottomTabNavigator(); | ||
|
||
function NavigationBar() { | ||
return ( | ||
<NavigationTab.Navigator | ||
initialRouteName="TreeSearch" | ||
screenOptions={({ route }) => ({ | ||
tabBarShowLabel: false, | ||
tabBarStyle: { paddingTop: 10 }, | ||
tabBarIcon: ({ focused }) => { | ||
if (route.name === 'TreeSearch') { | ||
return focused ? ( | ||
<SvgHomeSelected width={30} height={30} /> | ||
) : ( | ||
<SvgHomeUnselected width={30} height={30} /> | ||
); | ||
} | ||
if (route.name === 'Contact') { | ||
return focused ? ( | ||
<SvgContactSelected width={30} height={30} /> | ||
) : ( | ||
<SvgContactUnselected width={30} height={30} /> | ||
); | ||
} | ||
return null; | ||
}, | ||
})} | ||
> | ||
<NavigationTab.Screen | ||
name="TreeSearch" | ||
component={TreeSearchScreen} | ||
options={{ headerShown: false }} | ||
/> | ||
<NavigationTab.Screen | ||
name="Contact" | ||
component={ContactScreen} | ||
options={{ headerShown: false }} | ||
/> | ||
</NavigationTab.Navigator> | ||
); | ||
} | ||
DefaultTheme.colors.background = colors.white; | ||
|
||
export default function App() { | ||
return ( | ||
<NavigationContainer> | ||
<LoginStack.Navigator initialRouteName="Login"> | ||
<LoginStack.Screen | ||
name="Login" | ||
component={LoginScreen} | ||
options={{ headerShown: false }} | ||
/> | ||
<LoginStack.Screen | ||
name="Main" | ||
component={NavigationBar} | ||
options={{ headerShown: false }} | ||
/> | ||
</LoginStack.Navigator> | ||
</NavigationContainer> | ||
); | ||
const [fontsLoaded] = useFonts({ | ||
DMSans_400Regular, | ||
DMSans_700Bold, | ||
}); | ||
|
||
if (!fontsLoaded) { | ||
return null; | ||
} | ||
|
||
const defaultFontFamily = 'DMSans_400Regular'; | ||
(Text as any).defaultProps = (Text as any).defaultProps || {}; | ||
(Text as any).defaultProps.style = { fontFamily: defaultFontFamily }; | ||
|
||
return <AppNavigator />; | ||
} |
Oops, something went wrong.