Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show debondable amount next to debonding input #1915

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/1915.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Show debondable amount next to debonding input
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,26 @@ exports[`<ReclaimEscrowForm /> should match snapshot 1`] = `
flex-direction: column;
}
.c8 {
.c7 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
box-sizing: border-box;
max-width: 100%;
margin-top: 6px;
-webkit-align-items: flex-end;
-webkit-box-align: flex-end;
-ms-flex-align: flex-end;
align-items: flex-end;
min-width: 0;
min-height: 0;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
.c10 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand All @@ -27,6 +46,7 @@ exports[`<ReclaimEscrowForm /> should match snapshot 1`] = `
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
height: 50px;
}
.c1 {
Expand All @@ -44,7 +64,7 @@ exports[`<ReclaimEscrowForm /> should match snapshot 1`] = `
padding-top: 12px;
}
.c9 {
.c11 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand All @@ -60,7 +80,7 @@ exports[`<ReclaimEscrowForm /> should match snapshot 1`] = `
height: 100%;
}
.c11 {
.c13 {
-webkit-flex: 0 0 auto;
-ms-flex: 0 0 auto;
flex: 0 0 auto;
Expand All @@ -70,7 +90,7 @@ exports[`<ReclaimEscrowForm /> should match snapshot 1`] = `
width: 24px;
}
.c7 {
.c9 {
-webkit-flex: 0 0 auto;
-ms-flex: 0 0 auto;
flex: 0 0 auto;
Expand All @@ -87,7 +107,13 @@ exports[`<ReclaimEscrowForm /> should match snapshot 1`] = `
font-weight: 600;
}
.c10 {
.c8 {
font-size: 14px;
line-height: 20px;
font-weight: bolder;
}
.c12 {
display: inline-block;
box-sizing: border-box;
cursor: pointer;
Expand Down Expand Up @@ -122,51 +148,51 @@ exports[`<ReclaimEscrowForm /> should match snapshot 1`] = `
font-weight: bold;
}
.c10:hover {
.c12:hover {
box-shadow: 0px 0px 0px 2px #0500e2;
}
.c10:focus {
.c12:focus {
outline: none;
box-shadow: 0 0 2px 2px #00A9FF;
}
.c10:focus > circle,
.c10:focus > ellipse,
.c10:focus > line,
.c10:focus > path,
.c10:focus > polygon,
.c10:focus > polyline,
.c10:focus > rect {
.c12:focus > circle,
.c12:focus > ellipse,
.c12:focus > line,
.c12:focus > path,
.c12:focus > polygon,
.c12:focus > polyline,
.c12:focus > rect {
outline: none;
box-shadow: 0 0 2px 2px #00A9FF;
}
.c10:focus::-moz-focus-inner {
.c12:focus::-moz-focus-inner {
border: 0;
}
.c10:focus:not(:focus-visible) {
.c12:focus:not(:focus-visible) {
outline: none;
box-shadow: none;
}
.c10:focus:not(:focus-visible) > circle,
.c10:focus:not(:focus-visible) > ellipse,
.c10:focus:not(:focus-visible) > line,
.c10:focus:not(:focus-visible) > path,
.c10:focus:not(:focus-visible) > polygon,
.c10:focus:not(:focus-visible) > polyline,
.c10:focus:not(:focus-visible) > rect {
.c12:focus:not(:focus-visible) > circle,
.c12:focus:not(:focus-visible) > ellipse,
.c12:focus:not(:focus-visible) > line,
.c12:focus:not(:focus-visible) > path,
.c12:focus:not(:focus-visible) > polygon,
.c12:focus:not(:focus-visible) > polyline,
.c12:focus:not(:focus-visible) > rect {
outline: none;
box-shadow: none;
}
.c10:focus:not(:focus-visible)::-moz-focus-inner {
.c12:focus:not(:focus-visible)::-moz-focus-inner {
border: 0;
}
.c12 {
.c14 {
display: inline-block;
box-sizing: border-box;
cursor: pointer;
Expand Down Expand Up @@ -198,47 +224,47 @@ exports[`<ReclaimEscrowForm /> should match snapshot 1`] = `
font-weight: bold;
}
.c12:hover {
.c14:hover {
box-shadow: 0px 0px 0px 2px #0500e2;
}
.c12:focus {
.c14:focus {
outline: none;
box-shadow: 0 0 2px 2px #00A9FF;
}
.c12:focus > circle,
.c12:focus > ellipse,
.c12:focus > line,
.c12:focus > path,
.c12:focus > polygon,
.c12:focus > polyline,
.c12:focus > rect {
.c14:focus > circle,
.c14:focus > ellipse,
.c14:focus > line,
.c14:focus > path,
.c14:focus > polygon,
.c14:focus > polyline,
.c14:focus > rect {
outline: none;
box-shadow: 0 0 2px 2px #00A9FF;
}
.c12:focus::-moz-focus-inner {
.c14:focus::-moz-focus-inner {
border: 0;
}
.c12:focus:not(:focus-visible) {
.c14:focus:not(:focus-visible) {
outline: none;
box-shadow: none;
}
.c12:focus:not(:focus-visible) > circle,
.c12:focus:not(:focus-visible) > ellipse,
.c12:focus:not(:focus-visible) > line,
.c12:focus:not(:focus-visible) > path,
.c12:focus:not(:focus-visible) > polygon,
.c12:focus:not(:focus-visible) > polyline,
.c12:focus:not(:focus-visible) > rect {
.c14:focus:not(:focus-visible) > circle,
.c14:focus:not(:focus-visible) > ellipse,
.c14:focus:not(:focus-visible) > line,
.c14:focus:not(:focus-visible) > path,
.c14:focus:not(:focus-visible) > polygon,
.c14:focus:not(:focus-visible) > polyline,
.c14:focus:not(:focus-visible) > rect {
outline: none;
box-shadow: none;
}
.c12:focus:not(:focus-visible)::-moz-focus-inner {
.c14:focus:not(:focus-visible)::-moz-focus-inner {
border: 0;
}
Expand Down Expand Up @@ -366,20 +392,26 @@ exports[`<ReclaimEscrowForm /> should match snapshot 1`] = `
}
@media only screen and (max-width:768px) {
.c7 {
margin-top: 3px;
}
}
@media only screen and (max-width:768px) {
.c1 {
padding-top: 6px;
}
}
@media only screen and (max-width:768px) {
.c11 {
.c13 {
width: 12px;
}
}
@media only screen and (max-width:768px) {
.c7 {
.c9 {
height: 12px;
}
}
Expand Down Expand Up @@ -420,31 +452,61 @@ exports[`<ReclaimEscrowForm /> should match snapshot 1`] = `
value=""
/>
</div>
<div
class="c7"
>
<span
class="c8"
>
<span>
account.reclaimEscrow.reclaimableAmount
</span>
<span>
<div
class="c2"
style="display: inline-flex; white-space: nowrap;"
>
0.000001
</div>
<span
class="c5"
>
<span
class="notranslate"
translate="no"
>
</span>
</span>
</span>
</span>
</div>
</div>
<div
class="c7"
class="c9"
/>
<div
class="c8"
class="c10"
>
<div
class="c9"
class="c11"
>
<button
class="c10"
class="c12"
type="submit"
>
account.reclaimEscrow.reclaim
</button>
</div>
<div
class="c11"
class="c13"
/>
<div
class="c9"
class="c11"
>
<button
class="c12"
class="c14"
type="button"
>
account.reclaimEscrow.reclaimAll
Expand Down
9 changes: 8 additions & 1 deletion src/app/components/ReclaimEscrowForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { useSelector, useDispatch } from 'react-redux'
import { StringifiedBigInt } from 'types/StringifiedBigInt'
import { TransactionStatus } from '../TransactionStatus'
import { selectTicker } from '../../state/network/selectors'
import { AmountFormatter } from '../AmountFormatter'

interface Props {
/** Currently delegated amount */
Expand Down Expand Up @@ -109,8 +110,14 @@ export const ReclaimEscrowForm = memo((props: Props) => {
}
reverse
/>
<Box align="end" margin={{ top: 'xsmall' }}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we later add a feature, upon clicking the amount, it would fill in the amount field for you.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be nice

also, should make this and paratimes "Max" button consistent
image

<Text weight="bolder" size="small">
<span>{t('account.reclaimEscrow.reclaimableAmount', 'Available:')} </span>
<AmountFormatter amount={props.maxAmount} smallTicker />
</Text>
</Box>
</Box>
<Box direction="row" gap="medium">
<Box direction="row" gap="medium" height="50px">
<Box fill={isMobile}>
<Button fill label={t('account.reclaimEscrow.reclaim', 'Reclaim')} type="submit" primary />
</Box>
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"reclaimEscrow": {
"convertedToShares": "Corresponding number of gigashares: {{shares}}",
"reclaim": "Reclaim",
"reclaimAll": "Reclaim all"
"reclaimAll": "Reclaim all",
"reclaimableAmount": "Available:"
},
"sendTransaction": {
"confirmSendingToValidator": {
Expand Down
Loading