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

mobile global nav #447

Merged
merged 3 commits into from
Feb 29, 2024
Merged

mobile global nav #447

merged 3 commits into from
Feb 29, 2024

Conversation

buddy-web3
Copy link
Member

No description provided.

const classes = ['button', className, tooltip && 'tooltip'].filter((i) => i).join(' ')
if (typeof action === 'string') {
return (
<Link to={action} className={classes} data-tooltip={tooltip}>
{leftIcon && leftIcon}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't like how this is getting bloated. Why not just pass the icon in as a child, rather than having special parameters? So e.g.:

<Button>
   <SomeIcon />
   bla bla
</Button>

rather than
<Button leftIcon={<SomeIcon/>}>bla bla</Button>?

Copy link
Member Author

Choose a reason for hiding this comment

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

that's how it was done..I forgot to remove that part of the code.

<XLarge className={'menu-button'} onClick={toggleMenu} />
</nav>

<div className={'articles-mobile'}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should reuse the ArticlesDropdown component. A bit of extra css there should handle transforming it from a grid into a list

<header className="top-header">
{!showArticles && (
<>
<nav className="top-nav">
Copy link
Collaborator

Choose a reason for hiding this comment

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

how much of this could be handled with css in the normal Nav component?

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'm not sure I follow, can you please explain what you mean?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is basically the same as the current Nav, with a bit of things moved around. So you could have a mobile-only class that you add to the show menu button and a desktop-only one on the searchbar, which (with a couple of extra css settings) will allow you to have all of these in the same component, rather than duplicating them. The menu in theory could also be done with css, but that might be tricky. Still - there would then only be a few new items, which will make things simpler

Copy link
Collaborator

Choose a reason for hiding this comment

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

I only just noticed that I didn't send this comment...

Copy link
Member Author

Choose a reason for hiding this comment

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

do you still want this done...?

Copy link
Collaborator

Choose a reason for hiding this comment

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

preferably. But this certainly still needs to be connected to the actual page

{item.title}
</Link>
))}
<div className="default-bold margin-bottom top-margin">Browse by category</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

what are the classes margin-bottom and top-margin? For bottom padding we want to use the class "padding-bottom-[number]". Maybe I will create padding-top classes and even margin classes too...

}
.top-nav {
justify-content: space-between;
padding: var(--spacing-20) var(--spacing-24);
Copy link
Contributor

Choose a reason for hiding this comment

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

The nav was supposed to be based on height (using 80px) rather than padding. If you want to use padding can you just round to the nearest one, so either 16px or 24px? And remove the --spacing-20 var

}
.mobile-menu > .button {
border-radius: 0;
font-size: 16px;
Copy link
Contributor

Choose a reason for hiding this comment

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

never write any CSS for fonts! Assign whichever is the right class based on the Figma, or just h1 or h2 tag.

app/newRoot.css Outdated
@@ -32,6 +32,7 @@
--spacing-8: 8px;
--spacing-12: 12px;
--spacing-16: 16px;
--spacing-20: 20px;
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this, sorry!

@@ -22,6 +22,7 @@ const Button = ({children, action, tooltip, icon, className}: ButtonProps) => {
return (
<button className={classes} onClick={action} data-tooltip={tooltip}>
{children}
{icon && icon}
Copy link
Collaborator

Choose a reason for hiding this comment

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

just add it to the children, rather than adding an extra property just for this. Also, {icon && icon} is exactly the same as {icon} (I'm actually supprised that the linter didn't complain)

@mruwnik mruwnik merged commit e841ad0 into stampy-redesign Feb 29, 2024
1 check passed
@mruwnik mruwnik deleted the stampy-redesign-424 branch February 29, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants