Skip to content

Commit

Permalink
Show primary buttons first on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Anboias committed Nov 21, 2024
1 parent 25214fc commit 655a6dd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/pages/dashboard/forms/confirm-unstake-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ModalFooter, ModalHeader } from '../../../components/modal';
import Button from '../../../components/button';
import styles from './forms.module.scss';
import UnstakeHelperText from './unstake-helper-text';
import classNames from 'classnames';

interface Props {
title: string;
Expand All @@ -23,7 +24,7 @@ const ConfirmUnstakeForm = (props: Props) => {
<ModalHeader>{props.title}</ModalHeader>

<ModalFooter noMargin>
<div className={styles.tokenAmountFormActions}>
<div className={classNames(styles.tokenAmountFormActions, styles.columnReverse)}>
<Button type="text-blue" size="sm" sm={{ size: 'lg' }} onClick={onClose} className={styles.cancelButton}>
Cancel
</Button>
Expand Down
8 changes: 8 additions & 0 deletions src/pages/dashboard/forms/forms.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
width: 100%;
box-sizing: border-box;

&.columnReverse {
flex-direction: column-reverse;
}

> * {
width: 100%;
}
Expand All @@ -55,6 +59,10 @@
gap: 32px;
justify-content: center;

&.columnReverse {
flex-direction: row;
}

> * {
width: auto;
}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/dashboard/forms/token-deposit-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { isUserRejection, formatApi3, parseApi3, messages, UNKNOWN_NUMBER } from
import styles from './forms.module.scss';
import UnstakeHelperText from './unstake-helper-text';
import { go, goSync } from '@api3/promise-utils';
import classNames from 'classnames';

interface Props {
allowance: BigNumber;
Expand Down Expand Up @@ -109,7 +110,7 @@ const TokenDepositForm = (props: Props) => {
</div>

<ModalFooter>
<div className={styles.tokenAmountFormActions}>
<div className={classNames(styles.tokenAmountFormActions, !approvalRequired && styles.columnReverse)}>
{approvalRequired ? (
<Button type="primary" size="sm" sm={{ size: 'lg' }} onClick={handleApprove}>
Approve
Expand Down

0 comments on commit 655a6dd

Please sign in to comment.