diff --git a/bskyweb/cmd/bskyweb/server.go b/bskyweb/cmd/bskyweb/server.go index 25ae5cc3ff..8a91d0bf70 100644 --- a/bskyweb/cmd/bskyweb/server.go +++ b/bskyweb/cmd/bskyweb/server.go @@ -100,6 +100,7 @@ func serve(cctx *cli.Context) error { // generic routes e.GET("/search", server.WebGeneric) e.GET("/notifications", server.WebGeneric) + e.GET("/lists", server.WebGeneric) e.GET("/settings", server.WebGeneric) e.GET("/settings/app-passwords", server.WebGeneric) e.GET("/settings/muted-accounts", server.WebGeneric) @@ -116,6 +117,7 @@ func serve(cctx *cli.Context) error { e.GET("/profile/:handle", server.WebProfile) e.GET("/profile/:handle/follows", server.WebGeneric) e.GET("/profile/:handle/followers", server.WebGeneric) + e.GET("/profile/:handle/lists/:rkey", server.WebGeneric) // post endpoints; only first populates info e.GET("/profile/:handle/post/:rkey", server.WebPost) diff --git a/src/Navigation.tsx b/src/Navigation.tsx index afc7b39b87..bf5db51d06 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -33,11 +33,13 @@ import {useStores} from './state' import {HomeScreen} from './view/screens/Home' import {SearchScreen} from './view/screens/Search' import {NotificationsScreen} from './view/screens/Notifications' +import {ListsScreen} from './view/screens/Lists' import {NotFoundScreen} from './view/screens/NotFound' import {SettingsScreen} from './view/screens/Settings' import {ProfileScreen} from './view/screens/Profile' import {ProfileFollowersScreen} from './view/screens/ProfileFollowers' import {ProfileFollowsScreen} from './view/screens/ProfileFollows' +import {ProfileListScreen} from './view/screens/ProfileList' import {PostThreadScreen} from './view/screens/PostThread' import {PostLikedByScreen} from './view/screens/PostLikedBy' import {PostRepostedByScreen} from './view/screens/PostRepostedBy' @@ -70,6 +72,7 @@ function commonScreens(Stack: typeof HomeTab) { return ( <> + + diff --git a/src/lib/routes/types.ts b/src/lib/routes/types.ts index 34e6e6a468..b0d678be07 100644 --- a/src/lib/routes/types.ts +++ b/src/lib/routes/types.ts @@ -5,10 +5,12 @@ export type {NativeStackScreenProps} from '@react-navigation/native-stack' export type CommonNavigatorParams = { NotFound: undefined + Lists: undefined Settings: undefined Profile: {name: string; hideBackButton?: boolean} ProfileFollowers: {name: string} ProfileFollows: {name: string} + ProfileList: {name: string; rkey: string} PostThread: {name: string; rkey: string} PostLikedBy: {name: string; rkey: string} PostRepostedBy: {name: string; rkey: string} diff --git a/src/routes.ts b/src/routes.ts index 43d31ee099..3c4168592b 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -4,10 +4,12 @@ export const router = new Router({ Home: '/', Search: '/search', Notifications: '/notifications', + Lists: '/lists', Settings: '/settings', Profile: '/profile/:name', ProfileFollowers: '/profile/:name/followers', ProfileFollows: '/profile/:name/follows', + ProfileList: '/profile/:name/lists/:rkey', PostThread: '/profile/:name/post/:rkey', PostLikedBy: '/profile/:name/post/:rkey/liked-by', PostRepostedBy: '/profile/:name/post/:rkey/reposted-by', diff --git a/src/view/index.ts b/src/view/index.ts index 8de0358683..f9d1361634 100644 --- a/src/view/index.ts +++ b/src/view/index.ts @@ -45,6 +45,7 @@ import {faImage} from '@fortawesome/free-solid-svg-icons/faImage' import {faInfo} from '@fortawesome/free-solid-svg-icons/faInfo' import {faLanguage} from '@fortawesome/free-solid-svg-icons/faLanguage' import {faLink} from '@fortawesome/free-solid-svg-icons/faLink' +import {faListUl} from '@fortawesome/free-solid-svg-icons/faListUl' import {faLock} from '@fortawesome/free-solid-svg-icons/faLock' import {faMagnifyingGlass} from '@fortawesome/free-solid-svg-icons/faMagnifyingGlass' import {faMessage} from '@fortawesome/free-regular-svg-icons/faMessage' @@ -122,6 +123,7 @@ export function setup() { faInfo, faLanguage, faLink, + faListUl, faLock, faMagnifyingGlass, faMessage, diff --git a/src/view/screens/Lists.tsx b/src/view/screens/Lists.tsx new file mode 100644 index 0000000000..55861e1cb6 --- /dev/null +++ b/src/view/screens/Lists.tsx @@ -0,0 +1,24 @@ +import React from 'react' +import {View} from 'react-native' +import {useFocusEffect} from '@react-navigation/native' +import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types' +import {withAuthRequired} from 'view/com/auth/withAuthRequired' +import {ViewHeader} from '../com/util/ViewHeader' +import {useStores} from 'state/index' + +type Props = NativeStackScreenProps +export const ListsScreen = withAuthRequired(({route}: Props) => { + const store = useStores() + + useFocusEffect( + React.useCallback(() => { + store.shell.setMinimalShellMode(false) + }, [store]), + ) + + return ( + + + + ) +}) diff --git a/src/view/screens/ProfileList.tsx b/src/view/screens/ProfileList.tsx new file mode 100644 index 0000000000..5af8c0583c --- /dev/null +++ b/src/view/screens/ProfileList.tsx @@ -0,0 +1,25 @@ +import React from 'react' +import {View} from 'react-native' +import {useFocusEffect} from '@react-navigation/native' +import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types' +import {withAuthRequired} from 'view/com/auth/withAuthRequired' +import {ViewHeader} from '../com/util/ViewHeader' +import {useStores} from 'state/index' + +type Props = NativeStackScreenProps +export const ProfileListScreen = withAuthRequired(({route}: Props) => { + const store = useStores() + const {name, rkey} = route.params + + useFocusEffect( + React.useCallback(() => { + store.shell.setMinimalShellMode(false) + }, [store]), + ) + + return ( + + + + ) +}) diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 1b8983e83a..0e381c6161 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -94,6 +94,12 @@ export const DrawerContent = observer(() => { onPressTab('MyProfile') }, [onPressTab]) + const onPressLists = React.useCallback(() => { + track('Menu:ItemClicked', {url: 'Lists'}) + navigation.navigate('Lists') + store.shell.closeDrawer() + }, [navigation, track, store.shell]) + const onPressSettings = React.useCallback(() => { track('Menu:ItemClicked', {url: 'Settings'}) navigation.navigate('Settings') @@ -220,6 +226,20 @@ export const DrawerContent = observer(() => { bold={isAtNotifications} onPress={onPressNotifications} /> + + } + label="Lists" + accessibilityLabel="Lists" + accessibilityHint="" + onPress={onPressLists} + /> + + } + iconFilled={ + + } + label="Lists" + /> {store.session.hasSession && (