-
Notifications
You must be signed in to change notification settings - Fork 14
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
chore(documentation-v7): migrate the internet header component stories #1822
chore(documentation-v7): migrate the internet header component stories #1822
Conversation
…tories # Conflicts: # packages/documentation-v7/public/assets/config/test-configuration.json
|
Preview environment ready: https://preview-1822--swisspost-design-system-next-v7.netlify.app |
Preview environment ready: https://preview-1822--swisspost-design-system-next-v7.netlify.app |
<Canvas of={InternetHeaderStories.Default} /> | ||
|
||
<div className="hide-col-default"> | ||
<ArgTypes of={InternetHeaderStories.Default} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used ArgTypes
instead of Controls
here because currently controls don't work on iframe demos, but an iframe is needed for the logo animation to work properly.
packages/documentation-v7/src/stories/internet-header/migration-guide.docs.mdx
Outdated
Show resolved
Hide resolved
packages/documentation-v7/src/stories/internet-header/migration-guide.docs.mdx
Outdated
Show resolved
Hide resolved
packages/documentation-v7/src/stories/internet-header/migration-guide.docs.mdx
Outdated
Show resolved
Hide resolved
packages/documentation-v7/src/stories/internet-header/migration-guide.docs.mdx
Outdated
Show resolved
Hide resolved
packages/documentation-v7/src/stories/internet-header/migration-guide.docs.mdx
Outdated
Show resolved
Hide resolved
packages/documentation-v7/src/stories/internet-header/migration-guide.docs.mdx
Show resolved
Hide resolved
packages/documentation-v7/src/stories/internet-header/getting-started.docs.mdx
Show resolved
Hide resolved
// TODO: move to utils | ||
const getAttributes = (args: Args, condition?: (arg: any) => boolean): Args => { | ||
const attrs: { [key: string]: any } = {}; | ||
|
||
for (const key in args) { | ||
if (args.hasOwnProperty(key) && condition && condition(args[key])) { | ||
const attrKey = key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); | ||
|
||
// Cast boolean false to string so it's displayed in the docs code block. False values are otherwise omitted | ||
attrs[attrKey] = args[key] === false ? 'false' : args[key]; | ||
if (typeof args[key] === 'object') { | ||
attrs[attrKey] = JSON.stringify(args[key]); | ||
} | ||
} | ||
} | ||
|
||
return attrs; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the move can be part of this PR
@@ -55,7 +46,6 @@ const preview: Preview = { | |||
}, | |||
components: resetComponents, | |||
extractArgTypes, | |||
extractComponentDescription, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this line is correct or not or if you need to remove the import
…n-guide.docs.mdx Co-authored-by: Loïc Fürhoff <[email protected]>
…n-guide.docs.mdx Co-authored-by: Loïc Fürhoff <[email protected]>
…n-guide.docs.mdx Co-authored-by: Loïc Fürhoff <[email protected]>
…n-guide.docs.mdx Co-authored-by: Loïc Fürhoff <[email protected]>
…n-guide.docs.mdx Co-authored-by: Loïc Fürhoff <[email protected]>
Please retry analysis of this Pull-Request directly on SonarCloud. |
Created tickets for all open points |
No description provided.