You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
724 B
24 lines
724 B
2 years ago
|
// Decide what the button will look like based on its type (primary or secondary)
|
||
|
// and on its background (light or dark).
|
||
|
export function getButtonAppearance(type, background) {
|
||
|
if (type === 'primary') {
|
||
|
if (background === 'light') {
|
||
|
// Dark primary button on a light background
|
||
|
return 'dark'
|
||
|
}
|
||
|
// Fully white primary button on a dark background
|
||
|
return 'white'
|
||
|
}
|
||
|
if (type === 'secondary') {
|
||
|
if (background === 'light') {
|
||
|
// Dark outline primary button on a light background
|
||
|
return 'dark-outline'
|
||
|
}
|
||
|
// White outline primary button on a dark background
|
||
|
return 'white-outline'
|
||
|
}
|
||
|
|
||
|
// Shouldn't happen, but default to dark button just in case
|
||
|
return 'dark'
|
||
|
}
|