From a21bcf10dd794b69009b98c7789a7e87d696bfef Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Sun, 20 Nov 2022 12:00:40 -0600 Subject: Add build flags and disable tabs for now --- src/view/shell/mobile/index.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/view/shell/mobile/index.tsx') diff --git a/src/view/shell/mobile/index.tsx b/src/view/shell/mobile/index.tsx index e0f7c07aa..32b1f35dd 100644 --- a/src/view/shell/mobile/index.tsx +++ b/src/view/shell/mobile/index.tsx @@ -26,6 +26,7 @@ import Animated, { } from 'react-native-reanimated' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {IconProp} from '@fortawesome/fontawesome-svg-core' +import {TABS_ENABLED} from '../../../build-flags' import {useStores} from '../../../state' import {NavigationModel} from '../../../state/models/navigation' import {match, MatchResult} from '../../routes' @@ -331,11 +332,13 @@ export const MobileShell: React.FC = observer(() => { onPress={onPressSearch} onLongPress={doNewTab('/search')} /> - + {TABS_ENABLED ? ( + + ) : undefined} Date: Sun, 20 Nov 2022 12:25:11 -0600 Subject: Move search btn into the viewheader --- src/view/com/profile/ProfileHeader.tsx | 38 +++++++++++------------------- src/view/com/util/ViewHeader.tsx | 43 +++++++++++++++++++--------------- src/view/lib/icons.tsx | 29 +---------------------- src/view/screens/Home.tsx | 2 +- src/view/shell/mobile/index.tsx | 19 --------------- 5 files changed, 40 insertions(+), 91 deletions(-) (limited to 'src/view/shell/mobile/index.tsx') diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index 5a3743763..ed8924964 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -20,6 +20,7 @@ import { import {pluralize} from '../../lib/strings' import {s, colors} from '../../lib/styles' import {getGradient} from '../../lib/asset-gen' +import {MagnifyingGlassIcon} from '../../lib/icons' import {DropdownBtn, DropdownItem} from '../util/DropdownBtn' import Toast from '../util/Toast' import {LoadingPlaceholder} from '../util/LoadingPlaceholder' @@ -43,10 +44,8 @@ export const ProfileHeader = observer(function ProfileHeader({ const onPressBack = () => { store.nav.tab.goBack() } - const onPressMyAvatar = () => { - if (store.me.handle) { - store.nav.navigate(`/profile/${store.me.handle}`) - } + const onPressSearch = () => { + store.nav.navigate(`/search`) } const onPressToggleFollow = () => { view?.toggleFollowing().then( @@ -117,15 +116,9 @@ export const ProfileHeader = observer(function ProfileHeader({ /> ) : undefined} - {store.me.did ? ( - - - - ) : undefined} + + + ) : undefined} - {store.me.did ? ( - - - - ) : undefined} + + + { store.nav.tab.goBack() } - const onPressAvatar = () => { - if (store.me.handle) { - store.nav.navigate(`/profile/${store.me.handle}`) - } + const onPressSearch = () => { + store.nav.navigate(`/search`) } return ( {store.nav.tab.canGoBack ? ( - + ) : ( @@ -38,17 +37,9 @@ export function ViewHeader({ ) : undefined} - {store.me.did ? ( - - - - ) : ( - - )} + + + ) } @@ -83,8 +74,22 @@ const styles = StyleSheet.create({ }, cornerPlaceholder: { - width: 24, - height: 24, + width: 30, + height: 30, + }, + backIcon: {width: 30, height: 30}, + searchBtn: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + backgroundColor: colors.gray1, + width: 30, + height: 30, + borderRadius: 15, + }, + searchBtnIcon: { + color: colors.black, + position: 'relative', + top: -1, }, - backIcon: {width: 24, height: 24}, }) diff --git a/src/view/lib/icons.tsx b/src/view/lib/icons.tsx index b3f52a62e..21c5c86b7 100644 --- a/src/view/lib/icons.tsx +++ b/src/view/lib/icons.tsx @@ -91,7 +91,7 @@ export function HomeIconSolid({ // Copyright (c) 2020 Refactoring UI Inc. // https://github.com/tailwindlabs/heroicons/blob/master/LICENSE -export function MangifyingGlassIcon({ +export function MagnifyingGlassIcon({ style, size, }: { @@ -116,33 +116,6 @@ export function MangifyingGlassIcon({ ) } -// Copyright (c) 2020 Refactoring UI Inc. -// https://github.com/tailwindlabs/heroicons/blob/master/LICENSE -export function MangifyingGlassIconSolid({ - style, - size, -}: { - style?: StyleProp - size?: string | number -}) { - return ( - - - - ) -} - // https://github.com/Remix-Design/RemixIcon/blob/master/License export function BellIcon({ style, diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index d90d337ac..8dd7ca411 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -5,7 +5,6 @@ import useAppState from 'react-native-appstate-hook' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {ViewHeader} from '../com/util/ViewHeader' import {Feed} from '../com/posts/Feed' -import {FAB} from '../com/util/FloatingActionButton' import {useStores} from '../../state' import {FeedModel} from '../../state/models/feed-view' import {ScreenParams} from '../routes' @@ -81,6 +80,7 @@ export const Home = observer(function Home({ return ( + 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 ( @@ -327,11 +313,6 @@ export const MobileShell: React.FC = observer(() => { onPress={onPressHome} onLongPress={doNewTab('/')} /> - {TABS_ENABLED ? (