From 6b9e3764b35ce493fd09316e01f313cf74d55fa7 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 26 Feb 2024 18:52:28 -0600 Subject: [PATCH] Rename LabelsOnMeDialog, fix close --- src/components/Dialog/index.web.tsx | 2 +- .../{LabelsOnMe.tsx => LabelsOnMeDialog.tsx} | 32 +++++++++++++------ src/view/com/util/moderation/LabelsOnMe.tsx | 3 +- 3 files changed, 26 insertions(+), 11 deletions(-) rename src/components/{LabelsOnMe.tsx => LabelsOnMeDialog.tsx} (73%) diff --git a/src/components/Dialog/index.web.tsx b/src/components/Dialog/index.web.tsx index 79441fb5e1..5bb352900c 100644 --- a/src/components/Dialog/index.web.tsx +++ b/src/components/Dialog/index.web.tsx @@ -95,7 +95,7 @@ export function Outer({ style={[ web(a.fixed), a.inset_0, - {opacity: 0.5, backgroundColor: t.palette.black}, + {opacity: 0.8, backgroundColor: t.palette.black}, ]} /> )} diff --git a/src/components/LabelsOnMe.tsx b/src/components/LabelsOnMeDialog.tsx similarity index 73% rename from src/components/LabelsOnMe.tsx rename to src/components/LabelsOnMeDialog.tsx index 3af3d8fe34..9364baccc5 100644 --- a/src/components/LabelsOnMe.tsx +++ b/src/components/LabelsOnMeDialog.tsx @@ -4,10 +4,11 @@ import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {ComAtprotoLabelDefs} from '@atproto/api' -import {atoms as a, useBreakpoints} from '#/alf' +import {atoms as a, useBreakpoints, useTheme} from '#/alf' import {Text} from '#/components/Typography' import * as Dialog from '#/components/Dialog' import {Button} from '#/components/Button' +import {capitalize} from '#/lib/strings/capitalize' export {useDialogControl as useLabelsOnMeDialogControl} from '#/components/Dialog' @@ -27,8 +28,8 @@ export interface LabelsOnMeDialogProps { } export function LabelsOnMeDialogInner(props: LabelsOnMeDialogProps) { + const t = useTheme() const {_} = useLingui() - const control = Dialog.useDialogControl() const {gtMobile} = useBreakpoints() const {subject, labels} = props const isAccount = 'did' in subject @@ -57,24 +58,37 @@ export function LabelsOnMeDialogInner(props: LabelsOnMeDialogProps) { - - Labels on my {isAccount ? 'account' : 'content'} + + + The following labels were applied to your{' '} + {isAccount ? 'account' : 'content'} + - + You may appeal these labels if you feel they were placed in error. - {labels.map(label => ( - {label.val} TODO - ))} + + + {labels.map(label => ( + + {capitalize(label.val)} + + ))} + + diff --git a/src/view/com/util/moderation/LabelsOnMe.tsx b/src/view/com/util/moderation/LabelsOnMe.tsx index 4c8b8e0223..cf8313d07c 100644 --- a/src/view/com/util/moderation/LabelsOnMe.tsx +++ b/src/view/com/util/moderation/LabelsOnMe.tsx @@ -11,7 +11,7 @@ import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/ico import { LabelsOnMeDialog, useLabelsOnMeDialogControl, -} from '#/components/LabelsOnMe' +} from '#/components/LabelsOnMeDialog' export function LabelsOnMe({ details, @@ -49,6 +49,7 @@ export function LabelsOnMe({ size={size || 'small'} label={_(msg`View information about these labels`)} onPress={() => { + console.log('open') control.open() }}>