-
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
Closed
Closed
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
c925a99
feat(tooling-dashboard): style selected stake
panteleymonchuk 1d8887e
feat(tooling-dashboard): add data to stake details page
panteleymonchuk a852fab
feat(wallet-dashboard): remove extra memo.
panteleymonchuk 8325b36
Merge remote-tracking branch 'origin/develop' into tooling-dashboard/…
panteleymonchuk 388058c
feat(staking): refactor StakeDialog. Add new Layout component.
panteleymonchuk d8d03ac
feat(tooling-core): add clsx dependency to package.json and update pn…
panteleymonchuk 1ff40ea
Merge remote-tracking branch 'origin/develop' into tooling-dashboard/…
panteleymonchuk 2c1adc9
Merge remote-tracking branch 'origin/tooling-epic/dashboard-styling' …
panteleymonchuk 4d93394
feat(wallet-dashboard): manage view for dialog outside.
panteleymonchuk 8c17341
feat(wallet-dashboard): join changes from PR 3854
panteleymonchuk 7f66cd0
feat(wallet-dashboard): join enter amount screen from PR 3874
panteleymonchuk 5932ed5
feat(tooling-core): move validation schema
panteleymonchuk 1507c81
feat(wallet-dashboard): add staking confirmation screen
VmMad 9bdb887
feat(wallet-dashboard): integrate Formik
panteleymonchuk 499e4a6
fix: build error
VmMad 14a2786
feat(wallet-dashboard): enhance StakeDialog and EnterAmountView with …
panteleymonchuk c1341dc
feat(wallet-dashboard): update StakeDialog to support selectedValidat…
panteleymonchuk c4329f4
feat(wallet-dashboard): refactor StakedInfo and Validator components …
panteleymonchuk 3a4ebb7
feat(wallet-dashboard): move useStakeTxnInfo hook to the core
panteleymonchuk 3818f2c
Merge branch 'tooling-dashboard/style-selected-stake' into tooling-da…
VmMad 54b1b1f
fix(tooling-core): downgrade bignumber.js to 9.1.1 and yup to 1.1.1
panteleymonchuk 4777432
feat: add new layout
VmMad b13ac91
Merge branch 'tooling-dashboard/style-selected-stake' into tooling-da…
VmMad 8242185
refactor(tooling-dashboard): change export to default and clean up co…
panteleymonchuk cc8b8c6
Merge branch 'tooling-dashboard/style-selected-stake' into tooling-da…
VmMad d5ee9a1
fix: import
VmMad 47cbd98
refactor: rename button and view
VmMad 371b2fd
Merge branch 'tooling-epic/dashboard-styling' into tooling-dashboard/…
brancoder be3b938
refactor(wallet-dashboard): simplify validator info retrieval and add…
panteleymonchuk 80049ac
refactor(wallet-dashboard): streamline stake calculations and integra…
panteleymonchuk 24144b3
Merge remote-tracking branch 'origin/tooling-epic/dashboard-styling' …
panteleymonchuk 0cfd637
refactor(wallet, core): update import paths for consistency and clarity
panteleymonchuk dc99beb
refactor(wallet-dashboard): integrate FormikProvider. Polish interfaces.
panteleymonchuk 8b2df8f
Merge branch 'tooling-dashboard/style-selected-stake' into tooling-da…
VmMad 873a5aa
refactor: update component name
VmMad a6e664b
Merge remote-tracking branch 'origin/develop' into tooling-dashboard/…
panteleymonchuk 2afa4d8
Merge branch 'develop' into tooling-dashboard/style-selected-stake
brancoder 796bf46
refactor: improve props
VmMad bcbdebd
feat(wallet-dashboard): refactor staking dialog management for home
panteleymonchuk b964e75
feat(wallet-dashboard): move constants to another folder.
panteleymonchuk c8bbc90
feat(wallet-dashboard): enhance transaction handling and improve user…
panteleymonchuk af7f7dc
fix(wallet-dashboard): update onBack handler for improved navigation
panteleymonchuk 69bcf98
Merge branch 'develop' into tooling-dashboard/style-selected-stake
VmMad ce38b84
Merge branch 'tooling-dashboard/style-selected-stake' into tooling-da…
VmMad 24ea08c
Merge branch 'develop' into tooling-dashboard/style-confirmation-screen
VmMad 8c14776
fix: update coin image
VmMad 9f7fe1d
refactor: remove debris
VmMad 026ee47
Merge branch 'develop' into tooling-dashboard/style-confirmation-screen
VmMad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export function formatApy(apy: number, isApyApproxZero: boolean = false): string { | ||
return isApyApproxZero ? '~ 0%' : `${apy}%`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { IotaValidatorSummary } from '@iota/iota-sdk/client'; | ||
|
||
export function getTotalValidatorStake(validatorSummary: IotaValidatorSummary | null) { | ||
return validatorSummary?.stakingPoolIotaBalance || 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
apps/wallet-dashboard/components/Dialogs/Staking/views/FinishStaking.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,76 @@ | ||||||
// Copyright (c) 2024 IOTA Stiftung | ||||||
// SPDX-License-Identifier: Apache-2.0 | ||||||
|
||||||
import { | ||||||
Button, | ||||||
ButtonType, | ||||||
Card, | ||||||
CardBody, | ||||||
CardImage, | ||||||
CardType, | ||||||
Header, | ||||||
ImageType, | ||||||
} from '@iota/apps-ui-kit'; | ||||||
import { CoinIcon, ImageIconSize, ValidatorApyData } from '@iota/core'; | ||||||
import { Validator } from './Validator'; | ||||||
import { StakingRewardDetails } from './StakingRewardDetails'; | ||||||
import { Layout, LayoutBody, LayoutFooter } from './Layout'; | ||||||
import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils'; | ||||||
|
||||||
interface FinishStakingViewProps { | ||||||
validatorAddress: string; | ||||||
gasBudget: string | number | null | undefined; | ||||||
onConfirm: () => void; | ||||||
amount: string; | ||||||
symbol: string | undefined; | ||||||
validatorApy?: ValidatorApyData | null; | ||||||
onClose: () => void; | ||||||
showActiveStatus?: boolean; | ||||||
} | ||||||
|
||||||
export function FinishStakingView({ | ||||||
validatorAddress, | ||||||
onConfirm, | ||||||
amount, | ||||||
symbol, | ||||||
onClose, | ||||||
validatorApy, | ||||||
gasBudget, | ||||||
showActiveStatus, | ||||||
}: FinishStakingViewProps): React.JSX.Element { | ||||||
return ( | ||||||
<Layout> | ||||||
<Header title="Transaction" onClose={onClose} /> | ||||||
<LayoutBody> | ||||||
<div className="flex flex-col gap-y-lg"> | ||||||
<Validator | ||||||
address={validatorAddress} | ||||||
showActiveStatus={showActiveStatus} | ||||||
isSelected | ||||||
showAction={false} | ||||||
/> | ||||||
|
||||||
<Card type={CardType.Outlined}> | ||||||
<CardImage type={ImageType.BgSolid}> | ||||||
<CoinIcon | ||||||
hasCoinWrapper | ||||||
coinType={IOTA_TYPE_ARG} | ||||||
rounded | ||||||
size={ImageIconSize.Small} | ||||||
/> | ||||||
</CardImage> | ||||||
<CardBody title={`${amount} ${symbol}`} subtitle="Stake" /> | ||||||
</Card> | ||||||
|
||||||
<StakingRewardDetails validatorApy={validatorApy} gasBudget={gasBudget} /> | ||||||
</div> | ||||||
</LayoutBody> | ||||||
|
||||||
<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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</div> | ||||||
</LayoutFooter> | ||||||
</Layout> | ||||||
); | ||||||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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