-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Comments
@ovflowd would love an opinion on the |
Shouldn't we start with the ToC component first? |
But to answer your question, afaik the ToC comes directly from 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 |
Hello, I'd love to pick this up |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
We can break it out into a separate component, sure |
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
Before You Start...
Details
❓ Not sure where to start breaking down the figma? Read this short guide
🌐 This story requires some internationalization support. Slow down!
MetaBar
within theCommon
directory that contains all the new code.AvatarGroup
component introduced within feat(avatarGroup): introduce #5916@heroicons/react
module has the iconcode-bracket
available for use.social-github.svg
should be used for theEdit this page
iconSuggested Props
Only display these values on the
Metabar
if providedlastUpdate
Date
Last Updated
(internationalized ascomponents.metabar.lastUpdated
)readingTime
string
Reading Time
(internationalized ascomponents.metabar.readingTime
)addedInVersion
string
Added In
(internationalized ascomponents.metabar.addedIn
)author
string
Author
(internationalized ascomponents.metabar.author
)authors
Object[]
AvatarGroup
Authors
(internationalized ascomponents.metabar.authors
)sourceURL
string
or typeofNext Link
Contribute
(internationalized ascomponents.metabar.contribute
)viewAsURL
string
or typeofNext Link
code-bracket
link if theviewAsURL
is providedView as
(internationalized ascomponents.metabar.viewAs
)toc
object[]
Table of Contents
(internationalized ascomponents.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:
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.
The text was updated successfully, but these errors were encountered: