Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix useEffect() in sky nav #1918

Merged
merged 3 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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