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

Feature:-Header Redesign #366 #402

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

vernfongchao
Copy link
Contributor

@vernfongchao vernfongchao commented Jan 14, 2023

Ticket: #366

What has changed:

  1. Add Tree Icon to Header
  2. Resize WTT LOGO
  3. Add Navigation Buttons to Header
  4. Add Auth Button to Header
  5. Add Profile Image as Button to open drop down Menu
  6. Redesign Drop down Menu
  7. Add Icons to new drop down menu
  8. changed color to green on burger drop down when on mobile
  9. add logic to use burger menu vs profile image signed in vs signed out && desktop vs mobile
  10. Add Font license to license page

What to note:

Redesign Burger Menu and Button from https://www.figma.com/file/5C3v1LUNwMPQy9JOgnKEtr/Water-the-Trees
Fullscreen logged In
image
mobile logged in
image
mobile logged out
image
help is grayed out, cursor set to default and doesn't redirect anywhere
New License page:
image

Redesign Burgur Menu and Button from https://www.figma.com/file/5C3v1LUNwMPQy9JOgnKEtr/Water-the-Trees

seprate burger menu from main header file
@ri0nardo
Copy link

@vernfongchao what am i reviewing here?

@vernfongchao
Copy link
Contributor Author

@ri0nardo sorry Ill reupload images since its a different PR, but its #366, theres some images there Ill put it on draft

@vernfongchao vernfongchao marked this pull request as draft January 14, 2023 23:19
@zoobot
Copy link
Member

zoobot commented Jan 14, 2023

We should probably figure out a more sustainable method of importing icons than creating a new component for each icon. I would lean towards just importing them directly from mui. Are we re-using these all over the place with custom css?

@vernfongchao
Copy link
Contributor Author

We should probably figure out a more sustainable method of importing icons than creating a new component for each icon. I would lean towards just importing them directly from mui. Are we re-using these all over the place with custom css?

the only custom css is just the font change, Theres a few icons that I consolidated into a single file based on the type of icon. I've always had a question about components like this where is it really useful for creating new components if there's a need of it being used again but with custom css other places vs just importing it again.

change header text to montserrat
add custom font to app.css

change font header to montserrat
add props to styled/emotion button
@vernfongchao vernfongchao changed the title vernfongchao/feature/Header/Redesign Feature: Header Redesign #366 Jan 17, 2023
@vernfongchao vernfongchao changed the title Feature: Header Redesign #366 Feature:-Header Redesign #366 Jan 17, 2023
@vernfongchao vernfongchao marked this pull request as ready for review January 17, 2023 17:43
@vernfongchao
Copy link
Contributor Author

vernfongchao commented Jan 19, 2023

@zoobot @mwpark2014 @ri0nardo made import change and added the font license to the bottom of the license page. please let me know if there's anything else.

@mwpark2014
Copy link
Contributor

The screenshots look amazing! Very excited about these changes - users will be delighted

@@ -139,6 +139,85 @@ function License() {
with respect to this CC0 or use of the Work.
</div>
</div>
<div>
<div className="license-p">
<h3>SIL OPEN FONT LICENSE Version 1.1</h3>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we need to display this to users or if we just need it in the source code, but you would know better than me :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually have no idea LOL

client/src/components/Section/Section.js Show resolved Hide resolved
client/src/components/Header/Header.js Show resolved Hide resolved
&__links {
color: black;

&:hover {
Copy link
Contributor

Choose a reason for hiding this comment

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

Be careful with how heavily you nest these css selectors. This line is like 6-7 levels deep, and it seems generally accepted to keep it 3-4 levels deep (from what I can tell on https://css-tricks.com/forums/topic/sass-best-practices-nesting-more-than-3-levels-deep/).

My reasoning for not nesting too heavily:

  • It adds a bit more CSS that can bloat the CSS over time Ex: this CSS gets precompiled to .header __navigation __authcontainer __menu __menuItem __links __links:hover
  • Adds a ton of specificity to these selectors that will make it hard to maintain over time

Another resource: https://stackoverflow.com/questions/13805324/how-bad-is-it-in-practice-to-over-nest-selectors-in-sass-scss

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahh interesting, I still fairly new to scss. Ill refractor the scss to keep the nesting down.

to="/contact"
className="header__navigation__authcontainer__menu__menuitem__links"
>
<MenuItem
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like something that can be reused. Maybe have a react component like

const YourNewComponentName = ({ children, title }) => {
return
 <MenuItem
              sx={{
                padding: '8px',
                width: '180px',
              }}
              onClick={handleClose}
            >
              {children}
              <span className="header__navigation__authcontainer__menu__menuitem__links__span">
                {title}
              </span>
            </MenuItem>
 }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea actually, I had trouble with the Menu not anchoring correctly to the button, but the menu items shouldnt be an issue will look into refractoring that

@@ -4,15 +4,153 @@
url('../../assets/fonts/WTT-THIN.ttf') format('truetype');
}

// .header {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think SASS works for this. But IIRC, you tried styled components first. IF you do want to implement this with styled components, I think this reference would help write styled components in a more concise and reusable way: https://css-tricks.com/dry-ing-up-styled-components/

Basically, styled components are designed to be reusable and modular by doing some good old-fashioned inheritance

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm open to having this discussion. Its just hard for me as I don't really know what conventions there are for styled components especially when it comes to using it for page structuring and being imported and being reused constantly

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, we can have that discussion on styled components vs SCSS on Wednesday. If we do go with styled components, we can go through some examples and establish a convention for the project

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 sounds like a plan!

@vernfongchao vernfongchao marked this pull request as draft January 22, 2023 20:05
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.

4 participants