Add feeds tab
This commit is contained in:
parent
df6d249e85
commit
257686f360
17 changed files with 937 additions and 290 deletions
|
@ -30,6 +30,7 @@ import {
|
|||
MoonIcon,
|
||||
UserIconSolid,
|
||||
SatelliteDishIcon,
|
||||
SatelliteDishIconSolid,
|
||||
HandIcon,
|
||||
} from 'lib/icons'
|
||||
import {UserAvatar} from 'view/com/util/UserAvatar'
|
||||
|
@ -50,7 +51,7 @@ export const DrawerContent = observer(() => {
|
|||
const store = useStores()
|
||||
const navigation = useNavigation<NavigationProp>()
|
||||
const {track} = useAnalytics()
|
||||
const {isAtHome, isAtSearch, isAtNotifications, isAtMyProfile} =
|
||||
const {isAtHome, isAtSearch, isAtFeeds, isAtNotifications, isAtMyProfile} =
|
||||
useNavigationTabState()
|
||||
|
||||
const {notifications} = store.me
|
||||
|
@ -97,11 +98,10 @@ export const DrawerContent = observer(() => {
|
|||
onPressTab('MyProfile')
|
||||
}, [onPressTab])
|
||||
|
||||
const onPressMyFeeds = React.useCallback(() => {
|
||||
track('Menu:ItemClicked', {url: 'MyFeeds'})
|
||||
navigation.navigate('SavedFeeds')
|
||||
store.shell.closeDrawer()
|
||||
}, [navigation, track, store.shell])
|
||||
const onPressMyFeeds = React.useCallback(
|
||||
() => onPressTab('Feeds'),
|
||||
[onPressTab],
|
||||
)
|
||||
|
||||
const onPressModeration = React.useCallback(() => {
|
||||
track('Menu:ItemClicked', {url: 'Moderation'})
|
||||
|
@ -240,11 +240,19 @@ export const DrawerContent = observer(() => {
|
|||
/>
|
||||
<MenuItem
|
||||
icon={
|
||||
<SatelliteDishIcon
|
||||
strokeWidth={1.5}
|
||||
style={pal.text as FontAwesomeIconStyle}
|
||||
size={24}
|
||||
/>
|
||||
isAtFeeds ? (
|
||||
<SatelliteDishIconSolid
|
||||
strokeWidth={1.5}
|
||||
style={pal.text as FontAwesomeIconStyle}
|
||||
size={24}
|
||||
/>
|
||||
) : (
|
||||
<SatelliteDishIcon
|
||||
strokeWidth={1.5}
|
||||
style={pal.text as FontAwesomeIconStyle}
|
||||
size={24}
|
||||
/>
|
||||
)
|
||||
}
|
||||
label="My Feeds"
|
||||
accessibilityLabel="My Feeds"
|
||||
|
|
|
@ -18,6 +18,8 @@ import {
|
|||
HomeIconSolid,
|
||||
MagnifyingGlassIcon2,
|
||||
MagnifyingGlassIcon2Solid,
|
||||
SatelliteDishIcon,
|
||||
SatelliteDishIconSolid,
|
||||
BellIcon,
|
||||
BellIconSolid,
|
||||
} from 'lib/icons'
|
||||
|
@ -33,7 +35,7 @@ export const BottomBar = observer(({navigation}: BottomTabBarProps) => {
|
|||
const pal = usePalette('default')
|
||||
const safeAreaInsets = useSafeAreaInsets()
|
||||
const {track} = useAnalytics()
|
||||
const {isAtHome, isAtSearch, isAtNotifications, isAtMyProfile} =
|
||||
const {isAtHome, isAtSearch, isAtFeeds, isAtNotifications, isAtMyProfile} =
|
||||
useNavigationTabState()
|
||||
|
||||
const {footerMinimalShellTransform} = useMinimalShellMode()
|
||||
|
@ -59,6 +61,10 @@ export const BottomBar = observer(({navigation}: BottomTabBarProps) => {
|
|||
() => onPressTab('Search'),
|
||||
[onPressTab],
|
||||
)
|
||||
const onPressFeeds = React.useCallback(
|
||||
() => onPressTab('Feeds'),
|
||||
[onPressTab],
|
||||
)
|
||||
const onPressNotifications = React.useCallback(
|
||||
() => onPressTab('Notifications'),
|
||||
[onPressTab],
|
||||
|
@ -120,6 +126,28 @@ export const BottomBar = observer(({navigation}: BottomTabBarProps) => {
|
|||
accessibilityLabel="Search"
|
||||
accessibilityHint=""
|
||||
/>
|
||||
<Btn
|
||||
testID="bottomBarFeedsBtn"
|
||||
icon={
|
||||
isAtFeeds ? (
|
||||
<SatelliteDishIconSolid
|
||||
size={25}
|
||||
style={[styles.ctrlIcon, pal.text, styles.searchIcon]}
|
||||
strokeWidth={1.8}
|
||||
/>
|
||||
) : (
|
||||
<SatelliteDishIcon
|
||||
size={25}
|
||||
style={[styles.ctrlIcon, pal.text, styles.searchIcon]}
|
||||
strokeWidth={1.8}
|
||||
/>
|
||||
)
|
||||
}
|
||||
onPress={onPressFeeds}
|
||||
accessibilityRole="tab"
|
||||
accessibilityLabel="Feeds"
|
||||
accessibilityHint=""
|
||||
/>
|
||||
<Btn
|
||||
testID="bottomBarNotificationsBtn"
|
||||
icon={
|
||||
|
|
|
@ -207,7 +207,7 @@ export const DesktopLeftNav = observer(function DesktopLeftNav() {
|
|||
label="Notifications"
|
||||
/>
|
||||
<NavItem
|
||||
href="/settings/saved-feeds"
|
||||
href="/feeds"
|
||||
icon={
|
||||
<SatelliteDishIcon
|
||||
strokeWidth={1.75}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue