Move search btn into the viewheader

This commit is contained in:
Paul Frazee 2022-11-20 12:25:11 -06:00
parent a21bcf10dd
commit c6108fb646
5 changed files with 40 additions and 91 deletions

View file

@ -42,8 +42,6 @@ import {
GridIconSolid,
HomeIcon,
HomeIconSolid,
MangifyingGlassIcon,
MangifyingGlassIconSolid,
BellIcon,
BellIconSolid,
} from '../../lib/icons'
@ -66,8 +64,6 @@ const Btn = ({
| 'home-solid'
| 'bell'
| 'bell-solid'
| 'search'
| 'search-solid'
notificationCount?: number
tabCount?: number
onPress?: (event: GestureResponderEvent) => void
@ -86,14 +82,6 @@ const Btn = ({
} else if (icon === 'home-solid') {
IconEl = HomeIconSolid
size = 24
} else if (icon === 'search') {
IconEl = MangifyingGlassIcon
size = 24
addedStyles = {position: 'relative', top: -1} as ViewStyle
} else if (icon === 'search-solid') {
IconEl = MangifyingGlassIconSolid
size = 24
addedStyles = {position: 'relative', top: -1} as ViewStyle
} else if (icon === 'bell') {
IconEl = BellIcon
size = 24
@ -148,7 +136,6 @@ export const MobileShell: React.FC = observer(() => {
store.nav.navigate('/')
}
}
const onPressSearch = () => store.nav.navigate('/search')
const onPressMenu = () => setMainMenuActive(true)
const onPressNotifications = () => store.nav.navigate('/notifications')
const onPressTabs = () => toggleTabsMenu(!isTabsSelectorActive)
@ -262,7 +249,6 @@ export const MobileShell: React.FC = observer(() => {
}
const isAtHome = store.nav.tab.current.url === '/'
const isAtSearch = store.nav.tab.current.url === '/search'
const isAtNotifications = store.nav.tab.current.url === '/notifications'
return (
<View style={styles.outerContainer}>
@ -327,11 +313,6 @@ export const MobileShell: React.FC = observer(() => {
onPress={onPressHome}
onLongPress={doNewTab('/')}
/>
<Btn
icon={isAtSearch ? 'search-solid' : 'search'}
onPress={onPressSearch}
onLongPress={doNewTab('/search')}
/>
{TABS_ENABLED ? (
<Btn
icon={isTabsSelectorActive ? 'clone' : ['far', 'clone']}