Skip to content

feat: new active rounds section in secondary navbar#2346

Merged
vacekj merged 5 commits into
mainfrom
2275-explorer-update-round-dropdown-menu-to-showcase-upcoming-rounds
Sep 18, 2023
Merged

feat: new active rounds section in secondary navbar#2346
vacekj merged 5 commits into
mainfrom
2275-explorer-update-round-dropdown-menu-to-showcase-upcoming-rounds

Conversation

@vacekj

@vacekj vacekj commented Sep 15, 2023

Copy link
Copy Markdown

fixes #2275

@vacekj
vacekj requested review from a team as code owners September 15, 2023 13:56
@vacekj vacekj linked an issue Sep 15, 2023 that may be closed by this pull request
2 tasks
@vercel

vercel Bot commented Sep 15, 2023

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
builder ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2023 0:18am
explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2023 0:18am
manager ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2023 0:18am

@gitstream-cm

gitstream-cm Bot commented Sep 15, 2023

Copy link
Copy Markdown

🥷 Code experts: bhargavaparoksham, thelostone-mc

vacekj, bhargavaparoksham have most 👩‍💻 activity in the files.
vacekj, bhargavaparoksham have most 🧠 knowledge in the files.

See details

packages/grant-explorer/src/features/common/Navbar.tsx

Activity based on git-commit:

vacekj bhargavaparoksham
SEP
AUG 7 additions & 11 deletions 28 additions & 26 deletions
JUL
JUN 18 additions & 4 deletions
MAY 22 additions & 2 deletions
APR

Knowledge based on git-blame:
bhargavaparoksham: 39%
vacekj: 22%

packages/grant-explorer/src/features/common/__tests__/Navbar.test.tsx

Activity based on git-commit:

vacekj bhargavaparoksham
SEP
AUG 57 additions & 33 deletions 1 additions & 12 deletions
JUL
JUN
MAY
APR 9 additions & 15 deletions

Knowledge based on git-blame:
vacekj: 74%
bhargavaparoksham: 2%

To learn more about /:\ gitStream - Visit our Docs

@gitstream-cm

gitstream-cm Bot commented Sep 15, 2023

Copy link
Copy Markdown

This PR is 43.43434343434344% new code.

boudra
boudra previously approved these changes Sep 15, 2023

@boudra boudra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remember to use git mv to rename or move files, it's really difficult to see the changes

@melissa-neira

Copy link
Copy Markdown
Contributor

@vacekj just want to call out that the button's background should be white and not gray, otherwise lgtm!

@michellema1208

Copy link
Copy Markdown
Contributor

+1 to Melissa's comment - otherwise lgtm as well!

@vacekj

vacekj commented Sep 18, 2023

Copy link
Copy Markdown
Author

@melissa-neira should the bg be white only when the dropdown is active? otherwise, according to figma, the bg of the button is background: var(--gitcoin-grey-50, #F3F3F5);

@melissa-neira

Copy link
Copy Markdown
Contributor

@vacekj the bg should always be white, my bad - updated the figma

@vacekj

vacekj commented Sep 18, 2023

Copy link
Copy Markdown
Author

@melissa-neira fixed

@vacekj
vacekj merged commit 907f1c7 into main Sep 18, 2023
@vacekj
vacekj deleted the 2275-explorer-update-round-dropdown-menu-to-showcase-upcoming-rounds branch September 18, 2023 13:50
Comment thread packages/grant-explorer/src/features/discovery/RoundsSubNav.tsx
];

export function RoundsSubNav(props: Props) {
const [open, setOpen] = useState(false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Personally I like to name this isOpen so it doesn't take reading any extra code to know that it's a boolean value rather than an action.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

true, will fix.

data-testid={`round-link-${round.id}`}
href="#"
onClick={(e: React.MouseEvent<HTMLAnchorElement>) => {
e.preventDefault();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What happens if this is not called?

Edit: nevermind, I see now that this is inside an <a/>. Can the <a/> maybe be dropped?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not the author of the choice, but I presume it's to preserve the a11y semanatics of this being a link? We can make it a button, but it isn't really a button - it's a link. I would be more for using React Router's Component to both preserve the original semantics and to make it work with react router.

case ChainId.FANTOM_MAINNET_CHAIN_ID:
return "/logos/fantom-logo.svg";
}
})()}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you use the ternary here, you avoid the odd-looking inline call and force yourself to make all outcomes explicit:

src={
  round.chainId === ChainId.ARBITRUM
      ? "/logos/arb-logo.svg"
      : round.chainId === ChainId.FANTOM_MAINNET_CHAIN_ID
      ? "/logos/fantom-logo.svg"
      : null;
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

True, I was indulging in a poor-man's Rust-like match expression, but agree that it's not that readable and a ternary is better. (wen https://github.com/tc39/proposal-pattern-matching)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explorer: update round dropdown menu to showcase upcoming rounds

6 participants