Skip to content

Commit

Permalink
Update Withdraw/Stake/Unstake modals
Browse files Browse the repository at this point in the history
  • Loading branch information
Anboias committed Nov 20, 2024
1 parent 7d60c1c commit a9faa18
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
8 changes: 8 additions & 0 deletions src/components/modal/modal.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,12 @@
justify-content: center;
margin-top: 48px;
flex-direction: column;
width: 100%;
padding: 0 24px;
box-sizing: border-box;
max-width: 510px;

@media (min-width: $sm) {
padding: 0;
}
}
2 changes: 1 addition & 1 deletion src/pages/dashboard/forms/forms.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
gap: 24px;
width: 100%;
box-sizing: border-box;
padding: 0 24px;

> * {
width: 100%;
Expand Down Expand Up @@ -87,6 +86,7 @@

@media (min-width: $sm) {
@include font-body-9;
padding: 0;
}
}

Expand Down
20 changes: 6 additions & 14 deletions src/pages/dashboard/forms/token-amount-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { ModalFooter, ModalHeader } from '../../../components/modal';
import Input from '../../../components/input';
import Button from '../../../components/button';
import { formatApi3, parseApi3, messages } from '../../../utils';
import globalStyles from '../../../styles/global-styles.module.scss';
import styles from './forms.module.scss';
import UnstakeHelperText from './unstake-helper-text';
import { goSync } from '@api3/promise-utils';
Expand Down Expand Up @@ -51,18 +50,11 @@ const TokenAmountForm = (props: Props) => {
<>
<ModalHeader>{props.title}</ModalHeader>

<div className={globalStyles.textCenter}>
<div className={styles.formContent}>
<div className={styles.inputWrapper}>
<Input
type="number"
autosize
value={inputValue}
onChange={(e) => onChange(e.target.value)}
size="large"
autoFocus
/>
<Input type="number" autosize value={inputValue} onChange={(e) => onChange(e.target.value)} autoFocus />
{maxValue && (
<Button className={styles.maxButton} type="text" onClick={handleSetMax}>
<Button type="tertiary-color" onClick={handleSetMax} size="xs" sm={{ size: 'sm' }}>
Max
</Button>
)}
Expand All @@ -71,17 +63,17 @@ const TokenAmountForm = (props: Props) => {
{maxValue && (
<div className={styles.tokenFormBalance}>
Your balance:{' '}
<span className={globalStyles.pointer} onClick={handleSetMax}>
<button className={styles.valueButton} onClick={handleSetMax}>
{/* We don't round because we want to show all decimal digits for the maxValue field */}
{formatApi3(maxValue)}
</span>
</button>
</div>
)}
</div>

<ModalFooter>
<div className={styles.tokenAmountFormActions}>
<Button type="secondary" onClick={handleAction} disabled={!goParseApi3.success}>
<Button type="primary" size="sm" sm={{ size: 'lg' }} onClick={handleAction} disabled={!goParseApi3.success}>
{action}
</Button>
</div>
Expand Down

0 comments on commit a9faa18

Please sign in to comment.