MCPcopy Create free account
hub / github.com/adobe/react-spectrum / SubpageHeader

Function SubpageHeader

packages/dev/s2-docs/src/typography.tsx:245–279  ·  view source on GitHub ↗
({currentPage, parentPage, isLongForm}: SubpageHeaderProps)

Source from the content-addressed store, hash-verified

243}
244
245export function SubpageHeader({currentPage, parentPage, isLongForm}: SubpageHeaderProps) {
246 return (
247 <div
248 className={style({
249 display: 'flex',
250 flexDirection: 'column',
251 gap: 4,
252 maxWidth: '--text-width',
253 marginX: 'auto',
254 marginBottom: 40
255 })}>
256 <div className={style({display: 'flex', alignItems: 'center', gap: 2})}>
257 <TitleLink href={parentPage?.url}>
258 {parentPage?.exports?.title ??
259 parentPage?.tableOfContents?.[0]?.title ??
260 parentPage?.name}
261 </TitleLink>
262 <ChevronRightIcon styles={iconStyle({size: 'XS'})} />
263 </div>
264 <H1 itemProp="headline" isLongForm={isLongForm}>
265 {currentPage.tableOfContents?.[0].title}
266 </H1>
267 {currentPage.exports?.author && (
268 <Byline
269 author={currentPage.exports.author}
270 authorLink={currentPage.exports.authorLink}
271 date={currentPage.exports.date}
272 />
273 )}
274 {currentPage.exports?.date && !currentPage.exports?.author && (
275 <Time date={currentPage.exports.date} />
276 )}
277 </div>
278 );
279}
280
281export function Byline({
282 author,

Callers

nothing calls this directly

Calls 1

iconStyleFunction · 0.90

Tested by

no test coverage detected