diff options
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 | 19 | ||||
-rw-r--r-- | src/routes/main/MainStackNavigator.tsx | 4 | ||||
-rw-r--r-- | src/routes/main/MainStackScreen.tsx | 29 | ||||
-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, 62 insertions, 23 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..f97bb861 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,12 +69,22 @@ const NavigationIcon = (props: NavigationIconProps) => { return ( <View style={styles.container}> <TouchableOpacity {...props}> - <Image source={imgSrc} style={styles.icon} /> + <Image source={imgSrc} style={getStyles(props.isBigger ?? false)} /> </TouchableOpacity> </View> ); }; +const getStyles = (isBigger: boolean) => + isBigger ? biggerIconStyles.icon : styles.icon; + +const biggerIconStyles = StyleSheet.create({ + icon: { + height: 44, + width: 44, + }, +}); + const styles = StyleSheet.create({ container: { flex: 1, @@ -87,8 +98,8 @@ const styles = StyleSheet.create({ shadowOpacity: 0.4, }, icon: { - height: 30, - width: 30, + height: 28, + width: 28, }, }); diff --git a/src/routes/main/MainStackNavigator.tsx b/src/routes/main/MainStackNavigator.tsx index a5d73988..f12072e6 100644 --- a/src/routes/main/MainStackNavigator.tsx +++ b/src/routes/main/MainStackNavigator.tsx @@ -14,8 +14,12 @@ export type MainStackParams = { SuggestedPeople: { screenType: ScreenType; }; + /* Search: { screenType: ScreenType; + }; */ + Upload: { + screenType: ScreenType; }; RequestContactsAccess: { screenType: ScreenType; diff --git a/src/routes/main/MainStackScreen.tsx b/src/routes/main/MainStackScreen.tsx index 65a695f5..e19df2c2 100644 --- a/src/routes/main/MainStackScreen.tsx +++ b/src/routes/main/MainStackScreen.tsx @@ -26,7 +26,7 @@ import { PrivacyScreen, ProfileScreen, RequestContactsAccess, - SearchScreen, + // SearchScreen, SettingsScreen, SocialMediaTaggs, SuggestedPeopleScreen, @@ -60,22 +60,26 @@ interface MainStackProps { const MainStackScreen: React.FC<MainStackProps> = ({route}) => { const {screenType} = route.params; - const isSearchTab = screenType === ScreenType.Search; + // 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'; + return 'Search'; */ case ScreenType.Notifications: return 'Notifications'; case ScreenType.SuggestedPeople: return 'SuggestedPeople'; case ScreenType.Chat: return 'ChatList'; + case ScreenType.Upload: + return 'Upload'; } })(); @@ -99,6 +103,19 @@ const MainStackScreen: React.FC<MainStackProps> = ({route}) => { animationEnabled: false, }; + /* + Following was removed to eliminate search screen naviagtion + + {isSearchTab && ( + <MainStack.Screen + name="Search" + component={SearchScreen} + initialParams={{ screenType }} + /> + )} + + */ + const mainStackScreen = () => { return ( <MainStack.Navigator @@ -130,10 +147,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..28e8808f 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -210,7 +210,9 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { title="Cancel" buttonStyle={styles.button} onPress={() => - moment ? navigation.goBack() : navigateToProfile() + // There is issue here with navigations on the commented code below + // moment ? navigation.goBack() : navigateToProfile() + navigation.goBack() } /> <Button 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, } /** |