019b22caa1
refs https://github.com/TryGhost/Team/issues/1310 - we had a `<GhBrowserPreview>` component but it wasn't being used everywhere because it's behaviour didn't match the mobile/desktop switch with no iframe re-render that we needed for some screens - updated component to match all required behaviour - include a switch between desktop and mobile views - default fallbacks for `@title` and `@icon` arguments - switched design settings themes over to using the component instead of repeating the same set of markup
24 lines
1.4 KiB
Handlebars
24 lines
1.4 KiB
Handlebars
<section class="gh-canvas gh-theme-preview flex flex-column h-100">
|
|
<GhCanvasHeader class="gh-canvas-header">
|
|
<h2 class="gh-canvas-title" data-test-screen-title>
|
|
<LinkTo @route="settings.design.change-theme" data-test-link="back">Themes</LinkTo>
|
|
<span>{{svg-jar "arrow-right"}}</span>
|
|
{{@data.theme.name}}
|
|
</h2>
|
|
|
|
<section class="view-actions">
|
|
<div class="gh-contentfilter gh-btn-group">
|
|
<button type="button" class="gh-btn gh-design-preview-mode {{if this.isDesktopPreview "gh-btn-group-selected"}}" {{on "click" (fn this.setPreviewSize "desktop")}}><span>{{svg-jar "desktop"}}</span></button>
|
|
<button type="button" class="gh-btn gh-design-preview-mode {{if this.isMobilePreview "gh-btn-group-selected"}}" {{on "click" (fn this.setPreviewSize "mobile")}}><span>{{svg-jar "mobile-phone"}}</span></button>
|
|
</div>
|
|
|
|
<button type="button" class="gh-btn gh-btn-primary" {{on "click" this.installTheme}} data-test-button="install-theme"><span>Use {{@data.theme.name}}</span></button>
|
|
</section>
|
|
</GhCanvasHeader>
|
|
|
|
<section class="view-container">
|
|
<GhBrowserPreview @isMobilePreview={{this.isMobilePreview}}>
|
|
<iframe class={{if this.isMobilePreview "gh-post-preview-iframe" "site-frame"}} src={{@data.theme.previewUrl}} title="{{@data.theme.name}} theme preview" />
|
|
</GhBrowserPreview>
|
|
</section>
|
|
</section> |