diff --git a/frontend/src/lib/components/apps/components/layout/AppDrawer.svelte b/frontend/src/lib/components/apps/components/layout/AppDrawer.svelte index c3c42860ca..715d0d2746 100644 --- a/frontend/src/lib/components/apps/components/layout/AppDrawer.svelte +++ b/frontend/src/lib/components/apps/components/layout/AppDrawer.svelte @@ -79,7 +79,10 @@ wrapperClasses={twMerge( css?.container?.class, 'wm-drawer-button-container', - resolvedConfig?.fillContainer ? 'w-full h-full' : '' + resolvedConfig?.fillContainer ? 'w-full h-full' : '', + resolvedConfig?.hideButtonOnView && $mode == 'preview' + ? 'invisible h-0 overflow-hidden' + : '' )} wrapperStyle={css?.container?.style} disabled={resolvedConfig?.disabled} diff --git a/frontend/src/lib/components/apps/components/layout/AppModal.svelte b/frontend/src/lib/components/apps/components/layout/AppModal.svelte index 6bc1a23d8e..c7ec4b880b 100644 --- a/frontend/src/lib/components/apps/components/layout/AppModal.svelte +++ b/frontend/src/lib/components/apps/components/layout/AppModal.svelte @@ -106,7 +106,10 @@ resolvedConfig?.buttonFillContainer ? 'w-full h-full' : '', css?.buttonContainer?.class, 'wm-button-container', - 'wm-modal-button-container' + 'wm-modal-button-container', + resolvedConfig?.hideButtonOnView && $mode == 'preview' + ? 'invisible h-0 overflow-hidden' + : '' )} style={css?.button?.style} wrapperStyle={css?.buttonContainer?.style} diff --git a/frontend/src/lib/components/apps/editor/component/components.ts b/frontend/src/lib/components/apps/editor/component/components.ts index 379e80d702..f16abc1165 100644 --- a/frontend/src/lib/components/apps/editor/component/components.ts +++ b/frontend/src/lib/components/apps/editor/component/components.ts @@ -2259,6 +2259,12 @@ This is a paragraph. fieldType: 'text', value: 'Drawer title' }, + hideButtonOnView: { + fieldType: 'boolean', + type: 'static', + value: false, + tooltip: 'Make button invisible when app is used outside of the edit mode' + }, label: { type: 'static', fieldType: 'text', @@ -2429,6 +2435,12 @@ This is a paragraph. fieldType: 'text', value: 'Modal title' }, + hideButtonOnView: { + fieldType: 'boolean', + type: 'static', + value: false, + tooltip: 'Make button invisible when app is used outside of the edit mode' + }, buttonLabel: { type: 'static', fieldType: 'text',