mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 04:41:06 +08:00
Merge pull request #20818 from magicismight/patch-1
fix: outline initial state
This commit is contained in:
commit
716eeef7f1
@ -7,7 +7,7 @@ export const OutlineSelector = memo(function OutlineSelector() {
|
|||||||
const [globals, updateGlobals] = useGlobals();
|
const [globals, updateGlobals] = useGlobals();
|
||||||
const api = useStorybookApi();
|
const api = useStorybookApi();
|
||||||
|
|
||||||
const isActive = globals[PARAM_KEY] || false;
|
const isActive = [true, 'true'].includes(globals[PARAM_KEY]);
|
||||||
|
|
||||||
const toggleOutline = useCallback(
|
const toggleOutline = useCallback(
|
||||||
() =>
|
() =>
|
||||||
|
@ -7,7 +7,7 @@ import outlineCSS from './outlineCSS';
|
|||||||
|
|
||||||
export const withOutline = (StoryFn: StoryFunction<Renderer>, context: StoryContext<Renderer>) => {
|
export const withOutline = (StoryFn: StoryFunction<Renderer>, context: StoryContext<Renderer>) => {
|
||||||
const { globals } = context;
|
const { globals } = context;
|
||||||
const isActive = globals[PARAM_KEY] === true;
|
const isActive = [true, 'true'].includes(globals[PARAM_KEY]);
|
||||||
const isInDocs = context.viewMode === 'docs';
|
const isInDocs = context.viewMode === 'docs';
|
||||||
|
|
||||||
const outlineStyles = useMemo(() => {
|
const outlineStyles = useMemo(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user