diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 7d0b9d0547..603fa88b09 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -43,6 +43,7 @@ const INITIAL_FRONTEND_STATE = { deviceAwareness: false, state: false, customThemes: false, + devicePreview: false, }, currentFrontEndType: "none", selectedScreenId: "", @@ -56,6 +57,7 @@ const INITIAL_FRONTEND_STATE = { clientLibPath: "", theme: "", customTheme: {}, + previewDevice: "desktop", } export const getFrontendStore = () => { @@ -230,6 +232,12 @@ export const getFrontendStore = () => { await store.actions.layouts.save(selectedAsset) } }, + setDevice: device => { + store.update(state => { + state.previewDevice = device + return state + }) + }, }, layouts: { select: layoutId => { diff --git a/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte b/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte index 9893b07404..a968effaf5 100644 --- a/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte +++ b/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte @@ -83,10 +83,11 @@ justify-content: flex-start; align-items: center; flex-wrap: wrap; - margin-top: -10px; } .components :global(> *) { - margin-top: 10px; + height: 32px; + display: grid; + place-items: center; } .buttonContent { diff --git a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte index 85fb086b59..494050f690 100644 --- a/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte +++ b/packages/builder/src/components/design/AppPreview/CurrentItemPreview.svelte @@ -50,6 +50,7 @@ previewType: $store.currentFrontEndType, theme: $store.theme, customTheme: $store.customTheme, + previewDevice: $store.previewDevice, } // Saving pages and screens to the DB causes them to have _revs. @@ -140,11 +141,12 @@ {/if}