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

SUM-45 | @rebeccahongsf | Theme & style header #3

Merged
merged 21 commits into from
May 6, 2024

Conversation

rebeccahongsf
Copy link
Contributor

@rebeccahongsf rebeccahongsf commented Apr 25, 2024

READY FOR REVIEW

Summary

  • Theme and style header (includes search, navigation, lockup, mobile)

Review By (Date)

  • When possible

Review Tasks

Setup tasks and/or behavior to test

  1. Check out this branch
  2. Create and nest pages under top level menu items
  3. Spin up front end local
  4. Verify that the header matches the figma mocks
  5. Add a global alert
  6. Verify that the header matches the figma mocks
  7. Review code

Site Configuration Sync

  • Is there a config:export in this PR that changes the config sync directory? No

Front End Validation

Associated Issues and/or People

  • SUM-45

<span className={clsx("bg-black-true block transition-all duration-300 ease-out h-[3px] w-full rounded-sm", {"-rotate-45 -translate-y-4": menuOpen, "translate-y-0.5": !menuOpen})}/>
<span
className={clsx(
"bg-black-true block transition-all duration-300 ease-out h-[3px] w-full rounded-sm",
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason we use h-[3px] instead of just h-3 here? Also, I see that we have a mix of rem and px units (eg, line 72, line 225 etc - I'm totally fine with border width or border radius be px but with width/height/font sizes, perhaps it's better we go with rem? 👀 I understand there might be exceptions.

@rebeccahongsf
Copy link
Contributor Author

rebeccahongsf commented Apr 25, 2024

@pookmish I see that SUM-175 was complete 😃 I'll circle back and add in the buttons to this PR tomorrow morning!

src/components/config-pages/header-buttons.tsx Outdated Show resolved Hide resolved
src/components/config-pages/header-buttons.tsx Outdated Show resolved Hide resolved
src/components/config-pages/header-buttons.tsx Outdated Show resolved Hide resolved
src/components/menu/main-menu.tsx Outdated Show resolved Hide resolved
src/components/menu/main-menu.tsx Outdated Show resolved Hide resolved
src/components/menu/main-menu.tsx Outdated Show resolved Hide resolved
src/components/menu/main-menu.tsx Show resolved Hide resolved
@@ -43,7 +43,7 @@ export const Lockup = ({

if (!suLockupEnabled) {
return (
<div className="py-10">
<div>
Copy link
Contributor

Choose a reason for hiding this comment

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

we probably don't need the div here. Less markup is often a good way to go. But if we do need it, totally fine. I've seen some videos that suggest to remove elements if there's no attributes, or use fragments: <>

}: Props) => {
return (
<>
{sumSiteHeaderPrim && <Button href={sumSiteHeaderPrim.url} secondary>{sumSiteHeaderPrim.title}</Button>}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the secondary button have the secondary styles?

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 would think so too but the figma mocks display it like so
image

Copy link
Contributor

Choose a reason for hiding this comment

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

We can just switch them around, make the "Primary" from Drupal be the right button. "Secondary" be the left. So it'll still work with the designs, just swapped order basically.

Copy link
Contributor Author

@rebeccahongsf rebeccahongsf May 1, 2024

Choose a reason for hiding this comment

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

My concern is around the readability and assumption our content authors will make (e.g. assuming the buttons will appear left to right, header primary then secondary button regardless of styles).

If we are going to swap the orders, should we include help text around the styling of the button link? Or will the headings (e.g. Header Primary Button) be enough to inform the content authors? 😄
image

Copy link
Contributor

Choose a reason for hiding this comment

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

That's ok, we can add some help text. It'll be better to keep the "Primary" link with the "Primary" styles IMO.

src/components/menu/main-menu.tsx Show resolved Hide resolved
… main menu; remove unnecessary div in lockup; fixup formatting; remove unnecessary group-focus; add mobile chevron underline

const menuLevelsToShow = 2;

type Props = {
type Props =
Omit<StanfordBasicSiteSetting, "__typename" | "id" | "metatag"> & {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just define and pass the 2 fields instead of the whole thing. Especially since this is a "use client" component, we want to only pass the most minimal data needed to work.

@rebeccahongsf rebeccahongsf requested a review from pookmish May 2, 2024 15:41
src/components/menu/main-menu.tsx Outdated Show resolved Hide resolved
src/components/global/page-header.tsx Outdated Show resolved Hide resolved
@rebeccahongsf rebeccahongsf requested a review from pookmish May 6, 2024 20:39
Copy link
Contributor

@pookmish pookmish 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

@pookmish pookmish merged commit 94c2f84 into 1.x May 6, 2024
1 check passed
@pookmish pookmish deleted the feature/SUM-45--header branch May 6, 2024 20:43
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