Use RichText for sp description

This commit is contained in:
Eric Bailey
2024-08-22 12:56:29 -07:00
parent df5bf28e61
commit 45121d21a8
@@ -31,10 +31,12 @@ import {atoms as a, useTheme} from '#/alf'
import {Button, ButtonText} from '#/components/Button' import {Button, ButtonText} from '#/components/Button'
import {useDialogControl} from '#/components/Dialog' import {useDialogControl} from '#/components/Dialog'
import * as FeedCard from '#/components/FeedCard' import * as FeedCard from '#/components/FeedCard'
import {useRichText} from '#/components/hooks/useRichText'
import {LinearGradientBackground} from '#/components/LinearGradientBackground' import {LinearGradientBackground} from '#/components/LinearGradientBackground'
import {ListMaybePlaceholder} from '#/components/Lists' import {ListMaybePlaceholder} from '#/components/Lists'
import {Default as ProfileCard} from '#/components/ProfileCard' import {Default as ProfileCard} from '#/components/ProfileCard'
import * as Prompt from '#/components/Prompt' import * as Prompt from '#/components/Prompt'
import {RichText} from '#/components/RichText'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
const AnimatedPressable = Animated.createAnimatedComponent(Pressable) const AnimatedPressable = Animated.createAnimatedComponent(Pressable)
@@ -109,6 +111,9 @@ function LandingScreenLoaded({
const setActiveStarterPack = useSetActiveStarterPack() const setActiveStarterPack = useSetActiveStarterPack()
const {isTabletOrDesktop} = useWebMediaQueries() const {isTabletOrDesktop} = useWebMediaQueries()
const androidDialogControl = useDialogControl() const androidDialogControl = useDialogControl()
const [descriptionRt] = useRichText(
AppBskyGraphStarterpack.isRecord(record) ? record?.description || '' : '',
)
const [appClipOverlayVisible, setAppClipOverlayVisible] = const [appClipOverlayVisible, setAppClipOverlayVisible] =
React.useState(false) React.useState(false)
@@ -192,9 +197,7 @@ function LandingScreenLoaded({
</LinearGradientBackground> </LinearGradientBackground>
<View style={[a.gap_2xl, a.mx_lg, a.my_2xl]}> <View style={[a.gap_2xl, a.mx_lg, a.my_2xl]}>
{record.description ? ( {record.description ? (
<Text style={[a.text_md, t.atoms.text_contrast_medium]}> <RichText value={descriptionRt} style={[a.text_md]} />
{record.description}
</Text>
) : null} ) : null}
<View style={[a.gap_sm]}> <View style={[a.gap_sm]}>
<Button <Button