Updates InviteCodes modal to use dynamic/responsive styles on web (#1502)

zio/stable
Bryan Lee 2023-09-21 10:16:33 +08:00 committed by GitHub
parent 6df1bcad31
commit f5e9e4af89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -13,12 +13,14 @@ import {useStores} from 'state/index'
import {ScrollView} from './util' import {ScrollView} from './util'
import {usePalette} from 'lib/hooks/usePalette' import {usePalette} from 'lib/hooks/usePalette'
import {isWeb} from 'platform/detection' import {isWeb} from 'platform/detection'
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
export const snapPoints = ['70%'] export const snapPoints = ['70%']
export function Component({}: {}) { export function Component({}: {}) {
const pal = usePalette('default') const pal = usePalette('default')
const store = useStores() const store = useStores()
const {isTabletOrDesktop} = useWebMediaQueries()
const onClose = React.useCallback(() => { const onClose = React.useCallback(() => {
store.shell.closeModal() store.shell.closeModal()
@ -34,7 +36,11 @@ export function Component({}: {}) {
</Text> </Text>
</View> </View>
<View style={styles.flex1} /> <View style={styles.flex1} />
<View style={styles.btnContainer}> <View
style={[
styles.btnContainer,
isTabletOrDesktop && styles.btnContainerDesktop,
]}>
<Button <Button
type="primary" type="primary"
label="Done" label="Done"
@ -186,6 +192,9 @@ const styles = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'center', justifyContent: 'center',
}, },
btnContainerDesktop: {
marginTop: 14,
},
btn: { btn: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',