diff options
author | Ivan Chen <ivan@tagg.id> | 2021-07-07 14:42:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-07 14:42:15 -0400 |
commit | 766c55c52071ecabc40aa527d6196c39eff01b5c (patch) | |
tree | 22921694ff36e40c1514f110a838febd47b9c140 /src | |
parent | f88193340ef5110080732d37c6a6ab69013f7b36 (diff) | |
parent | d2347eef0e22c7d47f090e6ce0a8a2c50506c894 (diff) |
Merge pull request #485 from sotech117/tma931-remove-search-on-bottom-navbar
[TMA-931] Remove Search on Bottom Navbar
Diffstat (limited to 'src')
-rw-r--r-- | src/assets/navigationIcons/new-upload.png | bin | 0 -> 454951 bytes | |||
-rw-r--r-- | src/components/common/NavigationIcon.tsx | 16 | ||||
-rw-r--r-- | src/routes/main/MainStackNavigator.tsx | 2 | ||||
-rw-r--r-- | src/routes/main/MainStackScreen.tsx | 13 | ||||
-rw-r--r-- | src/routes/tabs/NavigationBar.tsx | 28 | ||||
-rw-r--r-- | src/screens/profile/CaptionScreen.tsx | 4 | ||||
-rw-r--r-- | src/types/types.ts | 1 |
7 files changed, 37 insertions, 27 deletions
diff --git a/src/assets/navigationIcons/new-upload.png b/src/assets/navigationIcons/new-upload.png Binary files differnew file mode 100644 index 00000000..f6a5487c --- /dev/null +++ b/src/assets/navigationIcons/new-upload.png diff --git a/src/components/common/NavigationIcon.tsx b/src/components/common/NavigationIcon.tsx index 5128f3da..debb36b3 100644 --- a/src/components/common/NavigationIcon.tsx +++ b/src/components/common/NavigationIcon.tsx @@ -18,6 +18,7 @@ interface NavigationIconProps extends TouchableOpacityProps { | 'Chat'; disabled?: boolean; newIcon?: boolean; + isBigger?: boolean; } const NavigationIcon = (props: NavigationIconProps) => { @@ -35,7 +36,7 @@ const NavigationIcon = (props: NavigationIconProps) => { break; case 'Upload': imgSrc = props.disabled - ? require('../../assets/navigationIcons/upload.png') + ? require('../../assets/navigationIcons/new-upload.png') : require('../../assets/navigationIcons/upload-clicked.png'); break; case 'Notifications': @@ -68,7 +69,10 @@ const NavigationIcon = (props: NavigationIconProps) => { return ( <View style={styles.container}> <TouchableOpacity {...props}> - <Image source={imgSrc} style={styles.icon} /> + <Image + source={imgSrc} + style={props.isBigger ? styles.biggerIcon : styles.icon} + /> </TouchableOpacity> </View> ); @@ -87,8 +91,12 @@ const styles = StyleSheet.create({ shadowOpacity: 0.4, }, icon: { - height: 30, - width: 30, + height: 28, + width: 28, + }, + biggerIcon: { + height: 44, + width: 44, }, }); diff --git a/src/routes/main/MainStackNavigator.tsx b/src/routes/main/MainStackNavigator.tsx index a5d73988..bc023da8 100644 --- a/src/routes/main/MainStackNavigator.tsx +++ b/src/routes/main/MainStackNavigator.tsx @@ -14,7 +14,7 @@ export type MainStackParams = { SuggestedPeople: { screenType: ScreenType; }; - Search: { + Upload: { screenType: ScreenType; }; RequestContactsAccess: { diff --git a/src/routes/main/MainStackScreen.tsx b/src/routes/main/MainStackScreen.tsx index 65a695f5..948f37b8 100644 --- a/src/routes/main/MainStackScreen.tsx +++ b/src/routes/main/MainStackScreen.tsx @@ -26,7 +26,6 @@ import { PrivacyScreen, ProfileScreen, RequestContactsAccess, - SearchScreen, SettingsScreen, SocialMediaTaggs, SuggestedPeopleScreen, @@ -60,22 +59,22 @@ interface MainStackProps { const MainStackScreen: React.FC<MainStackProps> = ({route}) => { const {screenType} = route.params; - const isSearchTab = screenType === ScreenType.Search; const isNotificationsTab = screenType === ScreenType.Notifications; const isSuggestedPeopleTab = screenType === ScreenType.SuggestedPeople; + const isUploadTab = screenType === ScreenType.Upload; const initialRouteName = (() => { switch (screenType) { case ScreenType.Profile: return 'Profile'; - case ScreenType.Search: - return 'Search'; case ScreenType.Notifications: return 'Notifications'; case ScreenType.SuggestedPeople: return 'SuggestedPeople'; case ScreenType.Chat: return 'ChatList'; + case ScreenType.Upload: + return 'Upload'; } })(); @@ -130,10 +129,10 @@ const MainStackScreen: React.FC<MainStackProps> = ({route}) => { initialParams={{screenType}} /> )} - {isSearchTab && ( + {isUploadTab && ( <MainStack.Screen - name="Search" - component={SearchScreen} + name="Upload" + component={CameraScreen} initialParams={{screenType}} /> )} diff --git a/src/routes/tabs/NavigationBar.tsx b/src/routes/tabs/NavigationBar.tsx index c3a42739..12f6ab58 100644 --- a/src/routes/tabs/NavigationBar.tsx +++ b/src/routes/tabs/NavigationBar.tsx @@ -46,10 +46,16 @@ const NavigationBar: React.FC = () => { switch (route.name) { case 'Home': return <NavigationIcon tab="Home" disabled={!focused} />; - case 'Search': - return <NavigationIcon tab="Search" disabled={!focused} />; + case 'Chat': + return <NavigationIcon tab="Chat" disabled={!focused} />; case 'Upload': - return <NavigationIcon tab="Upload" disabled={!focused} />; + return ( + <NavigationIcon + tab="Upload" + disabled={!focused} + isBigger={true} + /> + ); case 'Notifications': return ( <NavigationIcon @@ -60,8 +66,6 @@ const NavigationBar: React.FC = () => { disabled={!focused} /> ); - case 'Chat': - return <NavigationIcon tab="Chat" disabled={!focused} />; case 'Profile': return <NavigationIcon tab="Profile" disabled={!focused} />; case 'SuggestedPeople': @@ -91,9 +95,14 @@ const NavigationBar: React.FC = () => { initialParams={{screenType: ScreenType.SuggestedPeople}} /> <Tabs.Screen - name="Search" + name="Chat" component={MainStackScreen} - initialParams={{screenType: ScreenType.Search}} + initialParams={{screenType: ScreenType.Chat}} + /> + <Tabs.Screen + name="Upload" + component={MainStackScreen} + initialParams={{screenType: ScreenType.Upload}} /> <Tabs.Screen name="Notifications" @@ -109,11 +118,6 @@ const NavigationBar: React.FC = () => { }} /> <Tabs.Screen - name="Chat" - component={MainStackScreen} - initialParams={{screenType: ScreenType.Chat}} - /> - <Tabs.Screen name="Profile" component={MainStackScreen} initialParams={{screenType: ScreenType.Profile}} diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index 05db8ed7..fac00f21 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -209,9 +209,7 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { <Button title="Cancel" buttonStyle={styles.button} - onPress={() => - moment ? navigation.goBack() : navigateToProfile() - } + onPress={() => navigation.goBack()} /> <Button title={moment ? 'Done' : 'Share'} diff --git a/src/types/types.ts b/src/types/types.ts index 416d9146..5f70d1f8 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -171,6 +171,7 @@ export enum ScreenType { Notifications, SuggestedPeople, Chat, + Upload, } /** |