From da45c42b6f1ebf0646b3327c9a4a39cd46ecb8d6 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 18 Feb 2025 09:45:46 -0600 Subject: [APP-1049] show label expiration in frontend (#7738) * Add support for label exp to LabelsOnMeDialog * Add exp to PostAlerts, align with LabelsOnMe UI * Bump weight * Improve translations * Expiry should round up * Add a little visual alignment hack --- src/components/moderation/LabelsOnMeDialog.tsx | 49 +++++++++++++++++++------- 1 file changed, 37 insertions(+), 12 deletions(-) (limited to 'src/components/moderation/LabelsOnMeDialog.tsx') diff --git a/src/components/moderation/LabelsOnMeDialog.tsx b/src/components/moderation/LabelsOnMeDialog.tsx index 7d1e7d032..de24729cf 100644 --- a/src/components/moderation/LabelsOnMeDialog.tsx +++ b/src/components/moderation/LabelsOnMeDialog.tsx @@ -5,6 +5,7 @@ import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useMutation} from '@tanstack/react-query' +import {useGetTimeAgo} from '#/lib/hooks/useTimeAgo' import {useLabelSubject} from '#/lib/moderation' import {useLabelInfo} from '#/lib/moderation/useLabelInfo' import {makeProfileLink} from '#/lib/routes/links' @@ -66,7 +67,7 @@ function LabelsOnMeDialogInner(props: LabelsOnMeDialogProps) { /> ) : ( <> - + {isAccount ? ( Labels on your account ) : ( @@ -122,6 +123,7 @@ function Label({ const sourceName = labeler ? sanitizeHandle(labeler.creator.handle, '@') : label.src + const timeDiff = useGetTimeAgo({future: true}) return ( This label was applied by you. ) : ( - - - Source: {' '} + + + + Source:{' '} + control.close()}> + {sourceName} + + - control.close()}> - {sourceName} - + {label.exp && ( + + + Expires in {timeDiff(Date.now(), label.exp)} + + + )} )} -- cgit 1.4.1