Skip to content

feat: Add mobile navbar #3186

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

Merged
merged 3 commits into from
Jul 25, 2022
Merged

feat: Add mobile navbar #3186

merged 3 commits into from
Jul 25, 2022

Conversation

BrunoQuaresma
Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma commented Jul 25, 2022

Related to: #3185

Screen Shot 2022-07-25 at 13 41 06

Screen Shot 2022-07-25 at 13 41 29

Screen Shot 2022-07-25 at 13 41 18

@BrunoQuaresma BrunoQuaresma self-assigned this Jul 25, 2022
@BrunoQuaresma BrunoQuaresma requested a review from a team as a code owner July 25, 2022 16:45
@@ -19,41 +23,66 @@ export const Language = {
users: "Users",
}

export const NavbarView: React.FC<NavbarViewProps> = ({ user, onSignOut }) => {
const NavItems: React.FC<{ className?: string; linkClassName?: string }> = ({ className }) => {
Copy link
Member

Choose a reason for hiding this comment

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

You can just import FC as a standalone if you wish

const styles = useStyles()
const location = useLocation()

return (
<List className={combineClasses([styles.navItems, className])}>
Copy link
Member

Choose a reason for hiding this comment

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

What's the benefit of using combineClasses instead of template literals?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It handles, null, undefined and conditional styles like { isActive: styles.active }.

@Kira-Pilot
Copy link
Member

I think we can add a storybook for this at a smaller screensize: https://storybook.js.org/docs/react/essentials/viewport

@BrunoQuaresma BrunoQuaresma enabled auto-merge (squash) July 25, 2022 17:33
Copy link
Contributor

@AbhineetJain AbhineetJain left a comment

Choose a reason for hiding this comment

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

Nice start to responsive design! This is exciting. 🙌


export const NavbarView: React.FC<NavbarViewProps> = ({ user, onSignOut }) => {
const styles = useStyles()
const [isDrawerOpen, setIsDrawerOpen] = useState(false)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit Maybe worth a discussion in FE Variety, but I think by convention the setter function need not have the verb like is or has. For example, I would use setDrawerOpen here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this would be nice!

[theme.breakpoints.up("md")]: {
bottom: 0,
left: theme.spacing(3),
width: `calc(100% - 2 * ${theme.spacing(3)}px)`,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit A comment describing the calculation here would be nice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I put the commit on auto merge but I will address this when I touch it again.

@BrunoQuaresma BrunoQuaresma merged commit b0957f3 into main Jul 25, 2022
@BrunoQuaresma BrunoQuaresma deleted the bq/responsive-navbar branch July 25, 2022 17:54
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