[APP-2160] Build new standard.site link card UI (#10468)
Co-authored-by: vineyardbovines <spencer@thepope.dev> Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,8 @@ import {Loader} from '#/components/Loader'
|
||||
import {ExternalEmbed} from '#/components/Post/Embed/ExternalEmbed'
|
||||
import {ModeratedFeedEmbed} from '#/components/Post/Embed/FeedEmbed'
|
||||
import {ModeratedListEmbed} from '#/components/Post/Embed/ListEmbed'
|
||||
import {StandardSiteEmbed} from '#/components/Post/Embed/StandardSiteEmbed'
|
||||
import {isStandardSiteEmbed} from '#/components/Post/Embed/StandardSiteEmbed/utils'
|
||||
import {Embed as StarterPackEmbed} from '#/components/StarterPack/StarterPackCard'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {type Gif} from '#/features/gifPicker/types'
|
||||
@@ -86,6 +88,21 @@ export const ExternalEmbedLink = ({
|
||||
const linkComponent = useMemo(() => {
|
||||
if (data) {
|
||||
if (data.type === 'external') {
|
||||
if (data.view && isStandardSiteEmbed(data.view.external)) {
|
||||
return (
|
||||
<StandardSiteEmbed
|
||||
hideSubscribe
|
||||
view={{
|
||||
...data.view?.external,
|
||||
title: data.view?.external?.title || data.title || uri,
|
||||
uri,
|
||||
description:
|
||||
data.view?.external?.description || data.description,
|
||||
thumb: data.view?.external?.thumb || data.thumb?.source.path,
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<ExternalEmbed
|
||||
link={{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {memo, useCallback, useMemo, useState} from 'react'
|
||||
import {
|
||||
Image as RNImage,
|
||||
type ImageStyle,
|
||||
Pressable,
|
||||
type StyleProp,
|
||||
StyleSheet,
|
||||
@@ -76,6 +77,7 @@ interface UserAvatarProps extends BaseUserAvatarProps {
|
||||
noBorder?: boolean
|
||||
onLoad?: () => void
|
||||
style?: StyleProp<ViewStyle>
|
||||
extraAviStyle?: ImageStyle
|
||||
}
|
||||
|
||||
interface EditableUserAvatarProps extends BaseUserAvatarProps {
|
||||
@@ -224,6 +226,7 @@ let UserAvatar = ({
|
||||
live,
|
||||
hideLiveBadge,
|
||||
noBorder,
|
||||
extraAviStyle,
|
||||
}: UserAvatarProps): React.ReactNode => {
|
||||
const t = useTheme()
|
||||
const finalShape = overrideShape ?? (type === 'user' ? 'circle' : 'square')
|
||||
@@ -241,8 +244,9 @@ let UserAvatar = ({
|
||||
height: size,
|
||||
borderRadius,
|
||||
backgroundColor: t.palette.contrast_25,
|
||||
...extraAviStyle,
|
||||
}
|
||||
}, [finalShape, size, t])
|
||||
}, [finalShape, size, t, extraAviStyle])
|
||||
|
||||
const borderStyle = useMemo(() => {
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user