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

Creates a path for mobile examples. [Amends #2391] #3697

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,6 @@ exclude:

# Default for building locally.
# See configuration files in jekyll-configs/ for environment overrides.
storybook_path: "http://127.0.0.1:6006"
storybook_path: "http://localhost:6006"
storybook_prod_uswds_path: "https://design.va.gov/storybook/?path=/docs/uswds"
storybook_mobile_path: "https://department-of-veterans-affairs.github.io/va-mobile-library"
6 changes: 3 additions & 3 deletions src/_components/button/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ anchors:

#### Base - Primary

{% include storybook-preview.html height="100px" story="va-mobile_button--base" link_text="va-mobile__button--base" %}
{% include storybook-preview.html height="100px" story="button--base" base_path=site.storybook_mobile_path link_text="va-mobile__button--base" %}

#### Base - Secondary

{% include storybook-preview.html height="100px" story="va-mobile_button--base-secondary" link_text="va-mobile__button--base-secondary" %}
{% include storybook-preview.html height="100px" story="button--base-secondary" base_path=site.storybook_mobile_path link_text="va-mobile__button--base-secondary" %}

#### Destructive

{% include storybook-preview.html height="100px" story="va-mobile_button--destructive" link_text="va-mobile__button--base-secondary" %}
{% include storybook-preview.html height="100px" story="button--destructive" base_path=site.storybook_mobile_path link_text="va-mobile__button--destructive" %}

## Usage

Expand Down
8 changes: 6 additions & 2 deletions src/_includes/storybook-preview.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{% assign storybook_path = site.storybook_path %}
{% if include.base_path %}
{% assign storybook_path = include.base_path %}
{% endif %}
<div
class="site-showcase"
style="max-width: {{ include.width | default: '100%' }}"
>
<iframe
width="100%"
height="{{ include.height }}"
src="{{ site.storybook_path }}/iframe.html?id={{ include.story }}&viewMode=story"
src="{{ storybook_path }}/iframe.html?id={{ include.story }}&amp;viewMode=story"
></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]({{ site.storybook_path }}/?path=/docs/{{ include.story }})
[{% 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 }})
Loading