-
Notifications
You must be signed in to change notification settings - Fork 2
Add Lookbook #205
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 Lookbook #205
Changes from 7 commits
82f88b9
bacc742
6d6c812
26d5dd2
a670f3a
f939239
01db00d
15e9ab7
c97ffb5
1ed06bc
ed16bf7
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 |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| class BreadcrumbsPreview < Lookbook::Preview | ||
| layout "component_preview" | ||
|
|
||
| def default | ||
| render template: "application/_breadcrumbs", locals: { crumbs: [ | ||
| { name: "Passport applications", url: "https://google.com" }, | ||
| ], current_name: "New passport application" } | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,12 +29,12 @@ | |
| <% end %> | ||
|
|
||
| <li class="usa-nav__primary-item"> | ||
| <%= render partial: "language-toggle", locals: { container_class: "display-block desktop:display-none relative" } %> | ||
| <%= render partial: "application/language-toggle", locals: { container_class: "display-block desktop:display-none relative" } %> | ||
|
Collaborator
Author
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. We need to explicitly set partial paths rather than rely on Rails fallback behavior. This is probably better practice anyways, easier to read/find things for the reader |
||
| </li> | ||
| </ul> | ||
| </div> | ||
| </nav> | ||
|
|
||
| <%= render partial: "language-toggle", locals: { container_class: "usa-language-container display-none desktop:display-block" } %> | ||
| <%= render partial: "application/language-toggle", locals: { container_class: "usa-language-container display-none desktop:display-block" } %> | ||
| </div> | ||
| </header> | ||
| </header> | ||
|
Collaborator
Author
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. Mostly a copy of application.html.erb except without the application header/footer |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <%# Top-level layout for all pages in the application %> | ||
| <!DOCTYPE html> | ||
| <html lang="<%= I18n.locale %>"> | ||
| <head> | ||
| <title> | ||
| <%= content_for?(:title) ? "#{ yield(:title) } | #{ t('header.title') }" : t("header.title") %> | ||
| </title> | ||
| <meta name="viewport" content="width=device-width,initial-scale=1"> | ||
| <%= csrf_meta_tags %> | ||
| <%= csp_meta_tag %> | ||
|
|
||
| <%= favicon_link_tag asset_path('@uswds/uswds/dist/img/us_flag_small.png') %> | ||
|
|
||
| <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> | ||
| <%= yield :head %> | ||
|
|
||
| <%= javascript_importmap_tags %> | ||
| <%= javascript_include_tag '@uswds/uswds/dist/js/uswds-init.min.js' %> | ||
| </head> | ||
|
|
||
| <body> | ||
| <div class="display-flex flex-column minh-viewport"> | ||
| <main id="main-content" class="grid-col-fill display-flex flex-column"> | ||
| <div class="grid-col-fill <%= yield :main_col_class %>"> | ||
| <div class="grid-container"> | ||
| <%= content_for?(:content) ? yield(:content) : yield %> | ||
| </div> | ||
| </div> | ||
| </main> | ||
| </div> | ||
|
|
||
| <%= javascript_include_tag '@uswds/uswds/dist/js/uswds.min.js' %> | ||
| <%= yield :scripts %> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Rails.application.configure do | ||
| config.lookbook.preview_paths = [Rails.root.join("app", "previews"),] | ||
| end |
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.
render partial: "application/breadcrumbs"not supported by lookbook so userender template:and remember to prefix with _ and set layout to "component_preview" to get rid of application layout