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

feat: Add /welcome/login route for displaying safes list #3176

Closed
wants to merge 58 commits into from

Conversation

jmealy
Copy link
Contributor

@jmealy jmealy commented Jan 31, 2024

Redesign the welcome page according to the designs: https://www.figma.com/file/WSpulDIM1EoSCI6Ph9QdWq/Seedless-onboarding?type=design&node-id=1047-12423&mode=design&t=MSQvs5eVjdMOLVzr-0

The new design is added to a new route at /welcome/login. Currently it doesn't show acual owned safes. Implementation of getting owned safes will be done later using the new endpoint getAllOwnedSafes: safe-global/safe-gateway-typescript-sdk#144

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

jmealy and others added 30 commits January 17, 2024 17:03
hide show more button after it is clicked
@jmealy jmealy changed the title Login page redesign feat: Add /welcome/login for displaying safes Feb 2, 2024
Copy link

github-actions bot commented Feb 2, 2024

📦 Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 1.02 MB (🟢 -1.71 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
/welcome/login 376 B 1.02 MB

Eighteen Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/address-book 27.95 KB (🟡 +1.49 KB) 1.05 MB
/apps 47.93 KB (🟡 +47 B) 1.07 MB
/apps/custom 39.34 KB (🟡 +42 B) 1.06 MB
/apps/open 66.35 KB (🟡 +2.16 KB) 1.08 MB
/balances 29.08 KB (🟡 +1.41 KB) 1.05 MB
/home 42.34 KB (🟡 +1.56 KB) 1.06 MB
/new-safe/create 31.24 KB (🟡 +1.58 KB) 1.05 MB
/new-safe/load 19.12 KB (🟡 +13 B) 1.04 MB
/settings/security-login 31.08 KB (🟡 +1.47 KB) 1.05 MB
/settings/setup 32.66 KB (🟡 +1.49 KB) 1.05 MB
/share/safe-app 11.09 KB (🟡 +181 B) 1.03 MB
/transactions 94 KB (🟡 +1.29 KB) 1.11 MB
/transactions/history 93.97 KB (🟡 +1.29 KB) 1.11 MB
/transactions/messages 50.78 KB (🟡 +1.26 KB) 1.07 MB
/transactions/queue 46.2 KB (🟡 +1.59 KB) 1.06 MB
/transactions/tx 35.42 KB (🟡 +1.27 KB) 1.05 MB
/welcome 6.57 KB (🟢 -533 B) 1.03 MB
/welcome/social-login 7.07 KB (🟢 -489 B) 1.03 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.

@jmealy jmealy marked this pull request as ready for review February 2, 2024 14:43
@jmealy jmealy changed the title feat: Add /welcome/login for displaying safes feat: Add /welcome/login route for displaying safes Feb 2, 2024
@jmealy jmealy changed the title feat: Add /welcome/login route for displaying safes feat: Add /welcome/login route for displaying safes list Feb 2, 2024
src/components/common/SafeList/index.tsx Outdated Show resolved Hide resolved
src/components/common/SafeList/index.tsx Outdated Show resolved Hide resolved
src/components/common/OwnedSafeList/index.tsx Outdated Show resolved Hide resolved
src/components/common/OwnedSafeList/index.tsx Outdated Show resolved Hide resolved
@katspaugh katspaugh marked this pull request as draft February 5, 2024 13:40
@katspaugh
Copy link
Member

There are CI jobs failing.

As we talked about a few times, this PR should not contain any changes to the Redux stores. Only the HTML/CSS for the new page.

Copy link

github-actions bot commented Feb 6, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

There's a sidebar flashing when opening the login page, please add it to the NO_SIDEBAR_ROUTES list.

src/components/common/OwnedSafeList/index.tsx Outdated Show resolved Hide resolved
watchedSafesOnAllChains = [...watchedSafesOnAllChains, ...watchedSafesWithChain]
}
const promises = watchedSafesOnAllChains.map(async ({ safeAddress, chain, threshold, owners }) => {
const fiatBalance = await getBalances(chain.chainId, safeAddress, 'USD').then((result) => result.fiatTotal)
Copy link
Member

Choose a reason for hiding this comment

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

USD shouldn't be hardcoded. There's a redux selector for the user-preferred currency.

Copy link
Member

Choose a reason for hiding this comment

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

Overall, I wouldn't fetch balances in this hook. They essentially make the entire list wait. I would instead fetch the balances separately and then pass them separately to the corresponding components.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah that makes sense. I moved the balance request to SafeListItem

@katspaugh
Copy link
Member

This seems to be not centered vertically, plus didn't the design have a placeholder element in this block?

Screenshot 2024-02-06 at 12 46 03

@jmealy jmealy marked this pull request as ready for review February 6, 2024 16:14
@katspaugh katspaugh mentioned this pull request Feb 9, 2024
@katspaugh katspaugh closed this Feb 16, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants