isRecord above

This commit is contained in:
Hailey
2024-08-22 15:25:12 -07:00
parent 45121d21a8
commit d218ee887f
@@ -84,9 +84,15 @@ export function LandingScreen({
return <ListMaybePlaceholder isLoading={true} />
}
// Just for types, this cannot be hit
if (!AppBskyGraphStarterpack.isRecord(starterPack.record)) {
return null
}
return (
<LandingScreenLoaded
starterPack={starterPack}
starterPackRecord={starterPack.record}
setScreenState={setScreenState}
moderationOpts={moderationOpts}
/>
@@ -95,25 +101,25 @@ export function LandingScreen({
function LandingScreenLoaded({
starterPack,
starterPackRecord: record,
setScreenState,
// TODO apply this to profile card
moderationOpts,
}: {
starterPack: AppBskyGraphDefs.StarterPackView
starterPackRecord: AppBskyGraphStarterpack.Record
setScreenState: (state: LoggedOutScreenState) => void
moderationOpts: ModerationOpts
}) {
const {record, creator, listItemsSample, feeds} = starterPack
const {creator, listItemsSample, feeds} = starterPack
const {_} = useLingui()
const t = useTheme()
const activeStarterPack = useActiveStarterPack()
const setActiveStarterPack = useSetActiveStarterPack()
const {isTabletOrDesktop} = useWebMediaQueries()
const androidDialogControl = useDialogControl()
const [descriptionRt] = useRichText(
AppBskyGraphStarterpack.isRecord(record) ? record?.description || '' : '',
)
const [descriptionRt] = useRichText(record.description || '')
const [appClipOverlayVisible, setAppClipOverlayVisible] =
React.useState(false)
@@ -152,10 +158,6 @@ function LandingScreenLoaded({
}
}
if (!AppBskyGraphStarterpack.isRecord(record)) {
return null
}
return (
<CenteredView style={a.flex_1}>
<ScrollView