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: redesign welcome page #2593

Merged
merged 9 commits into from
Oct 6, 2023
Merged

Conversation

schmanu
Copy link
Member

@schmanu schmanu commented Oct 5, 2023

What it solves

Redesigns Welcome Page

  • Two column design
  • Login / Wallet connection on Welcome Page
  • Removes wallet connection from Create Safe flow

Resolves #2569

How to test it

  • Navigate to Welcome page without wallet connected
  • Navigate to Welcome page with wallet connected
  • Navigate to Welcome page whilst being logged in to google

Screenshots

Screenshot 2023-10-05 at 14 54 29
Screenshot 2023-10-05 at 13 48 32
Screenshot 2023-10-05 at 13 15 05
Screenshot 2023-10-05 at 13 14 23

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) 🧑‍💻

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

Branch preview

✅ Deploy successful!

https://seedless_redesign_welcome_page--walletweb.review-wallet-web.5afe.dev

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

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

@katspaugh
Copy link
Member

Not sure if it's like this by design but I would make these buttons equal size:
Screenshot 2023-10-05 at 15 25 59

@katspaugh
Copy link
Member

katspaugh commented Oct 5, 2023

Do you only show "My Safe Accounts" if there are added safes? What about owned Safes?
There's no way from this new UI to open an existing safe you own but haven't added yet.

@schmanu
Copy link
Member Author

schmanu commented Oct 5, 2023

Not sure if it's like this by design but I would make these buttons equal size:
Good catch!
I made the Connect Wallet button slightly higher so they match.

@schmanu
Copy link
Member Author

schmanu commented Oct 5, 2023

Do you only show "My Safe Accounts" if there are added safes? What about owned Safes? There's no way from this new UI to open an existing safe you own but haven't added yet.

The Designs for how to integrate the Sidebar are not done yet.
So this is subject to change. For now it depends on the added Safes but we could also fetch and include the owned Safes here.

@schmanu schmanu requested a review from iamacook October 5, 2023 14:12
@katspaugh
Copy link
Member

The Google button is still taller. 44px vs 40px for the wallet button. Probably because of the Google logo?

Comment on lines 24 to 28
useEffect(() => {
if (loginTriggered && wallet && onLogin) {
onLogin()
}
}, [loginTriggered, onLogin, wallet])
Copy link
Member

Choose a reason for hiding this comment

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

Can we call onLogin inside login?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so.
When triggerLogin resolves, it might result in a MANUAL_RECOVERY state, which will pop up the Password recovery modal.
So we have to react to a side effect here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Same here: Calling the callback after triggerLogin / recoverPassword resolves causes the useSyncSafeCreationStep to immediately redirect us back.

src/components/common/ConnectWallet/MPCLogin.tsx Outdated Show resolved Hide resolved
src/components/common/ConnectWallet/styles.module.css Outdated Show resolved Hide resolved
src/components/welcome/NewSafe.tsx Outdated Show resolved Hide resolved
Comment on lines 12 to 19
const connectedWalletInfo =
wallet !== null && wallet?.label !== ONBOARD_MPC_MODULE_LABEL
? {
address: wallet?.address,
label: wallet?.label,
icon: wallet?.icon,
}
: undefined
Copy link
Member

Choose a reason for hiding this comment

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

We could move the condition to what is currently line 35 and use the wallet object as is.

Comment on lines +29 to +33
useEffect(() => {
if (loginTriggered && wallet && onLogin) {
onLogin()
}
}, [loginTriggered, onLogin, wallet])
Copy link
Member

Choose a reason for hiding this comment

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

As before, can we move onLogin into login?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sadly connectWallet currently does not block until the wallet is connected.
I will try to refactor into an async function. Than it should be possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried calling onLogin after the login / connectWallet call and it does not work stable.
Sometimes it takes a few splitseconds extra for the useWallet hook to update which causes the useSyncSafeCreationStep hook to redirect back to the welcome page.

I will leave it as is for now.

src/components/welcome/WelcomeLogin/index.tsx Outdated Show resolved Hide resolved
src/components/welcome/WelcomeLogin/index.tsx Outdated Show resolved Hide resolved
src/components/common/ConnectWallet/MPCWalletProvider.tsx Outdated Show resolved Hide resolved
src/hooks/wallets/mpc/useMPCWallet.ts Outdated Show resolved Hide resolved
@schmanu schmanu requested a review from iamacook October 6, 2023 09:44
@schmanu schmanu merged commit cf8db3f into web3authcoresdk Oct 6, 2023
6 of 7 checks passed
@schmanu schmanu deleted the seedless-redesign-welcome-page branch October 6, 2023 11:49
@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 2023
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