cleanup
This commit is contained in:
@@ -33,6 +33,11 @@ export const ListCard = ({
|
|||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
|
|
||||||
|
const isOwner = currentAccount?.did === list.creator.did
|
||||||
|
const isListHidden = list.labels?.findIndex(l => l.val === '!hide') !== -1
|
||||||
|
const isModList = list.purpose === 'app.bsky.graph.defs#modlist'
|
||||||
|
const creatorHandle = sanitizeHandle(list.creator.handle, '@')
|
||||||
|
|
||||||
const rkey = React.useMemo(() => {
|
const rkey = React.useMemo(() => {
|
||||||
try {
|
try {
|
||||||
const urip = new AtUri(list.uri)
|
const urip = new AtUri(list.uri)
|
||||||
@@ -79,22 +84,17 @@ export const ListCard = ({
|
|||||||
{sanitizeDisplayName(list.name)}
|
{sanitizeDisplayName(list.name)}
|
||||||
</Text>
|
</Text>
|
||||||
<Text type="md" style={[pal.textLight]} numberOfLines={1}>
|
<Text type="md" style={[pal.textLight]} numberOfLines={1}>
|
||||||
{list.purpose === 'app.bsky.graph.defs#curatelist' &&
|
{isOwner ? (
|
||||||
(list.creator.did === currentAccount?.did ? (
|
isModList ? (
|
||||||
<Trans>User list by you</Trans>
|
|
||||||
) : (
|
|
||||||
<Trans>
|
|
||||||
User list by {sanitizeHandle(list.creator.handle, '@')}
|
|
||||||
</Trans>
|
|
||||||
))}
|
|
||||||
{list.purpose === 'app.bsky.graph.defs#modlist' &&
|
|
||||||
(list.creator.did === currentAccount?.did ? (
|
|
||||||
<Trans>Moderation list by you</Trans>
|
<Trans>Moderation list by you</Trans>
|
||||||
) : (
|
) : (
|
||||||
<Trans>
|
<Trans>User list by you</Trans>
|
||||||
Moderation list by {sanitizeHandle(list.creator.handle, '@')}
|
)
|
||||||
</Trans>
|
) : isModList ? (
|
||||||
))}
|
<Trans>Moderation list by {creatorHandle}</Trans>
|
||||||
|
) : (
|
||||||
|
<Trans>User list by {creatorHandle}</Trans>
|
||||||
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
<View style={s.flexRow}>
|
<View style={s.flexRow}>
|
||||||
{list.viewer?.muted ? (
|
{list.viewer?.muted ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user