Skip to content

Commit

Permalink
chore: styles object
Browse files Browse the repository at this point in the history
  • Loading branch information
SevereCloud committed Jul 26, 2023
1 parent 25d8fb3 commit 7704c83
Showing 1 changed file with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ import { Caption } from '../Typography/Caption/Caption';
import { Subhead } from '../Typography/Subhead/Subhead';
import styles from './SubnavigationButton.module.css';

const appearanceStyles = {
accent: styles['SubnavigationButton--appearance-accent'],
neutral: styles['SubnavigationButton--appearance-neutral'],
};

const modeStyles = {
primary: styles['SubnavigationButton--mode-primary'],
outline: styles['SubnavigationButton--mode-outline'],
tertiary: styles['SubnavigationButton--mode-tertiary'],
};

const sizeStyles = {
s: styles['SubnavigationButton--size-s'],
m: styles['SubnavigationButton--size-m'],
l: styles['SubnavigationButton--size-l'],
};

const sizeYClassNames = {
none: styles['SubnavigationButton--sizeY-none'],
[SizeType.COMPACT]: styles['SubnavigationButton--sizeY-compact'],
Expand Down Expand Up @@ -77,20 +94,9 @@ export const SubnavigationButton = ({
focusVisibleMode="outside"
className={classNames(
styles['SubnavigationButton'],
{
s: styles['SubnavigationButton--size-s'],
m: styles['SubnavigationButton--size-m'],
l: styles['SubnavigationButton--size-l'],
}[size],
{
primary: styles['SubnavigationButton--mode-primary'],
outline: styles['SubnavigationButton--mode-outline'],
tertiary: styles['SubnavigationButton--mode-tertiary'],
}[mode],
{
accent: styles['SubnavigationButton--appearance-accent'],
neutral: styles['SubnavigationButton--appearance-neutral'],
}[appearance],
sizeStyles[size],
modeStyles[mode],
appearanceStyles[appearance],
selected && styles['SubnavigationButton--selected'],
sizeY !== SizeType.REGULAR && sizeYClassNames[sizeY],
className,
Expand Down

0 comments on commit 7704c83

Please sign in to comment.