use primary_subtle, change web layout
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import {useState} from 'react'
|
import {useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {useWindowDimensions, View} from 'react-native'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import * as EmailValidator from 'email-validator'
|
import * as EmailValidator from 'email-validator'
|
||||||
@@ -9,7 +9,7 @@ import {checkAndFormatResetCode} from '#/lib/strings/password'
|
|||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {useAgent, useSession} from '#/state/session'
|
import {useAgent, useSession} from '#/state/session'
|
||||||
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
|
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
|
||||||
import {atoms as a, useBreakpoints, web} from '#/alf'
|
import {android, atoms as a, useBreakpoints, web} from '#/alf'
|
||||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||||
import * as Dialog from '#/components/Dialog'
|
import * as Dialog from '#/components/Dialog'
|
||||||
import * as TextField from '#/components/forms/TextField'
|
import * as TextField from '#/components/forms/TextField'
|
||||||
@@ -27,8 +27,12 @@ export function ChangePasswordDialog({
|
|||||||
}: {
|
}: {
|
||||||
control: Dialog.DialogControlProps
|
control: Dialog.DialogControlProps
|
||||||
}) {
|
}) {
|
||||||
|
const {height} = useWindowDimensions()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer
|
||||||
|
control={control}
|
||||||
|
nativeOptions={android({minHeight: height / 2})}>
|
||||||
<Dialog.Handle />
|
<Dialog.Handle />
|
||||||
<Inner />
|
<Inner />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
@@ -156,7 +160,7 @@ function Inner() {
|
|||||||
return (
|
return (
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
label={_(msg`Change password dialog`)}
|
label={_(msg`Change password dialog`)}
|
||||||
style={web({maxWidth: 450})}>
|
style={web({maxWidth: 400})}>
|
||||||
<Dialog.Close />
|
<Dialog.Close />
|
||||||
<View style={[a.gap_xl]}>
|
<View style={[a.gap_xl]}>
|
||||||
<View style={[a.gap_sm]}>
|
<View style={[a.gap_sm]}>
|
||||||
@@ -212,25 +216,11 @@ function Inner() {
|
|||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<View style={[a.gap_sm, gtMobile && [a.flex_row_reverse, a.ml_auto]]}>
|
<View style={[a.gap_sm]}>
|
||||||
{stage === Stages.RequestCode ? (
|
{stage === Stages.RequestCode ? (
|
||||||
<>
|
<>
|
||||||
{!gtMobile && (
|
|
||||||
<Button
|
|
||||||
label={_(msg`Already have a code?`)}
|
|
||||||
onPress={() => setStage(Stages.ChangePassword)}
|
|
||||||
size="large"
|
|
||||||
color="primary"
|
|
||||||
variant="ghost"
|
|
||||||
disabled={isProcessing}>
|
|
||||||
<ButtonText>
|
|
||||||
<Trans>Already have a code?</Trans>
|
|
||||||
</ButtonText>
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Request code`)}
|
label={_(msg`Request code`)}
|
||||||
variant="solid"
|
|
||||||
color="primary"
|
color="primary"
|
||||||
size="large"
|
size="large"
|
||||||
disabled={isProcessing}
|
disabled={isProcessing}
|
||||||
@@ -240,22 +230,19 @@ function Inner() {
|
|||||||
</ButtonText>
|
</ButtonText>
|
||||||
{isProcessing && <ButtonIcon icon={Loader} />}
|
{isProcessing && <ButtonIcon icon={Loader} />}
|
||||||
</Button>
|
</Button>
|
||||||
{gtMobile ? (
|
<Button
|
||||||
<Button
|
label={_(msg`Already have a code?`)}
|
||||||
label={_(msg`Already have a code?`)}
|
onPress={() => setStage(Stages.ChangePassword)}
|
||||||
onPress={() => setStage(Stages.ChangePassword)}
|
size="large"
|
||||||
size="large"
|
color="primary_subtle"
|
||||||
color="secondary"
|
disabled={isProcessing}>
|
||||||
variant="solid"
|
<ButtonText>
|
||||||
disabled={isProcessing}>
|
<Trans>Already have a code?</Trans>
|
||||||
<ButtonText>
|
</ButtonText>
|
||||||
<Trans>Already have a code?</Trans>
|
</Button>
|
||||||
</ButtonText>
|
{!gtMobile && (
|
||||||
</Button>
|
|
||||||
) : (
|
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Cancel`)}
|
label={_(msg`Cancel`)}
|
||||||
variant="solid"
|
|
||||||
color="secondary"
|
color="secondary"
|
||||||
size="large"
|
size="large"
|
||||||
disabled={isProcessing}
|
disabled={isProcessing}
|
||||||
@@ -270,7 +257,6 @@ function Inner() {
|
|||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Change password`)}
|
label={_(msg`Change password`)}
|
||||||
variant="solid"
|
|
||||||
color="primary"
|
color="primary"
|
||||||
size="large"
|
size="large"
|
||||||
disabled={isProcessing}
|
disabled={isProcessing}
|
||||||
@@ -282,7 +268,6 @@ function Inner() {
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Back`)}
|
label={_(msg`Back`)}
|
||||||
variant="solid"
|
|
||||||
color="secondary"
|
color="secondary"
|
||||||
size="large"
|
size="large"
|
||||||
disabled={isProcessing}
|
disabled={isProcessing}
|
||||||
@@ -298,7 +283,6 @@ function Inner() {
|
|||||||
) : stage === Stages.Done ? (
|
) : stage === Stages.Done ? (
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Close`)}
|
label={_(msg`Close`)}
|
||||||
variant="solid"
|
|
||||||
color="primary"
|
color="primary"
|
||||||
size="large"
|
size="large"
|
||||||
onPress={() => control.close()}>
|
onPress={() => control.close()}>
|
||||||
|
|||||||
Reference in New Issue
Block a user