This repository was archived by the owner on Dec 6, 2022. It is now read-only.
Replies: 1 comment
-
|
We propose discussing RFCs in pull requests rather than discussions. The proposal should be formatted as a markdown file in
As such, we are moving this discussion to PR #1428 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
DRAFT
<Header />API proposalThere is a plan to standardise headers across the Guardian's web platforms.
This proposal outlines an API that tries to capture the areas of standardisation while being as flexible as possible for end users.
Example
Component breakdown
<Header />Generic header component. The logo is hard-coded.
Example
<BrandBar />The area at the top of the header that houses features related to the brand and customisation, rather than content discovery. Examples include the support message, top level links, the Guardian logo and the Edition Switch.
The logo is hardcoded.
Example
<BrandBar.Links />A list of top-level links and menus that is displayed at the very top of the header.
<BrandBar.Link />A link that is displayed in the
BrandBar.Linkssection of the header, or within aBrandBar.LinkListdropdown.Props
hrefstringBrandBar.Linkis clickedonClickfunctionBrandBar.Linkis clickedlabelstringBrandBar.LinkiconReactNodefromBreakpointBrandBar.Linkbecomes visibleuntilBreakpointBrandBar.Linkis no longer displayed<BrandBar.LinkList />A dropdown menu that is displayed in the
BrandBar.Linkssection of the header.Props
labelstringBrandBar.LinkListiconReactNodefromBreakpointBrandBar.LinkListbecomes visibleuntilBreakpointBrandBar.LinkListis no longer displayed<Navigation />The top-level navigation bar.
Example
<Navigation.PrimaryLinks />The main visible navigational links
Example
<Navigation.PrimaryLink />A navigational link that appears in the
Navigation.PrimaryLinkscomponentExample
Props
hrefstringNavigation.PrimaryLinkis clickedlabelstringNavigation.PrimaryLinkcolorstringselectedboolean<Navigation.SecondaryLinks />An expanding menu that opens on click of the veggie burger icon, or the "more" link at wider breakpoints
Props
???
Example
<Navigation.SecondaryLinksGroup />A column of links within the
SecondaryLinkspanelProps
???
Example
<Navigation.SecondaryLink />A navigational link that appears in the
Navigation.SecondaryLinkscomponentProps
hrefstringNavigation.SecondaryLinkis clickedlabelstringNavigation.SecondaryLinkExample
<Navigation.SecondaryLinksSupplementalLink />A visually prominent navigational link that appears in the
Navigation.SecondaryLinkscomponent.Example
Props
hrefstringNavigation.SecondaryLinksSupplementalLinkis clickedlabelstringNavigation.SecondaryLinksSupplementalLinkSpecialised headers
<EditorialHeader isSignedIn showSubscriberMessage edition />A special header layout for editorial pages. The logo and supporter messages are hard-coded.
Differences to generic header
Brandbar
<SubscribeMessage />?Example
Props
isSignedInbooleanshowSubscriberMessagebooleaneditionstring'uk'|'au'|'us'|'international'<EditorialHeader.EditionSwitch />The Editions switch dropdown menu appears to the right of the logo in the Editorial Header. It allows the user to switch the default edition of the network front that is displayed when they visit theguardian.com.
Example
Props
onChangefunction<EditorialHeader.EditionSwitchItem />Represents a link to an Edition that appears in the Edition Switch dropdown menu.
Example
Props
hrefstring<EditorialHeader.EditionSwitchItem />onChangecode has executedlabelstringEditionSwitchItemselectedbooleanRisks and uncertainty
<EditorialHeader brandBar={<Island><BrandBar /></Island>} />Beta Was this translation helpful? Give feedback.
All reactions