From 959121f394cd92a5931d618d1cadf6315663c59c Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Mon, 18 Mar 2024 16:15:57 -0700 Subject: Update the reporting flow to first select a recipient if the user has multiple labelers (#3258) --- src/components/ReportDialog/SelectLabelerView.tsx | 115 ++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 src/components/ReportDialog/SelectLabelerView.tsx (limited to 'src/components/ReportDialog/SelectLabelerView.tsx') diff --git a/src/components/ReportDialog/SelectLabelerView.tsx b/src/components/ReportDialog/SelectLabelerView.tsx new file mode 100644 index 000000000..300114fc4 --- /dev/null +++ b/src/components/ReportDialog/SelectLabelerView.tsx @@ -0,0 +1,115 @@ +import React from 'react' +import {View} from 'react-native' +import {msg, Trans} from '@lingui/macro' +import {useLingui} from '@lingui/react' +import {AppBskyLabelerDefs} from '@atproto/api' + +export {useDialogControl as useReportDialogControl} from '#/components/Dialog' + +import {atoms as a, useTheme} from '#/alf' +import {Text} from '#/components/Typography' +import {Button, useButtonContext} from '#/components/Button' +import {Divider} from '#/components/Divider' +import {ChevronRight_Stroke2_Corner0_Rounded as ChevronRight} from '#/components/icons/Chevron' + +import {ReportDialogProps} from './types' + +export function SelectLabelerView({ + ...props +}: ReportDialogProps & { + labelers: AppBskyLabelerDefs.LabelerViewDetailed[] + onSelectLabeler: (v: string) => void +}) { + const t = useTheme() + const {_} = useLingui() + + return ( + + + + Select moderation service + + + Who do you want to send this report to? + + + + + + + {props.labelers.map(labeler => { + return ( + + ) + })} + + + ) +} + +function LabelerButton({ + title, + description, +}: { + title: string + description: string +}) { + const t = useTheme() + const {hovered, pressed} = useButtonContext() + const interacted = hovered || pressed + + const styles = React.useMemo(() => { + return { + interacted: { + backgroundColor: t.palette.contrast_50, + }, + } + }, [t]) + + return ( + + + + {title} + + + {description} + + + + + + + + ) +} -- cgit 1.4.1