-
Notifications
You must be signed in to change notification settings - Fork 431
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
Safenet assets page #4493
Safenet assets page #4493
Conversation
Branch preview✅ Deploy successful! Storybook: |
src/utils/safenet.ts
Outdated
@@ -31,6 +43,7 @@ const convertSafenetBalanceToSafeClientGatewayBalance = ( | |||
balance, | |||
fiatBalance: ((parseInt(balance) * 1) / 10 ** decimals).toString(), | |||
fiatConversion: '1.00', | |||
safenet: true, |
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.
very minor nitpick (not a blocker): I would call it isSafenet
or safenetFlag
or hasSafenetFlag
just to make it clear it's a boolean to flag a Safenet unified balance asset.
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.
i'm not the biggest fan of isX
naming because to me, starting is
implies a question, so IMO, it's better left for functions. safenetAssetFlag
sounds good
📦 Next.js Bundle Analysis for safe-wallet-webThis analysis was generated by the Next.js Bundle Analysis action. 🤖
|
Page | Size (compressed) |
---|---|
global |
1013.58 KB (🟡 +1.28 KB) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
New Page Added
The following page was added to the bundle from the code in this PR:
Page | Size (compressed) | First Load |
---|---|---|
/settings/safenet |
185.31 KB |
1.17 MB |
Twenty-three Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
Page | Size (compressed) | First Load |
---|---|---|
/apps |
47.15 KB (🟢 -1.27 KB) |
1.04 MB |
/apps/custom |
38.78 KB (🟢 -1.28 KB) |
1.03 MB |
/apps/open |
55.28 KB (🟡 +99 B) |
1.04 MB |
/balances |
30.53 KB (🟢 -7.74 KB) |
1.02 MB |
/balances/nfts |
19.21 KB (🟡 +5 B) |
1.01 MB |
/home |
57.34 KB (🟢 -2.18 KB) |
1.05 MB |
/new-safe/advanced-create |
36.71 KB (🟡 +1.73 KB) |
1.03 MB |
/new-safe/create |
35.97 KB (🟡 +1.73 KB) |
1.02 MB |
/new-safe/load |
16.61 KB (🟡 +1.83 KB) |
1.01 MB |
/settings |
451 B (🟡 +1 B) |
1014.02 KB |
/settings/cookies |
7.68 KB (🟢 -1 B) |
1021.26 KB |
/settings/data |
7.58 KB (🟢 -3 B) |
1021.16 KB |
/settings/environment-variables |
9.17 KB (🟡 +3 B) |
1022.75 KB |
/settings/modules |
9.84 KB (🟢 -3 B) |
1023.42 KB |
/settings/notifications |
27.05 KB (-2 B) |
1.02 MB |
/settings/setup |
36 KB (-1 B) |
1.02 MB |
/stake |
597 B (🟡 +1 B) |
1014.17 KB |
/transactions |
73.69 KB (-7 B) |
1.06 MB |
/transactions/history |
73.66 KB (-7 B) |
1.06 MB |
/transactions/messages |
39.2 KB (🟢 -7 B) |
1.03 MB |
/transactions/msg |
29.53 KB (🟢 -7 B) |
1.02 MB |
/transactions/queue |
31.3 KB (🟢 -10 B) |
1.02 MB |
/transactions/tx |
21.08 KB (🟢 -8 B) |
1.01 MB |
Details
Only the gzipped size is provided here based on an expert tip.
First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link
is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.
Coverage report
Show files with reduced coverage 🔻
Test suite run success1573 tests passing in 208 suites. Report generated by 🧪jest coverage report action from 64ce29d |
public/images/safenet-bright.svg
Outdated
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.
it reminds me Claude AI logo 🙈
b145563
to
cf179e2
Compare
cf179e2
to
64ce29d
Compare
This pull request introduces a new feature to support the "safenet" attribute in token balances. The most significant changes include modifications to the
TokenIcon
component to display a safenet logo, updates to the types and hooks to handle the new attribute, and adjustments to the styles for proper display.Enhancements to Token Display:
src/components/common/TokenIcon/index.tsx
: Addedsafenet
prop to display a safenet logo if the attribute is true.src/components/common/TokenIcon/styles.module.css
: Updated styles to position the safenet logo correctly.Type and Hook Updates:
src/utils/safenet.ts
: Defined a new typeSafeBalanceResponseWithSafenet
to include thesafenet
attribute and updated the conversion function to set this attribute. [1] [2]src/hooks/useBalances.ts
: Updated theuseBalances
hook to use the newSafeBalanceResponseWithSafenet
type. [1] [2]src/components/balances/AssetsTable/useHideAssets.ts
: Updated theuseVisibleAssets
function to return items of typeSafeBalanceResponseWithSafenet
. [1] [2]Component Adjustments:
src/components/balances/AssetsTable/index.tsx
: ModifiedAssetsTable
to pass thesafenet
attribute to theTokenIcon
component.