-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into jerel/dark-mode
- Loading branch information
Showing
46 changed files
with
716 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import cx from 'classnames'; | ||
import styles from './Button.module.scss'; | ||
|
||
const Button = ({ | ||
as: Component = 'button', | ||
children, | ||
className, | ||
variant, | ||
...props | ||
}) => ( | ||
<Component | ||
{...props} | ||
className={cx(className, styles.button, styles[variant])} | ||
> | ||
{children} | ||
</Component> | ||
); | ||
|
||
Button.VARIANT = { | ||
PLAIN: 'plain', | ||
PRIMARY: 'primary', | ||
NORMAL: 'normal', | ||
}; | ||
|
||
Button.propTypes = { | ||
as: PropTypes.elementType, | ||
children: PropTypes.node, | ||
className: PropTypes.string, | ||
type: PropTypes.oneOf(['button', 'submit', 'reset']), | ||
variant: PropTypes.oneOf(Object.values(Button.VARIANT)).isRequired, | ||
}; | ||
|
||
export default Button; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.button { | ||
display: inline-flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 0.5rem 1rem; | ||
font-size: 0.875rem; | ||
font-weight: 600; | ||
border-radius: 3px; | ||
font-family: var(--primary-font-family); | ||
line-height: 1; | ||
cursor: pointer; | ||
border-width: 1px; | ||
border-style: solid; | ||
} | ||
|
||
.primary { | ||
color: #fff; | ||
border-color: var(--color-brand-800); | ||
background-color: var(--color-brand-800); | ||
} | ||
|
||
.normal { | ||
color: var(--color-neutrals-800); | ||
border-color: var(--color-neutrals-100); | ||
background-color: var(--color-neutrals-100); | ||
} | ||
|
||
.plain { | ||
color: var(--color-brand-800); | ||
border-color: transparent; | ||
background-color: transparent; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import cx from 'classnames'; | ||
import Button from '../Button'; | ||
import styles from './GuideTile.module.scss'; | ||
import { Link } from 'gatsby'; | ||
|
||
const Button = ({ onClick, text }) => ( | ||
<button type="button" className={styles.button} onClick={onClick}> | ||
{text} | ||
</button> | ||
const GuideTileButton = ({ className, ...props }) => ( | ||
<Button | ||
as={Link} | ||
variant={Button.VARIANT.PRIMARY} | ||
className={cx(styles.button, className)} | ||
{...props} | ||
/> | ||
); | ||
|
||
Button.propTypes = { | ||
onClick: PropTypes.func.isRequired, | ||
text: PropTypes.string.isRequired, | ||
GuideTileButton.propTypes = { | ||
className: PropTypes.string, | ||
}; | ||
|
||
export default Button; | ||
export default GuideTileButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.