From 4575285d5fb74ba172078501785bc83fa42366a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Tue, 2 Mar 2021 13:37:54 +0100 Subject: [PATCH] fixes to transitions and adds default fade to screens --- .../design/NavigationPanel/NewScreenModal.svelte | 8 +------- .../components/design/PropertiesPanel/DesignView.svelte | 9 +++++---- packages/client/src/utils/transition.js | 6 +++--- packages/server/src/constants/screens.js | 2 ++ 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte index c33d12c1a1..b924aa4b32 100644 --- a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte +++ b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte @@ -1,11 +1,8 @@ @@ -71,10 +73,9 @@ {#if componentDefinition?.transitionable}
- onUpdateTransition(event.target.value)} name="transition" label="Transition" secondary thin> {#each transitions as transition} - + {/each}
diff --git a/packages/client/src/utils/transition.js b/packages/client/src/utils/transition.js index d97898060d..d0e1489c96 100644 --- a/packages/client/src/utils/transition.js +++ b/packages/client/src/utils/transition.js @@ -11,6 +11,6 @@ const transitions = new Map([ ]) export default function transition(node, { type, options = {} }) { - const { tn, opt } = transitions.get(type) || {} - return tn ? tn(node, { ...opt, ...options }) : fade(node, { duration: 0 }) -} + const { tn, opt } = transitions.get(type) || { tn: () => {}, opt: {}} + return tn(node, { ...opt, ...options }) +} \ No newline at end of file diff --git a/packages/server/src/constants/screens.js b/packages/server/src/constants/screens.js index 54c1271efc..54dcc2551d 100644 --- a/packages/server/src/constants/screens.js +++ b/packages/server/src/constants/screens.js @@ -21,6 +21,7 @@ exports.createHomeScreen = () => ({ active: {}, selected: {}, }, + _transition: "fade", type: "div", _children: [ { @@ -69,6 +70,7 @@ exports.createLoginScreen = app => ({ active: {}, selected: {}, }, + _transition: "fade", type: "div", _children: [ {