fix(ui-components): default storybook background (#52094)

This commit is contained in:
Huyen Nguyen
2023-10-31 22:13:20 +07:00
committed by GitHub
parent 50ab555789
commit 2dd3712054

View File

@@ -11,6 +11,7 @@ export const parameters = {
}
},
backgrounds: {
default: 'light-palette',
values: [
{
name: 'light-palette',
@@ -36,8 +37,8 @@ function renderTheme(Story, context) {
bg => bg.value === selectedBackgroundValue
)?.name;
// There can be no background selected, prevent "undefined" className
const className = selectedBackgroundName || '';
// Use the value of the default background to prevent "undefined" className
const className = selectedBackgroundName || parameters.backgrounds.default;
return (
<div className={className}>