Add disableDescriptionFacets to FeedCard, disable on starter packs lander
This commit is contained in:
+27
-10
@@ -33,18 +33,21 @@ import * as Prompt from '#/components/Prompt'
|
|||||||
import {RichText} from '#/components/RichText'
|
import {RichText} from '#/components/RichText'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
|
||||||
|
type CommonProps = {
|
||||||
|
disableDescriptionFacets?: boolean
|
||||||
|
}
|
||||||
type Props =
|
type Props =
|
||||||
| {
|
| ({
|
||||||
type: 'feed'
|
type: 'feed'
|
||||||
view: AppBskyFeedDefs.GeneratorView
|
view: AppBskyFeedDefs.GeneratorView
|
||||||
}
|
} & CommonProps)
|
||||||
| {
|
| ({
|
||||||
type: 'list'
|
type: 'list'
|
||||||
view: AppBskyGraphDefs.ListView
|
view: AppBskyGraphDefs.ListView
|
||||||
}
|
} & CommonProps)
|
||||||
|
|
||||||
export function Default(props: Props) {
|
export function Default(props: Props) {
|
||||||
const {type, view} = props
|
const {type, view, disableDescriptionFacets} = props
|
||||||
const displayName = type === 'feed' ? view.displayName : view.name
|
const displayName = type === 'feed' ? view.displayName : view.name
|
||||||
const purpose = type === 'list' ? view.purpose : undefined
|
const purpose = type === 'list' ? view.purpose : undefined
|
||||||
return (
|
return (
|
||||||
@@ -60,7 +63,10 @@ export function Default(props: Props) {
|
|||||||
/>
|
/>
|
||||||
<Action uri={view.uri} pin type={type} purpose={purpose} />
|
<Action uri={view.uri} pin type={type} purpose={purpose} />
|
||||||
</Header>
|
</Header>
|
||||||
<Description description={view.description} />
|
<Description
|
||||||
|
description={view.description}
|
||||||
|
disableFacets={disableDescriptionFacets}
|
||||||
|
/>
|
||||||
{type === 'feed' && <Likes count={view.likeCount || 0} />}
|
{type === 'feed' && <Likes count={view.likeCount || 0} />}
|
||||||
</Outer>
|
</Outer>
|
||||||
</Link>
|
</Link>
|
||||||
@@ -198,16 +204,27 @@ export function TitleAndBylinePlaceholder({creator}: {creator?: boolean}) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Description({description}: {description?: string}) {
|
export function Description({
|
||||||
const [rt, isResolving] = useRichText(description || '')
|
description,
|
||||||
|
disableFacets,
|
||||||
|
}: {
|
||||||
|
description?: string
|
||||||
|
disableFacets?: boolean
|
||||||
|
}) {
|
||||||
if (!description) return null
|
if (!description) return null
|
||||||
return isResolving ? (
|
return disableFacets ? (
|
||||||
<RichText value={description} style={[a.leading_snug]} />
|
<RichText value={description} style={[a.leading_snug]} />
|
||||||
) : (
|
) : (
|
||||||
<RichText value={rt} style={[a.leading_snug]} />
|
<DescriptionWithFacets description={description} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function DescriptionWithFacets({description}: {description?: string}) {
|
||||||
|
const [rt] = useRichText(description || '')
|
||||||
|
if (!description) return null
|
||||||
|
return <RichText value={rt ?? description} style={[a.leading_snug]} />
|
||||||
|
}
|
||||||
|
|
||||||
export function Likes({count}: {count: number}) {
|
export function Likes({count}: {count: number}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -266,7 +266,11 @@ function LandingScreenLoaded({
|
|||||||
t.atoms.border_contrast_low,
|
t.atoms.border_contrast_low,
|
||||||
]}
|
]}
|
||||||
key={feed.uri}>
|
key={feed.uri}>
|
||||||
<FeedCard.Default type="feed" view={feed} />
|
<FeedCard.Default
|
||||||
|
type="feed"
|
||||||
|
view={feed}
|
||||||
|
disableDescriptionFacets
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
Reference in New Issue
Block a user