tweak who can reply dialog (#8573)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import React from 'react'
|
import {Fragment, useMemo} from 'react'
|
||||||
import {
|
import {
|
||||||
Keyboard,
|
Keyboard,
|
||||||
Platform,
|
Platform,
|
||||||
@@ -22,8 +22,8 @@ import {
|
|||||||
type ThreadgateAllowUISetting,
|
type ThreadgateAllowUISetting,
|
||||||
threadgateViewToAllowUISetting,
|
threadgateViewToAllowUISetting,
|
||||||
} from '#/state/queries/threadgate'
|
} from '#/state/queries/threadgate'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme, web} from '#/alf'
|
||||||
import {Button} from '#/components/Button'
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
import * as Dialog from '#/components/Dialog'
|
import * as Dialog from '#/components/Dialog'
|
||||||
import {useDialogControl} from '#/components/Dialog'
|
import {useDialogControl} from '#/components/Dialog'
|
||||||
import {
|
import {
|
||||||
@@ -61,7 +61,7 @@ export function WhoCanReply({post, isThreadAuthor, style}: WhoCanReplyProps) {
|
|||||||
) && post.record.reply?.root
|
) && post.record.reply?.root
|
||||||
? post.record.reply.root.uri
|
? post.record.reply.root.uri
|
||||||
: post.uri
|
: post.uri
|
||||||
const settings = React.useMemo(() => {
|
const settings = useMemo(() => {
|
||||||
return threadgateViewToAllowUISetting(post.threadgate)
|
return threadgateViewToAllowUISetting(post.threadgate)
|
||||||
}, [post.threadgate])
|
}, [post.threadgate])
|
||||||
|
|
||||||
@@ -178,12 +178,13 @@ function WhoCanReplyDialog({
|
|||||||
embeddingDisabled: boolean
|
embeddingDisabled: boolean
|
||||||
}) {
|
}) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control} nativeOptions={{preventExpansion: true}}>
|
||||||
<Dialog.Handle />
|
<Dialog.Handle />
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
label={_(msg`Dialog: adjust who can interact with this post`)}
|
label={_(msg`Dialog: adjust who can interact with this post`)}
|
||||||
style={[{width: 'auto', maxWidth: 400, minWidth: 200}]}>
|
style={web({maxWidth: 400})}>
|
||||||
<View style={[a.gap_sm]}>
|
<View style={[a.gap_sm]}>
|
||||||
<Text style={[a.font_bold, a.text_xl, a.pb_sm]}>
|
<Text style={[a.font_bold, a.text_xl, a.pb_sm]}>
|
||||||
<Trans>Who can interact with this post?</Trans>
|
<Trans>Who can interact with this post?</Trans>
|
||||||
@@ -194,6 +195,20 @@ function WhoCanReplyDialog({
|
|||||||
embeddingDisabled={embeddingDisabled}
|
embeddingDisabled={embeddingDisabled}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
{isNative && (
|
||||||
|
<Button
|
||||||
|
label={_(msg`Close`)}
|
||||||
|
onPress={() => control.close()}
|
||||||
|
size="small"
|
||||||
|
variant="solid"
|
||||||
|
color="secondary"
|
||||||
|
style={[a.mt_5xl]}>
|
||||||
|
<ButtonText>
|
||||||
|
<Trans>Close</Trans>
|
||||||
|
</ButtonText>
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
<Dialog.Close />
|
||||||
</Dialog.ScrollableInner>
|
</Dialog.ScrollableInner>
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
@@ -232,10 +247,10 @@ function Rules({
|
|||||||
<Trans>
|
<Trans>
|
||||||
Only{' '}
|
Only{' '}
|
||||||
{settings.map((rule, i) => (
|
{settings.map((rule, i) => (
|
||||||
<React.Fragment key={`rule-${i}`}>
|
<Fragment key={`rule-${i}`}>
|
||||||
<Rule rule={rule} post={post} lists={post.threadgate!.lists} />
|
<Rule rule={rule} post={post} lists={post.threadgate!.lists} />
|
||||||
<Separator i={i} length={settings.length} />
|
<Separator i={i} length={settings.length} />
|
||||||
</React.Fragment>
|
</Fragment>
|
||||||
))}{' '}
|
))}{' '}
|
||||||
can reply.
|
can reply.
|
||||||
</Trans>
|
</Trans>
|
||||||
|
|||||||
Reference in New Issue
Block a user