-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
b6c7aae
commit a9d2924
Showing
31 changed files
with
583 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './AudiusQueryContext' | ||
export * from './createApi' | ||
export * from './hooks' | ||
export * from './types' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { z } from 'zod' | ||
|
||
export const selectArtistsSchema = z.object({ | ||
selectedArtists: z.array(z.string()).min(3) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export * from './IconAudioBadge' | ||
export * from '../core/IconAudioBadge' | ||
export * from './TiersExplainerDrawer' | ||
export * from './RewardsBanner' | ||
export * from './TierText' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { SquareSizes, type ID, cacheUsersSelectors } from '@audius/common' | ||
import { useSelector } from 'react-redux' | ||
|
||
import type { AvatarProps } from '@audius/harmony-native' | ||
import { Avatar } from '@audius/harmony-native' | ||
|
||
import { useProfilePicture } from '../image/UserImage' | ||
const { getUser } = cacheUsersSelectors | ||
|
||
type ProfilePictureProps = Omit< | ||
AvatarProps, | ||
'source' | 'accessibilityLabel' | ||
> & { | ||
userId: ID | ||
} | ||
|
||
export const ProfilePicture = (props: ProfilePictureProps) => { | ||
const { userId, ...other } = props | ||
|
||
const userName = useSelector((state) => getUser(state, { id: userId })?.name) | ||
const accessibilityLabel = `Profile picture for ${userName}` | ||
|
||
const { source, handleError } = useProfilePicture( | ||
userId, | ||
SquareSizes.SIZE_150_BY_150 | ||
) | ||
|
||
return ( | ||
<Avatar | ||
source={source} | ||
onError={handleError} | ||
accessibilityLabel={accessibilityLabel} | ||
{...other} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { ID } from '@audius/common' | ||
|
||
import type { CoverPhotoProps } from '@audius/harmony-native' | ||
import { CoverPhoto } from '@audius/harmony-native' | ||
|
||
import { useCoverPhoto } from '../image/CoverPhoto' | ||
|
||
type UserCoverPhotoProps = { | ||
userId: ID | ||
} & Pick<CoverPhotoProps, 'style' | 'topCornerRadius'> | ||
|
||
export const UserCoverPhoto = (props: UserCoverPhotoProps) => { | ||
const { userId, ...other } = props | ||
|
||
const { source, handleError, shouldBlur } = useCoverPhoto(userId) | ||
|
||
return ( | ||
<CoverPhoto | ||
coverPhoto={shouldBlur ? undefined : source} | ||
profilePicture={shouldBlur ? source : undefined} | ||
onError={handleError} | ||
{...other} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { useSelectTierInfo, type ID, cacheUsersSelectors } from '@audius/common' | ||
import { useSelector } from 'react-redux' | ||
|
||
import type { TextProps } from '@audius/harmony-native' | ||
import { | ||
Flex, | ||
IconVerified, | ||
Text, | ||
useTheme, | ||
variantStylesMap | ||
} from '@audius/harmony-native' | ||
|
||
import { IconAudioBadge } from './IconAudioBadge' | ||
|
||
const { getUser } = cacheUsersSelectors | ||
|
||
type UserDisplayProps = TextProps & { | ||
userId: ID | ||
} | ||
|
||
export const UserDisplayName = (props: UserDisplayProps) => { | ||
const { userId, variant = 'title', size = 's', style, ...other } = props | ||
const { tier, isVerified } = useSelectTierInfo(userId) | ||
const displayName = useSelector( | ||
(state) => getUser(state, { id: userId })?.name | ||
) | ||
const { typography } = useTheme() | ||
const fontSize = typography.size[variantStylesMap[variant].fontSize[size]] | ||
const badgeSize = fontSize - 2 | ||
|
||
return ( | ||
<Flex direction='row' gap='xs' alignItems='center' style={style}> | ||
<Text variant={variant} size={size} {...other}> | ||
{displayName} | ||
</Text> | ||
{isVerified ? ( | ||
<IconVerified height={badgeSize} width={badgeSize} /> | ||
) : null} | ||
<IconAudioBadge tier={tier} height={fontSize} width={fontSize} /> | ||
</Flex> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.