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

Shadcn migration - mobile menu #13449

Merged
merged 24 commits into from
Aug 6, 2024
Merged

Shadcn migration - mobile menu #13449

merged 24 commits into from
Aug 6, 2024

Conversation

pettinarip
Copy link
Member

@pettinarip pettinarip commented Jul 23, 2024

Description

Mobile menu implementation using Shadcn.

Related Issue

Depends on #13411 and #13419

@github-actions github-actions bot added dependencies 📦 Changes related to project dependencies tooling 🔧 Changes related to tooling of the project labels Jul 23, 2024
@github-actions github-actions bot added content 🖋️ This involves copy additions or edits documentation 📖 Change or add documentation translation 🌍 This is related to our Translation Program labels Jul 26, 2024
@pettinarip pettinarip force-pushed the shadcn-mobile-menu branch from 7bdd73a to eba5968 Compare July 26, 2024 08:56
@pettinarip pettinarip changed the base branch from shadcn-footer-link to dev July 26, 2024 11:40
@pettinarip pettinarip added the Status: Blocked 🛑 This is blocked label Jul 26, 2024
@pettinarip pettinarip marked this pull request as ready for review July 26, 2024 14:42
Copy link

netlify bot commented Jul 30, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit a0a4760
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/66b2943ac5289000084152e2
😎 Deploy Preview https://deploy-preview-13449--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 48 (🔴 down 4 from production)
Accessibility: 93 (no change from production)
Best Practices: 91 (🔴 down 7 from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@pettinarip pettinarip removed the Status: Blocked 🛑 This is blocked label Jul 30, 2024
Copy link
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

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

@pettinarip Overall looks good! Left one comment which appears to be a visual regression. If we patch that I think this is ready to be pulled in.

strokeWidth="2px"
display="inline-block"
stroke="currentColor"
className="relative inline-block h-6 w-6 stroke-current stroke-2 group-hover:text-primary-hover"
Copy link
Member

Choose a reason for hiding this comment

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

image

Is group-hover:text-primary-hover correct? Production does not use the primary color here on hover/pressing

Copy link
Member Author

@pettinarip pettinarip Jul 31, 2024

Choose a reason for hiding this comment

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

So, this is prod:
https://github.com/user-attachments/assets/d223a229-0c69-46a9-ad9a-efa5226c2656

Edit: in the video you can see that we have a hover style on the icon.

Anyway, now that I think, it doesn't really matter, this is a mobile only menu where we are not going to have hover events. So, happy to remove it to make it cleaner.

Copy link
Member

Choose a reason for hiding this comment

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

🤔 Hm.. On production I'm seeing this effect only in nested menus that have been closed after opening (the + ends up colored). I suspect that is a design bug to begin with, with the intended effect being no colored svg's throughout (the svg shape change and menu folding/unfolding is enough of an effect)

With this PR, once a menu is activated, there is always one of these svg icons in primary color. And note on mobile "hover", it does change color when I tap on a menu, and doesn't go away when I lift my finger (Safari, iOS):

RPReplay_Final1722975035.mp4

Copy link
Member

Choose a reason for hiding this comment

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

This is nit-picky though, and as I noted, I think there is an inconsistency we could work out on the side anyways to polish up that particular styling, and don't see it as a blocker to this PR.

Copy link
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

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

Looks good @pettinarip! Left a couple comments but going to pull this in

strokeWidth="2px"
display="inline-block"
stroke="currentColor"
className="relative inline-block h-6 w-6 stroke-current stroke-2 group-hover:text-primary-hover"
Copy link
Member

Choose a reason for hiding this comment

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

🤔 Hm.. On production I'm seeing this effect only in nested menus that have been closed after opening (the + ends up colored). I suspect that is a design bug to begin with, with the intended effect being no colored svg's throughout (the svg shape change and menu folding/unfolding is enough of an effect)

With this PR, once a menu is activated, there is always one of these svg icons in primary color. And note on mobile "hover", it does change color when I tap on a menu, and doesn't go away when I lift my finger (Safari, iOS):

RPReplay_Final1722975035.mp4

strokeWidth="2px"
display="inline-block"
stroke="currentColor"
className="relative inline-block h-6 w-6 stroke-current stroke-2 group-hover:text-primary-hover"
Copy link
Member

Choose a reason for hiding this comment

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

This is nit-picky though, and as I noted, I think there is an inconsistency we could work out on the side anyways to polish up that particular styling, and don't see it as a blocker to this PR.

Comment on lines +36 to +55
1: {
subtext: isLight ? "text-gray-400" : "text-gray-400",
background: isLight ? "bg-white" : "bg-black",
activeBackground: isLight ? "bg-gray-150" : "bg-gray-700",
},
2: {
subtext: isLight ? "text-gray-400" : "text-gray-300",
background: isLight ? "bg-gray-150" : "bg-gray-700",
activeBackground: isLight ? "bg-gray-200" : "bg-gray-600",
},
3: {
subtext: isLight ? "text-gray-500" : "text-gray-300",
background: isLight ? "bg-gray-200" : "bg-gray-600",
activeBackground: isLight ? "bg-gray-100" : "bg-gray-700",
},
4: {
subtext: isLight ? "text-gray-700" : "text-gray-300",
background: isLight ? "bg-gray-300" : "bg-gray-700",
activeBackground: isLight ? "bg-gray-200" : "bg-gray-800",
},
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if we want to tackle with this PR, but ideally we extract these as css variables in global.css—one under :root and one under [data-theme="dark"] for each with the same name, then add these as tokens in tailwind.config.ts.

I'm working on theming separately, so happy to just handle this as part of that process.

@wackerow wackerow merged commit 576e1ad into dev Aug 6, 2024
7 of 10 checks passed
@wackerow wackerow deleted the shadcn-mobile-menu branch August 6, 2024 21:35
This was referenced Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits dependencies 📦 Changes related to project dependencies documentation 📖 Change or add documentation tooling 🔧 Changes related to tooling of the project translation 🌍 This is related to our Translation Program
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants