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