diff --git a/src/components/CommunityOnlyBadge.tsx b/src/components/CommunityOnlyBadge.tsx new file mode 100644 index 000000000..b23acc607 --- /dev/null +++ b/src/components/CommunityOnlyBadge.tsx @@ -0,0 +1,64 @@ +import {useState} from 'react' +import {Pressable, View} from 'react-native' +import {msg} from '@lingui/core/macro' +import {useLingui} from '@lingui/react' +import {Trans} from '@lingui/react/macro' + +import {atoms as a, useTheme} from '#/alf' +import * as Tooltip from '#/components/Tooltip' +import {Text} from '#/components/Typography' +import {ChevronBottom_Stroke2_Corner0_Rounded as ChevronDown} from '#/components/icons/Chevron' +import {Logo as BlackskyLogo} from '#/view/icons/Logo' + +const COMMUNITY_POST_COLLECTION = 'community.blacksky.feed.post' + +export function isCommunityPostUri(uri: string | undefined): boolean { + return !!uri && uri.includes(COMMUNITY_POST_COLLECTION) +} + +export function CommunityOnlyBadge() { + const t = useTheme() + const {_} = useLingui() + const [visible, setVisible] = useState(false) + + return ( + + + setVisible(v => !v)} + style={[ + a.flex_row, + a.align_center, + a.gap_xs, + a.px_sm, + a.py_2xs, + a.rounded_full, + {backgroundColor: t.palette.primary_500}, + ]}> + + + + + + + + Blacksky Only + + + + This post is only visible to members of the Blacksky community. + + + + + + ) +} diff --git a/src/components/Post/Embed/index.tsx b/src/components/Post/Embed/index.tsx index 914ffc65c..a6af0d808 100644 --- a/src/components/Post/Embed/index.tsx +++ b/src/components/Post/Embed/index.tsx @@ -371,6 +371,7 @@ export function QuoteEmbed({ moderation={moderation} showAvatar postHref={itemHref} + postUri={quote.uri} timestamp={quote.indexedAt} linkDisabled /> diff --git a/src/screens/Messages/components/MessageInputEmbed.tsx b/src/screens/Messages/components/MessageInputEmbed.tsx index 355a9c2fb..216d58291 100644 --- a/src/screens/Messages/components/MessageInputEmbed.tsx +++ b/src/screens/Messages/components/MessageInputEmbed.tsx @@ -232,6 +232,7 @@ function MessageInputPostEmbed({ moderation={moderation} timestamp={post.indexedAt} postHref={itemHref} + postUri={post.uri} linkDisabled />