Bug fix bug fix
This commit is contained in:
@@ -98,6 +98,7 @@ export function LiveStatus({
|
||||
const openLink = useOpenLink()
|
||||
const moderationOpts = useModerationOpts()
|
||||
const reportDialogControl = useGlobalReportDialogControl()
|
||||
const dialogContext = Dialog.useDialogContext()
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -217,21 +218,28 @@ export function LiveStatus({
|
||||
a.flex_1,
|
||||
a.pt_sm,
|
||||
]}>
|
||||
<View style={[a.flex_row, a.align_center, a.gap_xs]}>
|
||||
<View style={[a.flex_row, a.align_center, a.gap_xs, a.flex_1]}>
|
||||
<CircleInfoIcon size="sm" fill={t.atoms.text_contrast_low.color} />
|
||||
<Text style={[t.atoms.text_contrast_low, a.text_sm, a.flex_1]}>
|
||||
<Text style={[t.atoms.text_contrast_low, a.text_sm]}>
|
||||
<Trans>Live feature is in beta</Trans>
|
||||
</Text>
|
||||
</View>
|
||||
<SimpleInlineLinkText
|
||||
label={_(msg`Report`)}
|
||||
{...createStaticClick(() => {
|
||||
reportDialogControl.open({
|
||||
subject: {
|
||||
...profile.status,
|
||||
$type: 'app.bsky.actor.defs#statusView',
|
||||
},
|
||||
})
|
||||
function open() {
|
||||
reportDialogControl.open({
|
||||
subject: {
|
||||
...profile.status,
|
||||
$type: 'app.bsky.actor.defs#statusView',
|
||||
},
|
||||
})
|
||||
}
|
||||
if (dialogContext.isWithinDialog) {
|
||||
dialogContext.close(open)
|
||||
} else {
|
||||
open()
|
||||
}
|
||||
})}
|
||||
style={[a.text_sm, a.underline, t.atoms.text_contrast_medium]}>
|
||||
<Trans>Report</Trans>
|
||||
|
||||
@@ -55,21 +55,17 @@ export function useGlobalReportDialogControl() {
|
||||
const logger = Logger.create(Logger.Context.ReportDialog)
|
||||
|
||||
export function GlobalReportDialog() {
|
||||
const {value, control, clear} = useGlobalReportDialogControl()
|
||||
if (!value) {
|
||||
clear()
|
||||
return null
|
||||
}
|
||||
return <ReportDialog control={control} subject={value.subject} />
|
||||
const {value, control} = useGlobalReportDialogControl()
|
||||
return <ReportDialog control={control} subject={value?.subject} />
|
||||
}
|
||||
|
||||
export function ReportDialog(
|
||||
props: Omit<ReportDialogProps, 'subject'> & {
|
||||
subject: ReportSubject
|
||||
subject?: ReportSubject
|
||||
},
|
||||
) {
|
||||
const subject = React.useMemo(
|
||||
() => parseReportSubject(props.subject),
|
||||
() => (props.subject ? parseReportSubject(props.subject) : undefined),
|
||||
[props.subject],
|
||||
)
|
||||
const onClose = React.useCallback(() => {
|
||||
|
||||
Reference in New Issue
Block a user