Refactor classname usage

This commit is contained in:
Gregory Schier
2023-02-21 18:03:57 -08:00
parent 3907344884
commit 7a6a337eff
4 changed files with 19 additions and 17 deletions

View File

@@ -81,12 +81,14 @@ function BaseStack({ className, items, justify, as = 'div', ...props }: BaseStac
const Component = as;
return (
<Component
className={classnames(className, 'flex flex-grow-0', {
'items-center': items === 'center',
'items-start': items === 'start',
'justify-start': justify === 'start',
'justify-end': justify === 'end',
})}
className={classnames(
className,
'flex flex-grow-0',
items === 'center' && 'items-center',
items === 'start' && 'items-start',
justify === 'start' && 'justify-start',
justify === 'end' && 'justify-end',
)}
{...props}
/>
);