diff options
author | Hailey <me@haileyok.com> | 2024-08-20 15:43:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-20 15:43:40 -0700 |
commit | 723896a45f0fdf9612e5b6bb2a82ac7e894928ba (patch) | |
tree | 3822c9fa69da8d9ad771a2da49c69af9ca435669 /src/view/com/util/post-embeds | |
parent | e54298ec2c9a04aabe40ee7719962e2e33be23ec (diff) | |
download | voidsky-723896a45f0fdf9612e5b6bb2a82ac7e894928ba.tar.zst |
Add `list hidden` screen (#4958)
Co-authored-by: Hailey <me@haileyok.com> Co-authored-by: Eric Bailey <git@esb.lol>
Diffstat (limited to 'src/view/com/util/post-embeds')
-rw-r--r-- | src/view/com/util/post-embeds/ListEmbed.tsx | 32 | ||||
-rw-r--r-- | src/view/com/util/post-embeds/index.tsx | 16 |
2 files changed, 13 insertions, 35 deletions
diff --git a/src/view/com/util/post-embeds/ListEmbed.tsx b/src/view/com/util/post-embeds/ListEmbed.tsx deleted file mode 100644 index fc5ad270f..000000000 --- a/src/view/com/util/post-embeds/ListEmbed.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import React from 'react' -import {StyleProp, StyleSheet, View, ViewStyle} from 'react-native' -import {usePalette} from 'lib/hooks/usePalette' -import {ListCard} from 'view/com/lists/ListCard' -import {AppBskyGraphDefs} from '@atproto/api' -import {s} from 'lib/styles' - -export function ListEmbed({ - item, - style, -}: { - item: AppBskyGraphDefs.ListView - style?: StyleProp<ViewStyle> -}) { - const pal = usePalette('default') - - return ( - <View style={[pal.view, pal.border, s.border1, styles.container]}> - <ListCard list={item} style={[style, styles.card]} /> - </View> - ) -} - -const styles = StyleSheet.create({ - container: { - borderRadius: 8, - }, - card: { - borderTopWidth: 0, - borderRadius: 8, - }, -}) diff --git a/src/view/com/util/post-embeds/index.tsx b/src/view/com/util/post-embeds/index.tsx index 0462212fb..9c1364483 100644 --- a/src/view/com/util/post-embeds/index.tsx +++ b/src/view/com/util/post-embeds/index.tsx @@ -25,13 +25,13 @@ import {useLargeAltBadgeEnabled} from '#/state/preferences/large-alt-badge' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {usePalette} from 'lib/hooks/usePalette' import {FeedSourceCard} from 'view/com/feeds/FeedSourceCard' -import {atoms as a} from '#/alf' +import {atoms as a, useTheme} from '#/alf' +import * as ListCard from '#/components/ListCard' import {Embed as StarterPackCard} from '#/components/StarterPack/StarterPackCard' import {ContentHider} from '../../../../components/moderation/ContentHider' import {AutoSizedImage} from '../images/AutoSizedImage' import {ImageLayoutGrid} from '../images/ImageLayoutGrid' import {ExternalLinkEmbed} from './ExternalLinkEmbed' -import {ListEmbed} from './ListEmbed' import {MaybeQuoteEmbed} from './QuoteEmbed' type Embed = @@ -203,10 +203,20 @@ function MaybeListCard({view}: {view: AppBskyGraphDefs.ListView}) { const moderation = React.useMemo(() => { return moderationOpts ? moderateUserList(view, moderationOpts) : undefined }, [view, moderationOpts]) + const t = useTheme() return ( <ContentHider modui={moderation?.ui('contentList')}> - <ListEmbed item={view} /> + <View + style={[ + a.border, + t.atoms.border_contrast_medium, + a.p_md, + a.rounded_sm, + a.mt_sm, + ]}> + <ListCard.Default view={view} /> + </View> </ContentHider> ) } |