-
Notifications
You must be signed in to change notification settings - Fork 8
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): style staking overview #4026
Closed
Closed
Changes from 124 commits
Commits
Show all changes
126 commits
Select commit
Hold shift + click to select a range
54aa532
feat(wallet-dashboard): add styles for Review & Send screen
VmMad 9ae17c0
Merge branch 'develop' into tooling-dashboard/style-send-screen
VmMad cc2a855
fix: move CoinIcon to core
VmMad 7bd6cbf
feat(wallet-dashboard): style send entry screen WIP
cpl121 10c23f8
Merge branches 'tooling-dashboard/style-send-entry-screen' and 'devel…
cpl121 40d36db
Merge branches 'tooling-dashboard/style-send-entry-screen' and 'devel…
cpl121 79c283b
feat(wallet-dashboard): style send entry screen WIP
cpl121 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 993a16a
Merge branches 'tooling-dashboard/style-send-entry-screen' and 'devel…
cpl121 f820cf3
fix(wallet-dashboard): sort the dependencies
cpl121 cb75496
feat(wallet-dashboard): includes icon coin in coin selector
cpl121 9b56596
fix(wallet-dashboard): prettier
cpl121 758cba8
fix(wallet-dashboard): update schema validation and share gas budget …
cpl121 439f050
Merge branches 'tooling-dashboard/style-send-entry-screen' and 'devel…
cpl121 8325b36
Merge remote-tracking branch 'origin/develop' into tooling-dashboard/…
panteleymonchuk 388058c
feat(staking): refactor StakeDialog. Add new Layout component.
panteleymonchuk d011746
fix(wallet-dashboard): some fixes
cpl121 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 d20a617
fix(wallet-dashboard): some build errors
cpl121 f7ae2d7
fix(wallet-dashboard): fix change amount in send token input
cpl121 b23246f
fix(wallet-dashboard): linter
cpl121 193cf87
Merge branch 'develop' of github.com:iotaledger/iota into tooling-das…
cpl121 f4abb91
Merge branches 'tooling-dashboard/style-send-entry-screen' and 'devel…
cpl121 86bedbf
fix(wallet-dashboard): linter
cpl121 d0ca55d
fix(wallet-dashboard): core prettier
cpl121 657329a
Merge branch 'tooling-dashboard/style-send-entry-screen' into tooling…
VmMad eefbd09
feat: add review dialog as view
VmMad 1de3906
Merge branches 'tooling-dashboard/style-send-entry-screen' and 'tooli…
cpl121 625aeef
Merge branch 'tooling-dashboard/style-send-entry-screen' into tooling…
VmMad be6d9f2
fix(wallet-dashboard): include interface with props and some fixes
cpl121 b3960fd
fix: update review comments
VmMad ea8646d
Merge branch 'tooling-dashboard/style-send-entry-screen' into tooling…
VmMad 82909d8
fix(wallet-dashboard): fixes
cpl121 b9a659e
fix(wallet-dashboard): fixes
cpl121 58415c7
fix(wallet-dashboard): move FormInputs to a standalone component
cpl121 3b37425
fix(wallet-dashboard): improve AddressInputs props
cpl121 64d5693
fix(wallet-dashboard): linter
cpl121 df00b07
fix(wallet-dashboard): format core
cpl121 ed3b9b5
feat: add staking overview
brancoder 290b7e9
fix: prettier
brancoder 13aaf0e
fix(wallet-dashboard): clean debris
cpl121 288483f
fix: add ExplorerLink component and add missing dialog styles
VmMad 088b300
Merge branch 'tooling-dashboard/style-send-entry-screen' into tooling…
VmMad 2c1adc9
Merge remote-tracking branch 'origin/tooling-epic/dashboard-styling' …
panteleymonchuk f1699c0
fix: use correct values for keyvalue
VmMad 28a9353
fix(wallet-dashboard): bring back the validation field
cpl121 72bfb38
fix(wallet-dashboard): bad merge removing duplicated image components
cpl121 86c27ae
fix(wallet-dashboard): remove unnecesary InputForm component
cpl121 7e6c12d
fix(wallet-dashboard): adjust to full height the dialog body
cpl121 af32d3a
fix(wallet-dashboard): prettier
cpl121 9b2c108
Merge branch 'tooling-dashboard/style-send-entry-screen' into tooling…
VmMad 754d2db
fix: gas approximation
VmMad 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 78e5527
fix(wallet-dashboard): max button disabled
cpl121 1fe1d05
feat(wallet-dashboard): improvements
cpl121 94bcca1
fix(wallet-dashboard): improve formik props
cpl121 17058ad
fix(wallet-dashboard): improvements
cpl121 5932ed5
feat(tooling-core): move validation schema
panteleymonchuk ddca44c
refactor: Simplify SendTokenFormInput
marc2332 76d2e89
refactor: prettier:fix
marc2332 6b388b6
refactor: prettier:fix on apps/core
marc2332 78af8b4
refactor: Add missing license header to token.ts
marc2332 3e9fa71
fix: linter
cpl121 9bdb887
feat(wallet-dashboard): integrate Formik
panteleymonchuk 012b773
fix(wallet-dashboard): linter
cpl121 e97e879
fix(wallet-dashboard): linter
cpl121 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 19b96fc
Merge branch 'tooling-dashboard/style-send-entry-screen' into tooling…
VmMad 1a2f009
fix: amount format
VmMad 3a4ebb7
feat(wallet-dashboard): move useStakeTxnInfo hook to the core
panteleymonchuk 54b1b1f
fix(tooling-core): downgrade bignumber.js to 9.1.1 and yup to 1.1.1
panteleymonchuk ed42962
feat: Improve validation flow of sent screen
marc2332 69dab33
fmt
marc2332 8242185
refactor(tooling-dashboard): change export to default and clean up co…
panteleymonchuk 3ee028a
Merge branch 'tooling-dashboard/style-send-entry-screen' into tooling…
VmMad b394e26
fix: format gas outside of hook
VmMad bcf0e17
Merge branch 'tooling-epic/dashboard-styling' into tooling-dashboard/…
cpl121 7eb6be4
fix(wallet-dashboard): fixes
cpl121 4164afa
fix(wallet-dashboard): linter
cpl121 eece95d
Merge branch 'tooling-epic/dashboard-styling' into tooling-dashboard/…
brancoder 371b2fd
Merge branch 'tooling-epic/dashboard-styling' into tooling-dashboard/…
brancoder b889904
fix(wallet-dashboard): error to click max button
cpl121 be3b938
refactor(wallet-dashboard): simplify validator info retrieval and add…
panteleymonchuk 80049ac
refactor(wallet-dashboard): streamline stake calculations and integra…
panteleymonchuk 6eca201
fix(wallet-dashboard): add setFieldValue in useEffect
cpl121 218a118
Merge branch 'tooling-dashboard/style-send-screen' into tooling-dashb…
brancoder bc4e0a8
Merge branch 'tooling-dashboard/style-send-entry-screen' into tooling…
brancoder f01d18d
Merge branch 'tooling-epic/dashboard-styling' into tooling-dashboard/…
VmMad 1292ff6
fix: gas ticker
VmMad a5f5f58
fix: lint
VmMad 24144b3
Merge remote-tracking branch 'origin/tooling-epic/dashboard-styling' …
panteleymonchuk 0cfd637
refactor(wallet, core): update import paths for consistency and clarity
panteleymonchuk 3ce05be
fix: improve codebase as reviewed
VmMad dc99beb
refactor(wallet-dashboard): integrate FormikProvider. Polish interfaces.
panteleymonchuk 4737361
fix: remove log and use isPayAllIota from form values
VmMad 7fded74
Merge branch 'develop' into tooling-dashboard/style-send-screen
brancoder 0a152bb
Merge branch 'develop' into tooling-dashboard/style-send-screen
brancoder 679adf5
Merge branch 'tooling-dashboard/style-send-screen' into tooling-dashb…
brancoder a6e664b
Merge remote-tracking branch 'origin/develop' into tooling-dashboard/…
panteleymonchuk 2afa4d8
Merge branch 'develop' into tooling-dashboard/style-selected-stake
brancoder 323bcd5
fix: resolve conflicts
brancoder 111e1ad
fix: lint
brancoder bcbdebd
feat(wallet-dashboard): refactor staking dialog management for home
panteleymonchuk b964e75
feat(wallet-dashboard): move constants to another folder.
panteleymonchuk 21f13fb
fix: remove leftover comments
brancoder e0a0a7e
fix: resolve conflicts
brancoder 471761e
fix: resolve conflicts
brancoder d420f2a
Merge branch 'develop' into tooling-dashboard/style-staking-overview
brancoder 17be2c3
fix: comments and remove stakingStats component for DisplatStats from…
brancoder 072f01c
fix: remove unused files
brancoder eed1f3a
Merge branch 'develop' into tooling-dashboard/style-staking-overview
brancoder bb697fa
Merge branch 'develop' into tooling-dashboard/style-staking-overview
brancoder cc7f965
fix: remove the StatsDetail component
brancoder c9ca20a
Merge branch 'develop' into tooling-dashboard/style-staking-overview
brancoder c38a8b3
fix: conditions to display stake dialog
brancoder e75678c
Merge branch 'tooling-dashboard/style-staking-overview' of github.com…
brancoder 36f178c
Merge branch 'develop' into tooling-dashboard/style-staking-overview
brancoder 54d8dc8
fix: add useIsAsetTransferable hook
brancoder c3b0243
fix: revert constant changes
brancoder 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,4 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export * from './StakingCard'; |
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,85 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { useGetNFTMeta, useOwnedNFT, useNFTBasicData, useGetKioskContents } from './'; | ||
import { formatAddress } from '@iota/iota-sdk/utils'; | ||
import { isAssetTransferable, truncateString } from '../utils'; | ||
|
||
type NftFields = { | ||
metadata?: { fields?: { attributes?: { fields?: { keys: string[]; values: string[] } } } }; | ||
}; | ||
|
||
export function useNftDetails(nftId: string, accountAddress: string | null) { | ||
const { data: objectData, isPending: isNftLoading } = useOwnedNFT(nftId || '', accountAddress); | ||
const { data } = useGetKioskContents(accountAddress); | ||
|
||
const isContainedInKiosk = data?.lookup.get(nftId!); | ||
const kioskItem = data?.list.find((k) => k.data?.objectId === nftId); | ||
|
||
const isTransferable = isAssetTransferable(objectData); | ||
|
||
const { nftFields } = useNFTBasicData(objectData); | ||
|
||
const { data: nftMeta, isPending: isPendingMeta } = useGetNFTMeta(nftId); | ||
|
||
const nftName = nftMeta?.name || formatAddress(nftId); | ||
const nftImageUrl = nftMeta?.imageUrl || ''; | ||
|
||
// Extract either the attributes, or use the top-level NFT fields: | ||
const { keys: metaKeys, values: metaValues } = | ||
(nftFields as NftFields)?.metadata?.fields?.attributes?.fields || | ||
Object.entries(nftFields ?? {}) | ||
.filter(([key]) => key !== 'id') | ||
.reduce( | ||
(acc, [key, value]) => { | ||
acc.keys.push(key); | ||
acc.values.push(value as string); | ||
return acc; | ||
}, | ||
{ keys: [] as string[], values: [] as string[] }, | ||
); | ||
|
||
const ownerAddress = | ||
(objectData?.owner && | ||
typeof objectData?.owner === 'object' && | ||
'AddressOwner' in objectData.owner && | ||
objectData.owner.AddressOwner) || | ||
''; | ||
|
||
function formatMetaValue(value: string | object) { | ||
if (typeof value === 'object') { | ||
return { | ||
value: JSON.stringify(value), | ||
valueLink: undefined, | ||
}; | ||
} else { | ||
if (value.includes('http')) { | ||
return { | ||
value: value.startsWith('http') | ||
? truncateString(value, 20, 8) | ||
: formatAddress(value), | ||
valueLink: value, | ||
}; | ||
} | ||
return { | ||
value: value, | ||
valueLink: undefined, | ||
}; | ||
} | ||
} | ||
|
||
return { | ||
objectData, | ||
isNftLoading, | ||
nftName, | ||
nftImageUrl, | ||
ownerAddress, | ||
isTransferable, | ||
metaKeys, | ||
metaValues, | ||
formatMetaValue, | ||
isContainedInKiosk, | ||
kioskItem, | ||
nftMeta, | ||
isPendingMeta, | ||
}; | ||
} |
File renamed without changes.
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
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.
This needs to be fixed (conflict) since this is merged #4159
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.
Weird that github doesn't say there are conflict. But
isAssetTransferable
doesn't exist anymore. Use theuseIsAssetTransferable
hook.