mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-30 16:01:14 -04:00
fix(ui-components): default storybook background (#52094)
This commit is contained in:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user