From 5d4eef46f1db16914cc3caa71072677050697bd7 Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Tue, 29 Jun 2021 19:28:09 -0400 Subject: Removed the search icon from the navigation bar and replaced it with the upload icon (along with the corresponding routing). Small tweaks on navigation and design will be needed. Commented out the code for navigation to search page - should be deleted soon. --- src/routes/tabs/NavigationBar.tsx | 54 +++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'src/routes/tabs') diff --git a/src/routes/tabs/NavigationBar.tsx b/src/routes/tabs/NavigationBar.tsx index c3a42739..f8b94470 100644 --- a/src/routes/tabs/NavigationBar.tsx +++ b/src/routes/tabs/NavigationBar.tsx @@ -1,23 +1,23 @@ -import {createBottomTabNavigator} from '@react-navigation/bottom-tabs'; -import React, {Fragment, useEffect, useState} from 'react'; -import {useSelector} from 'react-redux'; -import {NavigationIcon} from '../../components'; -import {NO_NOTIFICATIONS} from '../../store/initialStates'; -import {RootState} from '../../store/rootReducer'; -import {setNotificationsReadDate} from '../../services'; -import {ScreenType} from '../../types'; -import {haveUnreadNotifications} from '../../utils'; +import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; +import React, { Fragment, useEffect, useState } from 'react'; +import { useSelector } from 'react-redux'; +import { NavigationIcon } from '../../components'; +import { NO_NOTIFICATIONS } from '../../store/initialStates'; +import { RootState } from '../../store/rootReducer'; +import { setNotificationsReadDate } from '../../services'; +import { ScreenType } from '../../types'; +import { haveUnreadNotifications } from '../../utils'; import MainStackScreen from '../main/MainStackScreen'; -import {NotificationPill} from '../../components/notifications'; +import { NotificationPill } from '../../components/notifications'; const Tabs = createBottomTabNavigator(); const NavigationBar: React.FC = () => { - const {isOnboardedUser, newNotificationReceived} = useSelector( + const { isOnboardedUser, newNotificationReceived } = useSelector( (state: RootState) => state.user, ); - const {notifications: {notifications} = NO_NOTIFICATIONS} = useSelector( + const { notifications: { notifications } = NO_NOTIFICATIONS } = useSelector( (state: RootState) => state, ); // Triggered if user clicks on Notifications page to close the pill @@ -41,13 +41,13 @@ const NavigationBar: React.FC = () => { <> ({ - tabBarIcon: ({focused}) => { + screenOptions={({ route }) => ({ + tabBarIcon: ({ focused }) => { switch (route.name) { case 'Home': return ; - case 'Search': - return ; + case 'Chat': + return ; case 'Upload': return ; case 'Notifications': @@ -60,8 +60,6 @@ const NavigationBar: React.FC = () => { disabled={!focused} /> ); - case 'Chat': - return ; case 'Profile': return ; case 'SuggestedPeople': @@ -88,17 +86,22 @@ const NavigationBar: React.FC = () => { + { // Closes the pill once this screen has been opened @@ -108,15 +111,10 @@ const NavigationBar: React.FC = () => { }, }} /> - -- cgit v1.2.3-70-g09d2