diff options
Diffstat (limited to 'src/components/FeedCard.tsx')
-rw-r--r-- | src/components/FeedCard.tsx | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/src/components/FeedCard.tsx b/src/components/FeedCard.tsx index b1200d9c4..5e50f3c48 100644 --- a/src/components/FeedCard.tsx +++ b/src/components/FeedCard.tsx @@ -30,7 +30,7 @@ import {Trash_Stroke2_Corner0_Rounded as Trash} from '#/components/icons/Trash' import {Link as InternalLink, LinkProps} from '#/components/Link' import {Loader} from '#/components/Loader' import * as Prompt from '#/components/Prompt' -import {RichText} from '#/components/RichText' +import {RichText, RichTextProps} from '#/components/RichText' import {Text} from '#/components/Typography' type Props = { @@ -70,22 +70,18 @@ export function Link({ }, [view, queryClient]) return ( - <InternalLink to={href} {...props}> + <InternalLink to={href} style={[a.flex_col]} {...props}> {children} </InternalLink> ) } export function Outer({children}: {children: React.ReactNode}) { - return <View style={[a.flex_1, a.gap_md]}>{children}</View> + return <View style={[a.w_full, a.gap_md]}>{children}</View> } export function Header({children}: {children: React.ReactNode}) { - return ( - <View style={[a.flex_1, a.flex_row, a.align_center, a.gap_md]}> - {children} - </View> - ) + return <View style={[a.flex_row, a.align_center, a.gap_md]}>{children}</View> } export type AvatarProps = {src: string | undefined; size?: number} @@ -167,7 +163,10 @@ export function TitleAndBylinePlaceholder({creator}: {creator?: boolean}) { ) } -export function Description({description}: {description?: string}) { +export function Description({ + description, + ...rest +}: {description?: string} & Partial<RichTextProps>) { const rt = React.useMemo(() => { if (!description) return const rt = new RichTextApi({text: description || ''}) @@ -175,7 +174,29 @@ export function Description({description}: {description?: string}) { return rt }, [description]) if (!rt) return null - return <RichText value={rt} style={[a.leading_snug]} disableLinks /> + return <RichText value={rt} style={[a.leading_snug]} disableLinks {...rest} /> +} + +export function DescriptionPlaceholder() { + const t = useTheme() + return ( + <View style={[a.gap_xs]}> + <View + style={[a.rounded_xs, a.w_full, t.atoms.bg_contrast_50, {height: 12}]} + /> + <View + style={[a.rounded_xs, a.w_full, t.atoms.bg_contrast_50, {height: 12}]} + /> + <View + style={[ + a.rounded_xs, + a.w_full, + t.atoms.bg_contrast_50, + {height: 12, width: 100}, + ]} + /> + </View> + ) } export function Likes({count}: {count: number}) { |