From 146a0641d6fc7c5ec31456eb30c11ba052b8d14b Mon Sep 17 00:00:00 2001 From: Hailey Date: Thu, 6 Jun 2024 23:04:06 -0700 Subject: [PATCH] populate the real starter packs --- .../StarterPack/ProfileStarterPacks.tsx | 15 ++++++++++----- src/components/StarterPack/StarterPackCard.tsx | 5 ++++- src/state/queries/useStarterPackQuery.ts | 1 - 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/components/StarterPack/ProfileStarterPacks.tsx b/src/components/StarterPack/ProfileStarterPacks.tsx index 41fab57ec1..42d69b5cae 100644 --- a/src/components/StarterPack/ProfileStarterPacks.tsx +++ b/src/components/StarterPack/ProfileStarterPacks.tsx @@ -80,9 +80,9 @@ export const ProfileStarterPacks = React.forwardRef< } else if (isEmpty) { items = items.concat([EMPTY]) } else if (data?.pages) { - for (const page of data?.pages) { - items = page.starterPacks - } + console.log('has pages') + console.log(data?.pages) + items = data?.pages.flatMap(page => page.starterPacks) } if (isError && !isEmpty) { items = items.concat([LOAD_MORE_ERROR_ITEM]) @@ -147,7 +147,13 @@ export const ProfileStarterPacks = React.forwardRef< return } if (preferences) { - return + return ( + + ) } return null }, @@ -175,7 +181,6 @@ export const ProfileStarterPacks = React.forwardRef< contentContainerStyle={isNative && {paddingBottom: headerOffset + 100}} indicatorStyle={theme.colorScheme === 'dark' ? 'white' : 'black'} removeClippedSubviews={true} - // @ts-ignore our .web version only -prf desktopFixedHeight onEndReached={onEndReached} /> diff --git a/src/components/StarterPack/StarterPackCard.tsx b/src/components/StarterPack/StarterPackCard.tsx index 09d6a767db..b63d51e2a5 100644 --- a/src/components/StarterPack/StarterPackCard.tsx +++ b/src/components/StarterPack/StarterPackCard.tsx @@ -1,5 +1,6 @@ import React from 'react' import {View} from 'react-native' +import {StarterPackViewBasic} from '@atproto/api/dist/client/types/app/bsky/graph/defs' import {atoms as a, useTheme} from '#/alf' import {StarterPackIcon} from '#/components/icons/StarterPackIcon' @@ -7,16 +8,18 @@ import {Link} from '#/components/Link' import {Text} from '#/components/Typography' export function StarterPackCard({ + starterPack, type, hideTopBorder, }: { + starterPack: StarterPackViewBasic hideTopBorder?: boolean type: 'list' | 'notification' }) { const t = useTheme() return ( - +