diff --git a/src/components/FeedCard.tsx b/src/components/FeedCard.tsx index 2745ed7c9f..c1182bb898 100644 --- a/src/components/FeedCard.tsx +++ b/src/components/FeedCard.tsx @@ -11,6 +11,7 @@ import { useRemoveFeedMutation, } from '#/state/queries/preferences' import {sanitizeHandle} from 'lib/strings/handles' +import {useSession} from 'state/session' import {UserAvatar} from '#/view/com/util/UserAvatar' import * as Toast from 'view/com/util/Toast' import {useTheme} from '#/alf' @@ -116,6 +117,12 @@ export function Likes({count}: {count: number}) { } export function Action({uri, pin}: {uri: string; pin?: boolean}) { + const {currentAccount} = useSession() + if (!currentAccount) return null + return +} + +function ActionInner({uri, pin}: {uri: string; pin?: boolean}) { const {_} = useLingui() const {data: preferences} = usePreferencesQuery() const {isPending: isAddSavedFeedPending, mutateAsync: saveFeeds} = diff --git a/src/screens/StarterPack/StarterPackLandingScreen.tsx b/src/screens/StarterPack/StarterPackLandingScreen.tsx index bfaf3d066e..ab81e790cf 100644 --- a/src/screens/StarterPack/StarterPackLandingScreen.tsx +++ b/src/screens/StarterPack/StarterPackLandingScreen.tsx @@ -4,7 +4,6 @@ import { AppBskyActorDefs, AppBskyGraphDefs, AppBskyGraphStarterpack, - AtUri, } from '@atproto/api' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -17,25 +16,33 @@ import { import {useResolveDidQuery} from 'state/queries/resolve-uri' import {useStarterPackQuery} from 'state/queries/useStarterPackQuery' import {LoggedOutScreenState} from 'view/com/auth/LoggedOut' -import {FeedSourceCard} from 'view/com/feeds/FeedSourceCard' import {UserAvatar} from 'view/com/util/UserAvatar' import {CenteredView} from 'view/com/util/Views' import {Logo} from 'view/icons/Logo' import {atoms as a, useTheme} from '#/alf' import {Button, ButtonText} from '#/components/Button' import {Divider} from '#/components/Divider' +import * as FeedCard from '#/components/FeedCard' import {LinearGradientBackground} from '#/components/LinearGradientBackground' import {ListMaybePlaceholder} from '#/components/Lists' import {Text} from '#/components/Typography' +function parseStarterPackHttpUri(uri: string): {name?: string; rkey?: string} { + const parsed = new URL(uri) + const [_, _path, name, rkey] = parsed.pathname.split('/') + return { + name, + rkey, + } +} + export function LandingScreen({ setScreenState, }: { setScreenState: (state: LoggedOutScreenState) => void }) { const usedStarterPack = useUsedStarterPack() - const atUri = new AtUri(usedStarterPack?.uri ?? '') - const {hostname: name, rkey} = atUri + const {name, rkey} = parseStarterPackHttpUri(usedStarterPack?.uri || '') const { data: did, @@ -172,11 +179,15 @@ function LandingScreenInner({ {pointerEvents: 'none'}, ]}> {starterPack.feeds?.map((feed, index) => ( - + + + ))}