Skip to content

Commit

Permalink
Fix useEffect() in sky nav (#1918)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebeby authored Jul 7, 2022
1 parent 4e8ef04 commit da3c096
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 1,656 deletions.
37 changes: 16 additions & 21 deletions src/components/sky-nav/sky-nav.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ embedded examples.
<Meta
title="Components/Sky Nav"
parameters={{ docs: { inlineStories: false } }}
decorators={[
(story) => {
useEffect(() => {
const { destroy } = initSkyNav(
document.querySelector('.js-sky-nav-menu-toggle')
);
return destroy;
}, []);
return story();
},
]}
/>

# Sky Nav
Expand Down Expand Up @@ -48,18 +59,10 @@ The Sky Nav is intended for use with our [our dark theme](/docs/design-themes--d
},
}}
>
{() => {
useEffect(() => {
const { destroy } = initSkyNav(
document.querySelector('.js-sky-nav-menu-toggle')
);
return destroy;
}, []);
return template({
class: 't-dark',
...basicStoryArgs,
});
}}
{template({
class: 't-dark',
...basicStoryArgs,
})}
</Story>
</Canvas>

Expand All @@ -82,15 +85,7 @@ But it works without a theme, too, just in case:
},
}}
>
{() => {
useEffect(() => {
const { destroy } = initSkyNav(
document.querySelector('.js-sky-nav-menu-toggle')
);
return destroy;
}, []);
return template(basicStoryArgs);
}}
{template(basicStoryArgs)}
</Story>
</Canvas>

Expand Down
293 changes: 0 additions & 293 deletions src/prototypes/single-article/example/example.twig

This file was deleted.

43 changes: 0 additions & 43 deletions src/prototypes/single-article/single-article.stories.js

This file was deleted.

Loading

0 comments on commit da3c096

Please sign in to comment.