-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
* convert Pill to TS & add icon prop * add typographyInverted * [WILL REVERT] use my styles branch * add alt type styles * rename type to pillStyle * make class name more readable * build * convert PageHeader to TS; add showTopMargin prop * Add TypeScript types * make border and showPadding optional for PageHeader * Add TypeScript types * rename pillStyle options * Add TypeScript types * bump styles version * Add TypeScript types Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,72 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Tagline from '../Tagline/Tagline'; | ||
import styles from './PageHeader.scss'; | ||
|
||
const PageHeader = ( { | ||
border, | ||
children, | ||
intro, | ||
showPadding, | ||
tagline, | ||
title, | ||
} ) => ( | ||
<div className={`${styles.container} ${border ? styles.border : ''} ${showPadding ? styles.showPadding : ''}`}> | ||
<div className={styles.contents}> | ||
<h1 className={styles.title}>{title}</h1> | ||
{ | ||
tagline && | ||
<div className={styles.tagline}> | ||
<Tagline>{tagline}</Tagline> | ||
</div> | ||
} | ||
{ | ||
intro && | ||
<p className={styles.intro}>{intro}</p> | ||
} | ||
</div> | ||
{ | ||
children && | ||
<div className={styles.children}>{children}</div> | ||
} | ||
</div> | ||
); | ||
|
||
PageHeader.propTypes = { | ||
type PageHeaderProps = { | ||
/** | ||
* Boolean to determine whether or not the component renders with a bottom border. | ||
*/ | ||
border: PropTypes.bool.isRequired, | ||
border?: boolean, | ||
|
||
/** | ||
* Child node to be rendered as the inner HTML of the component. | ||
*/ | ||
children: PropTypes.node, | ||
children?: React.ReactNode, | ||
|
||
/** | ||
* Smaller-print text used for the page subheader (renders in `<p>` tag). | ||
*/ | ||
intro: PropTypes.node, | ||
intro?: React.ReactNode, | ||
|
||
/** | ||
* Boolean to determine whether to add padding to the header before the bottom border. | ||
*/ | ||
showPadding: PropTypes.bool.isRequired, | ||
showPadding?: boolean, | ||
|
||
/** | ||
* Boolean to determine whether to add a top margin to the header. | ||
*/ | ||
showTopMargin?: boolean, | ||
|
||
/** | ||
* Very small-print text used directly below the title (e.g., as a dateline). | ||
*/ | ||
tagline: PropTypes.node, | ||
tagline?: React.ReactNode, | ||
|
||
/** | ||
* Required text for the h1 tag. | ||
*/ | ||
title: PropTypes.string.isRequired, | ||
title: string, | ||
}; | ||
|
||
PageHeader.defaultProps = { | ||
border: true, | ||
showPadding: true, | ||
}; | ||
const PageHeader = ( { | ||
border = true, | ||
children, | ||
intro, | ||
showPadding = true, | ||
showTopMargin = true, | ||
tagline, | ||
title, | ||
}: PageHeaderProps ) => ( | ||
<div className={`${styles.container} ${border ? styles.border : ''} ${showPadding ? styles.showPadding : ''} ${showTopMargin ? styles.showTopMargin : ''}`}> | ||
<div className={styles.contents}> | ||
<h1 className={styles.title}>{title}</h1> | ||
{ | ||
tagline && | ||
<div className={styles.tagline}> | ||
<Tagline>{tagline}</Tagline> | ||
</div> | ||
} | ||
{ | ||
intro && | ||
<p className={styles.intro}>{intro}</p> | ||
} | ||
</div> | ||
{ | ||
children && | ||
<div className={styles.children}>{children}</div> | ||
} | ||
</div> | ||
); | ||
|
||
export default PageHeader; |
This file was deleted.