diff --git a/src/components/StarterPack/StarterPackAvatarsIcon.tsx b/src/components/StarterPack/StarterPackAvatarsIcon.tsx new file mode 100644 index 0000000000..fcb0d4d191 --- /dev/null +++ b/src/components/StarterPack/StarterPackAvatarsIcon.tsx @@ -0,0 +1,36 @@ +import React from 'react' +import {View} from 'react-native' +import {AppBskyGraphDefs} from '@atproto/api' + +import {UserAvatar} from 'view/com/util/UserAvatar' +import {atoms as a} from '#/alf' + +export function StarterPackAvatarsIcon({ + starterPack, + size = 60, +}: { + starterPack?: AppBskyGraphDefs.StarterPackView + size?: number +}) { + if (!starterPack) return null + + // TODO be sure we get this back from the server + const avatars = starterPack.listItemsSample?.map(item => item.subject.avatar) + + return ( + + + + + + + + + + + ) +} diff --git a/src/screens/StarterPack/Main/index.tsx b/src/screens/StarterPack/Main/index.tsx index 0dcebe1c80..8e44e6c23a 100644 --- a/src/screens/StarterPack/Main/index.tsx +++ b/src/screens/StarterPack/Main/index.tsx @@ -127,6 +127,7 @@ function Header({ isOwner={isOwn} avatar={undefined} creator={creator} + starterPack={starterPack} avatarType="starter-pack"> {__DEV__ && ( diff --git a/src/view/com/profile/ProfileSubpageHeader.tsx b/src/view/com/profile/ProfileSubpageHeader.tsx index 3a3cd89843..331559686f 100644 --- a/src/view/com/profile/ProfileSubpageHeader.tsx +++ b/src/view/com/profile/ProfileSubpageHeader.tsx @@ -21,7 +21,9 @@ import {Text} from '../util/text/Text' import {UserAvatar, UserAvatarType} from '../util/UserAvatar' import {CenteredView} from '../util/Views' import hairlineWidth = StyleSheet.hairlineWidth -import {StarterPackIcon} from '#/components/icons/StarterPackIcon' +import {AppBskyGraphDefs} from '@atproto/api' + +import {StarterPackAvatarsIcon} from '#/components/StarterPack/StarterPackAvatarsIcon' export function ProfileSubpageHeader({ isLoading, @@ -31,6 +33,7 @@ export function ProfileSubpageHeader({ isOwner, creator, avatarType, + starterPack, children, }: React.PropsWithChildren<{ isLoading?: boolean @@ -44,6 +47,7 @@ export function ProfileSubpageHeader({ handle: string } | undefined + starterPack?: AppBskyGraphDefs.StarterPackView avatarType: UserAvatarType | 'starter-pack' }>) { const setDrawerOpen = useSetDrawerOpen() @@ -132,7 +136,7 @@ export function ProfileSubpageHeader({ accessibilityHint="" style={{width: 58}}> {avatarType === 'starter-pack' ? ( - + ) : ( )} diff --git a/src/view/com/util/UserAvatar.tsx b/src/view/com/util/UserAvatar.tsx index 587b466a3c..782d3d2ebb 100644 --- a/src/view/com/util/UserAvatar.tsx +++ b/src/view/com/util/UserAvatar.tsx @@ -31,7 +31,7 @@ import * as Menu from '#/components/Menu' import {ProfileHoverCard} from '#/components/ProfileHoverCard' import {openCamera, openCropper, openPicker} from '../../../lib/media/picker' -export type UserAvatarType = 'user' | 'algo' | 'list' | 'labeler' +export type UserAvatarType = 'user' | 'algo' | 'list' | 'labeler' | 'square' interface BaseUserAvatarProps { type?: UserAvatarType @@ -168,6 +168,13 @@ let UserAvatar = ({ const backgroundColor = pal.colors.backgroundLight const aviStyle = useMemo(() => { + if (type === 'square') { + return { + width: size, + height: size, + backgroundColor, + } + } if (type === 'algo' || type === 'list' || type === 'labeler') { return { width: size,