-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat(wallet-dashboard): add staking confirmation screen #4034
Conversation
…style-selected-stake # Conflicts: # apps/core/package.json # apps/core/src/components/index.ts # pnpm-lock.yaml
…style-selected-stake # Conflicts: # apps/wallet-dashboard/app/layout.tsx
…into tooling-dashboard/style-selected-stake # Conflicts: # apps/wallet-dashboard/app/(protected)/staking/page.tsx
This pull request has been deployed to Vercel. Latest commit: fe7776a ✅ Preview: https://apps-backend-29a719c9ccbdb9b80c97b599a599d8953354da-m97x57bh5.vercel.app |
This pull request has been deployed to Vercel. Latest commit: fe7776a ✅ Preview: https://apps-ui-p06lurk6q-iota1.vercel.app |
This pull request has been deployed to Vercel. Latest commit: fe7776a ✅ Preview: https://iota-rebased-explorer-092603f1de8088243ccb8b861b23e-4uy3u6cht.vercel.app |
This pull request has been deployed to Vercel. Latest commit: fe7776a ✅ Preview: https://wallet-dashboard-a225fcfa1e2f852205a61a7cd1d5d93e92-dd4r5a55d.vercel.app |
apps/wallet-dashboard/components/Dialogs/Staking/views/ConfirmAndExit.tsx
Outdated
Show resolved
Hide resolved
This pull request has been deployed to Vercel. Latest commit: c578109 ✅ Preview: https://apps-ui-8eelvkc6t-iota1.vercel.app |
This pull request has been deployed to Vercel. Latest commit: c578109 ✅ Preview: https://apps-backend-29a719c9ccbdb9b80c97b599a599d8953354da-1rqmzancc.vercel.app |
This pull request has been deployed to Vercel. Latest commit: c578109 ✅ Preview: https://iota-rebased-explorer-092603f1de8088243ccb8b861b23e-dapzgko1u.vercel.app |
c578109
to
1507c81
Compare
…shboard/style-confirmation-screen
This pull request has been deployed to Vercel. Latest commit: ce38b84 ✅ Preview: https://apps-ui-nlykh7dnd-iota1.vercel.app |
This pull request has been deployed to Vercel. Latest commit: ce38b84 ✅ Preview: https://iota-rebased-explorer-092603f1de8088243ccb8b861b23e-5mm54ax1u.vercel.app |
This pull request has been deployed to Vercel. Latest commit: ce38b84 ✅ Preview: https://wallet-dashboard-a225fcfa1e2f852205a61a7cd1d5d93e92-8jok503or.vercel.app |
This pull request has been deployed to Vercel. Latest commit: ce38b84 ✅ Preview: https://apps-backend-29a719c9ccbdb9b80c97b599a599d8953354da-660nere3l.vercel.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conflicts 🙏🏼
This pull request has been deployed to Vercel. Latest commit: 24ea08c ✅ Preview: https://apps-backend-29a719c9ccbdb9b80c97b599a599d8953354da-ad5rw6a4z.vercel.app |
This pull request has been deployed to Vercel. Latest commit: 24ea08c ✅ Preview: https://iota-rebased-explorer-092603f1de8088243ccb8b861b23e-6j384yf20.vercel.app |
This pull request has been deployed to Vercel. Latest commit: 24ea08c ✅ Preview: https://wallet-dashboard-a225fcfa1e2f852205a61a7cd1d5d93e92-kh2cv1azy.vercel.app |
This pull request has been deployed to Vercel. Latest commit: 8c14776 ✅ Preview: https://apps-backend-29a719c9ccbdb9b80c97b599a599d8953354da-lmwne3qh4.vercel.app |
This pull request has been deployed to Vercel. Latest commit: 8c14776 ✅ Preview: https://iota-rebased-explorer-092603f1de8088243ccb8b861b23e-pgvtlb9xt.vercel.app |
This pull request has been deployed to Vercel. Latest commit: 8c14776 ✅ Preview: https://wallet-dashboard-a225fcfa1e2f852205a61a7cd1d5d93e92-fzruvuylf.vercel.app |
selectedValidator: selectedValidatorAddress, | ||
onBack, | ||
onStake, | ||
gasBudget = 0, | ||
handleClose, | ||
validatorApy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this used?
@@ -203,13 +201,14 @@ export function StakeDialog({ | |||
onNext={selectValidatorHandleNext} | |||
/> | |||
)} | |||
{view === StakeDialogView.EnterAmount && ( | |||
{view === StakeDialogView.EnterAmount && validatorApy && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If validatorApy
is not needed, there is no need to put it here either
@@ -220,6 +219,18 @@ export function StakeDialog({ | |||
showActiveStatus | |||
/> | |||
)} | |||
{view === StakeDialogView.TransactionDetails && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a comment: Why had you put it in the previous condition and not here?
... && validatorApy && (
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, cause there was no need for it to be always present, or it could be null
onSuccess(tx.digest); | ||
} | ||
onSuccess: () => { | ||
setView?.(StakeDialogView.TransactionDetails); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is setView
optional in the props?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, wasn't made by this PR. I know previously there was a component were this DIalog was used without passing the setView prop
|
||
import { IotaValidatorSummary } from '@iota/iota-sdk/client'; | ||
|
||
//TODO: verify this is the correct validator stake balance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was in the code previously, are you sure we should delete it?
apps/core/src/utils/formatApy.ts
Outdated
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export function formatApy(apy: number, isApyApproxZero: boolean = false): string { | ||
return isApyApproxZero ? '~0%' : `${apy}%`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return isApyApproxZero ? '~0%' : `${apy}%`; | |
return isApyApproxZero ? '~ 0%' : `${apy}%`; |
|
||
<LayoutFooter> | ||
<div className="flex w-full"> | ||
<Button type={ButtonType.Primary} fullWidth onClick={onConfirm} text="Finish" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Button type={ButtonType.Primary} fullWidth onClick={onConfirm} text="Finish" /> | |
<Button type={ButtonType.Primary} fullWidth onClick={onConfirm} text="Confirm & Exit" /> |
This pull request has been deployed to Vercel. Latest commit: 026ee47 ✅ Preview: https://apps-backend-29a719c9ccbdb9b80c97b599a599d8953354da-32clxuopb.vercel.app |
This pull request has been deployed to Vercel. Latest commit: 026ee47 ✅ Preview: https://iota-rebased-explorer-092603f1de8088243ccb8b861b23e-2vzmsu75b.vercel.app |
This pull request has been deployed to Vercel. Latest commit: 026ee47 ✅ Preview: https://wallet-dashboard-a225fcfa1e2f852205a61a7cd1d5d93e92-2rqveq56a.vercel.app |
Im very sorry but the original issue was wrong and this PR is not needed 💔 |
Fixes #3700
Depends on: #3832