-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add VA Design System Storybook link for mobile components #3810
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
{% assign storybook_path = site.storybook_path %} | ||
{% if include.base_path %} | ||
{% assign storybook_path = include.base_path %} | ||
{% endif %} | ||
{% if include.is_mobile %}{% assign storybook_path = site.storybook_mobile_path %}{% endif %} | ||
{% assign storybook_iframe_path = storybook_path | append: '/iframe.html?id=' | append: include.story | append: '&viewMode=story' %} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The main difference here between the web and mobile component iframe preview is the base link which will be from either These root URLs are not clickable or displayed visually in the documentation. They are only used to load the component in the iframe. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. We eventually want https://department-of-veterans-affairs.github.io/va-mobile-library/ to go away and be rolled into design.va.gov. What do we need to do to not be dependent on the deployed github mobile "design system"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@humancompanion-usds I am working on a discovery for that now! :) I see this approach as a bridge until a full integration can be done. There are a few different ways we can do it that look promising. |
||
<div | ||
class="site-showcase" | ||
style="max-width: {{ include.width | default: '100%' }}" | ||
> | ||
<iframe | ||
width="100%" | ||
height="{{ include.height }}" | ||
src="{{ storybook_path }}/iframe.html?id={{ include.story }}&viewMode=story" | ||
src="{{ storybook_iframe_path }}" | ||
></iframe> | ||
</div> | ||
|
||
[{% if include.link_text %}<img aria-hidden="true" role="img" src="{{ site.baseurl }}/images/storybook.svg" class="site-component-resources-links__icon" width="16px" alt="Storybook logo">View {{ include.link_text}}{% else %}See this{% endif %} in Storybook]({{ storybook_path }}/?path=/docs/{{ include.story }}) | ||
{% assign story_name_prefix = '' %} | ||
{% if include.is_mobile %}{% assign story_name_prefix = 'va-mobile_' %}{% endif %} | ||
{% assign storybook_preview_path = site.storybook_path | append: '/?path=/story/' | append: story_name_prefix | append: include.story %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The condition here is to add the |
||
|
||
[{% if include.link_text %}<img aria-hidden="true" role="img" src="{{ site.baseurl }}/images/storybook.svg" class="site-component-resources-links__icon" width="16px" alt="Storybook logo">View {{ include.link_text}}{% else %}See this{% endif %} in Storybook]({{ storybook_preview_path }}) |
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.
When a component is flagged as
is_mobile=true
like this, iframe preview and Storybook documentation links will automatically adjust depending on the component type in thestorybook-preview.html
file. In both cases, the Storybook link will bring the user to the design.va.gov Storybook instance.