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

Create MetaBar Component #6008

Closed
bmuenzenmeyer opened this issue Oct 15, 2023 · 8 comments · Fixed by #6010
Closed

Create MetaBar Component #6008

bmuenzenmeyer opened this issue Oct 15, 2023 · 8 comments · Fixed by #6010
Labels
good first issue Issues for newcomers hacktoberfest This Issue is meant for Hacktoberfest 2023 help wanted website redesign Issue/PR part of the Node.js Website Redesign

Comments

@bmuenzenmeyer
Copy link
Collaborator

bmuenzenmeyer commented Oct 15, 2023

Create a MetaBar component using the new figma design (direct link to).

This component is a sidebar that will display on most content/markdown pages. It displays metadata about the content

Read more about the Node.js Website redesign


Before You Start...


Details

image

Not sure where to start breaking down the figma? Read this short guide
🌐 This story requires some internationalization support. Slow down!

Suggested Props

Only display these values on the Metabar if provided

Name type comments label
lastUpdate Date format per Figma Last Updated (internationalized as components.metabar.lastUpdated)
readingTime string Reading Time (internationalized as components.metabar.readingTime)
addedInVersion string Added In (internationalized as components.metabar.addedIn)
author string Author (internationalized as components.metabar.author)
authors Object[] Object array capable of rendering AvatarGroup Authors (internationalized as components.metabar.authors)
sourceURL string or typeof Next Link Contribute (internationalized as components.metabar.contribute)
viewAsURL string or typeof Next Link Render the code-bracket link if the viewAsURL is provided View as (internationalized as components.metabar.viewAs)
toc object[] Nested list of links that could mimic a markdown heading hierarchy. See below commentary. Table of Contents (internationalized as components.metabar.tableOfContents)

Storybook

Add a storybook story file components/Common/MetaBar/index.stories.tsx which exercises each of the component's states.

There are 2 states to capture within styles and stories:

  • Light Mode
  • Dark Mode

Open and Future Questions

the toc prop needs to be supplied by static or dynamic analysis of the content it is rendering. I have seen this work a couple ways, but suggest it's out of scope for this simple story and want to omit it. A future layout or provider needs to supply this data.

For this initial work, let's make a best effort to render a nested hierarchy of headings as an unordered list.

@bmuenzenmeyer bmuenzenmeyer added help wanted good first issue Issues for newcomers website redesign Issue/PR part of the Node.js Website Redesign hacktoberfest This Issue is meant for Hacktoberfest 2023 labels Oct 15, 2023
@bmuenzenmeyer
Copy link
Collaborator Author

@ovflowd would love an opinion on the toc prop - i think it's out of scope for this simple component, but makes for harder work in the future

@bmuenzenmeyer bmuenzenmeyer moved this to 🔖 Ready in Website Redesign Oct 15, 2023
@ovflowd
Copy link
Member

ovflowd commented Oct 15, 2023

@ovflowd would love an opinion on the toc prop - i think it's out of scope for this simple component, but makes for harder work in the future

Shouldn't we start with the ToC component first?

@ovflowd
Copy link
Member

ovflowd commented Oct 15, 2023

But to answer your question, afaik the ToC comes directly from Remark, there's already a defined data structure, defined here: https://github.com/nodejs/nodejs.org/blob/main/types/dynamic.ts#L8

This is the type of the ToC that is automatically inferred from Markdown files and available here https://github.com/nodejs/nodejs.org/blob/main/theme.tsx#L15

So I assume that's what the toc prop should accept? And I think we should call it "headings" instead of ToC just for consistency between files.

@adeyinkaezra123
Copy link

Hello, I'd love to pick this up

@bmuenzenmeyer

This comment was marked as resolved.

@ovflowd

This comment was marked as resolved.

@bmuenzenmeyer

This comment was marked as resolved.

@bmuenzenmeyer
Copy link
Collaborator Author

Shouldn't we start with the ToC component first?

We can break it out into a separate component, sure

@bmuenzenmeyer bmuenzenmeyer moved this from 🔖 Ready to 👀 In review in Website Redesign Oct 17, 2023
@bmuenzenmeyer bmuenzenmeyer moved this from 👀 In review to ✅ Done in Website Redesign Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues for newcomers hacktoberfest This Issue is meant for Hacktoberfest 2023 help wanted website redesign Issue/PR part of the Node.js Website Redesign
Projects
Status: Done
3 participants