Skip to content

Commit

Permalink
chore(onboarding-ui): normalize Button loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
juliajforesti committed Oct 31, 2023
1 parent 7e84e2e commit d86f502
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ const AdminInfoForm = ({
</Form.Container>
<Form.Footer>
<ButtonGroup flexGrow={1}>
<Button type='submit' primary disabled={isValidating || isSubmitting}>
<Button type='submit' primary loading={isValidating || isSubmitting}>
{t('component.form.action.next')}
</Button>
</ButtonGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ const CreateCloudWorkspaceForm = ({
<Button
type='submit'
primary
disabled={isValidating || isSubmitting || !isValid}
disabled={!isValid}
loading={isSubmitting || isValidating}
>
{t('component.form.action.next')}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ const CreateFirstMemberForm = ({
<Button
type='submit'
primary
disabled={isValidating || isSubmitting || !isValid}
disabled={!isValid}
loading={isSubmitting || isValidating}
minHeight='x40'
>
{isSubmitting ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ const CreateNewPassword = ({
<Button
type='submit'
primary
disabled={isValidating || isSubmitting || !isValid}
loading={isValidating || isSubmitting}
disabled={!isValid}
>
{t('form.createPasswordForm.button.text')}
</Button>
Expand Down
3 changes: 2 additions & 1 deletion packages/onboarding-ui/src/forms/LoginForm/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ const LoginForm = ({
<LoginActionsWrapper>
<Button
type='submit'
disabled={!isDirty || isValidating || isSubmitting}
loading={isValidating || isSubmitting}
disabled={!isDirty}
primary
>
{isPasswordLess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ const NewAccountForm = ({
<Button
type='submit'
primary
disabled={isValidating || isSubmitting || !isValid}
loading={isValidating || isSubmitting}
disabled={!isValid}
>
{t('component.form.action.next')}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ const OrganizationInfoForm = ({
{t('component.form.action.back')}
</Button>
)}
<Button type='submit' primary disabled={isValidating || isSubmitting}>
<Button type='submit' primary loading={isValidating || isSubmitting}>
{nextStep ?? t('component.form.action.next')}
</Button>
{onClickSkip && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ const PasteStep = ({ setStep }: PasteStepProps): ReactElement => {
<Form.Footer>
<Box display='flex' flexDirection='column'>
<ButtonGroup vertical={isMobile} flexGrow={1}>
<Button type='submit' primary disabled={isSubmitting || !isValid}>
<Button
type='submit'
primary
disabled={!isValid}
loading={isSubmitting}
>
{t('component.form.action.completeRegistration')}
</Button>
<Button type='button' onClick={() => setStep(Steps.COPY)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const RegisterServerForm = ({
<Button
type='submit'
primary
disabled={isSubmitting || isValidating}
loading={isSubmitting || isValidating}
>
{t('component.form.action.registerWorkspace')}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ const RequestTrialForm = ({
<Button
type='submit'
primary
disabled={isValidating || isSubmitting || !isValid}
loading={isValidating || isSubmitting}
disabled={!isValid}
>
{t('form.requestTrialForm.button.text')}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ const ResetPasswordForm = ({
<Button
type='submit'
primary
disabled={isValidating || isSubmitting || !isValid}
loading={isValidating || isSubmitting}
disabled={!isValid}
>
{t('form.resetPasswordForm.action.submit')}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion packages/onboarding-ui/src/forms/TotpForm/TotpForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const TotpForm = ({
</Form.Container>
<Form.Footer>
<TotpActionsWrapper>
<Button type='submit' disabled={isValidating || isSubmitting} primary>
<Button type='submit' loading={isValidating || isSubmitting} primary>
{t('form.totpForm.button.text')}
</Button>
<ActionLink fontScale='p2' onClick={onChangeTotpForm}>
Expand Down

0 comments on commit d86f502

Please sign in to comment.