Bluesky app fork with some witchin' additions 💫

tweak who can reply dialog (#8573)

authored by samuel.fm and committed by

GitHub 9b306598 bde3fdaa

+23 -8
+23 -8
src/components/WhoCanReply.tsx
··· 1 - import React from 'react' 1 + import {Fragment, useMemo} from 'react' 2 2 import { 3 3 Keyboard, 4 4 Platform, ··· 22 22 type ThreadgateAllowUISetting, 23 23 threadgateViewToAllowUISetting, 24 24 } from '#/state/queries/threadgate' 25 - import {atoms as a, useTheme} from '#/alf' 26 - import {Button} from '#/components/Button' 25 + import {atoms as a, useTheme, web} from '#/alf' 26 + import {Button, ButtonText} from '#/components/Button' 27 27 import * as Dialog from '#/components/Dialog' 28 28 import {useDialogControl} from '#/components/Dialog' 29 29 import { ··· 61 61 ) && post.record.reply?.root 62 62 ? post.record.reply.root.uri 63 63 : post.uri 64 - const settings = React.useMemo(() => { 64 + const settings = useMemo(() => { 65 65 return threadgateViewToAllowUISetting(post.threadgate) 66 66 }, [post.threadgate]) 67 67 ··· 178 178 embeddingDisabled: boolean 179 179 }) { 180 180 const {_} = useLingui() 181 + 181 182 return ( 182 - <Dialog.Outer control={control}> 183 + <Dialog.Outer control={control} nativeOptions={{preventExpansion: true}}> 183 184 <Dialog.Handle /> 184 185 <Dialog.ScrollableInner 185 186 label={_(msg`Dialog: adjust who can interact with this post`)} 186 - style={[{width: 'auto', maxWidth: 400, minWidth: 200}]}> 187 + style={web({maxWidth: 400})}> 187 188 <View style={[a.gap_sm]}> 188 189 <Text style={[a.font_bold, a.text_xl, a.pb_sm]}> 189 190 <Trans>Who can interact with this post?</Trans> ··· 194 195 embeddingDisabled={embeddingDisabled} 195 196 /> 196 197 </View> 198 + {isNative && ( 199 + <Button 200 + label={_(msg`Close`)} 201 + onPress={() => control.close()} 202 + size="small" 203 + variant="solid" 204 + color="secondary" 205 + style={[a.mt_5xl]}> 206 + <ButtonText> 207 + <Trans>Close</Trans> 208 + </ButtonText> 209 + </Button> 210 + )} 211 + <Dialog.Close /> 197 212 </Dialog.ScrollableInner> 198 213 </Dialog.Outer> 199 214 ) ··· 232 247 <Trans> 233 248 Only{' '} 234 249 {settings.map((rule, i) => ( 235 - <React.Fragment key={`rule-${i}`}> 250 + <Fragment key={`rule-${i}`}> 236 251 <Rule rule={rule} post={post} lists={post.threadgate!.lists} /> 237 252 <Separator i={i} length={settings.length} /> 238 - </React.Fragment> 253 + </Fragment> 239 254 ))}{' '} 240 255 can reply. 241 256 </Trans>