Add support for label exp to LabelsOnMeDialog
This commit is contained in:
@@ -5,6 +5,7 @@ import {msg, Trans} from '@lingui/macro'
|
|||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useMutation} from '@tanstack/react-query'
|
import {useMutation} from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import {useGetTimeAgo} from '#/lib/hooks/useTimeAgo'
|
||||||
import {useLabelSubject} from '#/lib/moderation'
|
import {useLabelSubject} from '#/lib/moderation'
|
||||||
import {useLabelInfo} from '#/lib/moderation/useLabelInfo'
|
import {useLabelInfo} from '#/lib/moderation/useLabelInfo'
|
||||||
import {makeProfileLink} from '#/lib/routes/links'
|
import {makeProfileLink} from '#/lib/routes/links'
|
||||||
@@ -122,6 +123,7 @@ function Label({
|
|||||||
const sourceName = labeler
|
const sourceName = labeler
|
||||||
? sanitizeHandle(labeler.creator.handle, '@')
|
? sanitizeHandle(labeler.creator.handle, '@')
|
||||||
: label.src
|
: label.src
|
||||||
|
const timeDiff = useGetTimeAgo()
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
@@ -163,18 +165,35 @@ function Label({
|
|||||||
<Trans>This label was applied by you.</Trans>
|
<Trans>This label was applied by you.</Trans>
|
||||||
</Text>
|
</Text>
|
||||||
) : (
|
) : (
|
||||||
<View style={{flexDirection: 'row'}}>
|
<View style={[a.flex_row, a.justify_between, a.gap_xl]}>
|
||||||
<Text style={[t.atoms.text_contrast_medium]}>
|
<Text
|
||||||
<Trans>Source: </Trans>{' '}
|
style={[a.flex_1, a.leading_snug, t.atoms.text_contrast_medium]}
|
||||||
|
numberOfLines={1}>
|
||||||
|
<Text style={[a.leading_snug, t.atoms.text_contrast_medium]}>
|
||||||
|
<Trans>Source: </Trans>{' '}
|
||||||
|
</Text>
|
||||||
|
<InlineLinkText
|
||||||
|
label={sourceName}
|
||||||
|
to={makeProfileLink(
|
||||||
|
labeler ? labeler.creator : {did: label.src, handle: ''},
|
||||||
|
)}
|
||||||
|
onPress={() => control.close()}>
|
||||||
|
{sourceName}
|
||||||
|
</InlineLinkText>
|
||||||
</Text>
|
</Text>
|
||||||
<InlineLinkText
|
{label.exp && (
|
||||||
label={sourceName}
|
<View>
|
||||||
to={makeProfileLink(
|
<Text
|
||||||
labeler ? labeler.creator : {did: label.src, handle: ''},
|
style={[
|
||||||
)}
|
a.leading_snug,
|
||||||
onPress={() => control.close()}>
|
a.text_sm,
|
||||||
{sourceName}
|
a.italic,
|
||||||
</InlineLinkText>
|
t.atoms.text_contrast_medium,
|
||||||
|
]}>
|
||||||
|
<Trans>Expires in {timeDiff(Date.now(), label.exp)}</Trans>
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
Reference in New Issue
Block a user