diff --git a/src/view/com/lists/ListCard.tsx b/src/view/com/lists/ListCard.tsx index cd7bd451d4..59ca02e344 100644 --- a/src/view/com/lists/ListCard.tsx +++ b/src/view/com/lists/ListCard.tsx @@ -1,7 +1,8 @@ import React from 'react' import {StyleProp, StyleSheet, View, ViewStyle} from 'react-native' import {AppBskyGraphDefs, AtUri, RichText} from '@atproto/api' -import {Trans} from '@lingui/macro' +import {msg, Trans} from '@lingui/macro' +import {useLingui} from '@lingui/react' import {useSession} from '#/state/session' import {usePalette} from 'lib/hooks/usePalette' @@ -30,11 +31,14 @@ export const ListCard = ({ renderButton?: () => JSX.Element style?: StyleProp }) => { + const {_} = useLingui() const pal = usePalette('default') const {currentAccount} = useSession() const isOwner = currentAccount?.did === list.creator.did const isListHidden = list.labels?.findIndex(l => l.val === '!hide') !== -1 + const hideTitle = !isOwner && isListHidden + const isModList = list.purpose === 'app.bsky.graph.defs#modlist' const creatorHandle = sanitizeHandle(list.creator.handle, '@') @@ -68,7 +72,7 @@ export const ListCard = ({ style, ]} href={makeProfileLink(list.creator, 'lists', rkey)} - title={list.name} + title={hideTitle ? _(msg`Hidden list`) : list.name} asAnchor anchorNoUnderline> @@ -78,10 +82,10 @@ export const ListCard = ({ - {sanitizeDisplayName(list.name)} + {hideTitle ? _(msg`Hidden list`) : sanitizeDisplayName(list.name)} {isOwner ? ( @@ -98,19 +102,14 @@ export const ListCard = ({ {list.viewer?.muted ? ( - - - Muted - - + + Muted + ) : null} - {list.viewer?.blocked ? ( - - - Blocked - - + + Blocked + ) : null} @@ -131,6 +130,15 @@ export const ListCard = ({ ) } +function PillText({children}: {children: React.ReactNode}) { + const pal = usePalette('default') + return ( + + {children} + + ) +} + const styles = StyleSheet.create({ outer: { borderTopWidth: StyleSheet.hairlineWidth,