Bluesky app fork with some witchin' additions 💫

Gate chat icon in bottom bars (#3959)

authored by

Eric Bailey and committed by
GitHub
2974ce1b f84a2def

+56 -4
+39 -3
src/view/shell/bottom-bar/BottomBar.tsx
··· 37 37 Bell_Stroke2_Corner0_Rounded as Bell, 38 38 } from '#/components/icons/Bell' 39 39 import { 40 + Hashtag_Filled_Corner0_Rounded as HashtagFilled, 41 + Hashtag_Stroke2_Corner0_Rounded as Hashtag, 42 + } from '#/components/icons/Hashtag' 43 + import { 40 44 HomeOpen_Filled_Corner0_Rounded as HomeFilled, 41 45 HomeOpen_Stoke2_Corner0_Rounded as Home, 42 46 } from '#/components/icons/HomeOpen' ··· 63 67 const safeAreaInsets = useSafeAreaInsets() 64 68 const {track} = useAnalytics() 65 69 const {footerHeight} = useShellLayout() 66 - const {isAtHome, isAtSearch, isAtNotifications, isAtMyProfile, isAtMessages} = 67 - useNavigationTabState() 70 + const { 71 + isAtHome, 72 + isAtSearch, 73 + isAtFeeds, 74 + isAtNotifications, 75 + isAtMyProfile, 76 + isAtMessages, 77 + } = useNavigationTabState() 68 78 const numUnreadNotifications = useUnreadNotifications() 69 79 const numUnreadMessages = useUnreadMessageCount() 70 80 const {footerMinimalShellTransform} = useMinimalShellMode() ··· 106 116 const onPressHome = React.useCallback(() => onPressTab('Home'), [onPressTab]) 107 117 const onPressSearch = React.useCallback( 108 118 () => onPressTab('Search'), 119 + [onPressTab], 120 + ) 121 + const onPressFeeds = React.useCallback( 122 + () => onPressTab('Feeds'), 109 123 [onPressTab], 110 124 ) 111 125 const onPressNotifications = React.useCallback( ··· 182 196 accessibilityLabel={_(msg`Search`)} 183 197 accessibilityHint="" 184 198 /> 185 - {gate('dms') && ( 199 + {gate('dms') ? ( 186 200 <Btn 187 201 testID="bottomBarMessagesBtn" 188 202 icon={ ··· 208 222 ? `${numUnreadMessages.numUnread} unread` 209 223 : '' 210 224 } 225 + /> 226 + ) : ( 227 + <Btn 228 + testID="bottomBarFeedsBtn" 229 + icon={ 230 + isAtFeeds ? ( 231 + <HashtagFilled 232 + width={iconWidth + 1} 233 + style={[styles.ctrlIcon, pal.text, styles.feedsIcon]} 234 + /> 235 + ) : ( 236 + <Hashtag 237 + width={iconWidth + 1} 238 + style={[styles.ctrlIcon, pal.text, styles.feedsIcon]} 239 + /> 240 + ) 241 + } 242 + onPress={onPressFeeds} 243 + accessible={true} 244 + accessibilityRole="tab" 245 + accessibilityLabel={_(msg`Feeds`)} 246 + accessibilityHint="" 211 247 /> 212 248 )} 213 249 <Btn
+17 -1
src/view/shell/bottom-bar/BottomBarWeb.tsx
··· 27 27 Bell_Stroke2_Corner0_Rounded as Bell, 28 28 } from '#/components/icons/Bell' 29 29 import { 30 + Hashtag_Filled_Corner0_Rounded as HashtagFilled, 31 + Hashtag_Stroke2_Corner0_Rounded as Hashtag, 32 + } from '#/components/icons/Hashtag' 33 + import { 30 34 HomeOpen_Filled_Corner0_Rounded as HomeFilled, 31 35 HomeOpen_Stoke2_Corner0_Rounded as Home, 32 36 } from '#/components/icons/HomeOpen' ··· 101 105 102 106 {hasSession && ( 103 107 <> 104 - {gate('dms') && ( 108 + {gate('dms') ? ( 105 109 <NavItem routeName="Messages" href="/messages"> 106 110 {({isActive}) => { 107 111 const Icon = isActive ? MessageFilled : Message ··· 109 113 <Icon 110 114 width={iconWidth - 1} 111 115 style={[styles.ctrlIcon, pal.text, styles.messagesIcon]} 116 + /> 117 + ) 118 + }} 119 + </NavItem> 120 + ) : ( 121 + <NavItem routeName="Feeds" href="/feeds"> 122 + {({isActive}) => { 123 + const Icon = isActive ? HashtagFilled : Hashtag 124 + return ( 125 + <Icon 126 + width={iconWidth + 1} 127 + style={[styles.ctrlIcon, pal.text, styles.feedsIcon]} 112 128 /> 113 129 ) 114 130 }}