fix: make modal and drawer button hiddable as config

This commit is contained in:
Ruben Fiszel
2023-10-30 17:24:03 +01:00
parent 4ae3db11aa
commit 432f06efac
3 changed files with 20 additions and 2 deletions

View File

@@ -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}

View File

@@ -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}

View File

@@ -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',