diff --git a/platforms/metagram/src/lib/fragments/AddPostModal/AddPostModal.svelte b/platforms/metagram/src/lib/fragments/AddPostModal/AddPostModal.svelte new file mode 100644 index 00000000..dfa0fade --- /dev/null +++ b/platforms/metagram/src/lib/fragments/AddPostModal/AddPostModal.svelte @@ -0,0 +1,106 @@ + + + { + (files = undefined), (isAddCaption = false); + }} +> + Upload a Photo + {#if !isAddCaption} + {#if !files} + + {:else} + + {#each imagePreviews as src} + + + + + {/each} + + {/if} + {:else if isAddCaption} + Add a Caption + + + {#each imagePreviews as src} + + + + + {/each} + + Who can see the post? + {#each postVisibilityOptions as option, i} + + {option} + + + {/each} + {/if} + {#if files} + + { + files = undefined; + isAddCaption = false; + paneModal?.destroy({ animate: true }); + }}>Cancel + { + isAddCaption = true; + }}>Next + + {/if} + diff --git a/platforms/metagram/src/lib/fragments/InputFile/InputFile.svelte b/platforms/metagram/src/lib/fragments/InputFile/InputFile.svelte index 9b8c5dce..9d390ec5 100644 --- a/platforms/metagram/src/lib/fragments/InputFile/InputFile.svelte +++ b/platforms/metagram/src/lib/fragments/InputFile/InputFile.svelte @@ -1,33 +1,46 @@ - + - + {#if files} diff --git a/platforms/metagram/src/lib/fragments/Modal/Modal.svelte b/platforms/metagram/src/lib/fragments/Modal/Modal.svelte index ff99a6f9..2d2cefb6 100644 --- a/platforms/metagram/src/lib/fragments/Modal/Modal.svelte +++ b/platforms/metagram/src/lib/fragments/Modal/Modal.svelte @@ -7,6 +7,8 @@ interface IDrawerProps extends HTMLAttributes { modalEl?: HTMLDivElement; paneModal?: CupertinoPane; + initialBreak?: 'bottom' | 'top' | 'middle'; + handleDismiss?: () => void; children?: Snippet; } @@ -14,14 +16,13 @@ modalEl = $bindable(), paneModal = $bindable(), children = undefined, + initialBreak, + handleDismiss, ...restProps }: IDrawerProps = $props(); - function present() { - if (paneModal) paneModal.present({ animate: true }); - } - function dismiss() { + handleDismiss && handleDismiss(); if (paneModal) paneModal.destroy({ animate: true }); } @@ -30,25 +31,25 @@ paneModal = new CupertinoPane(modalEl, { modal: true, backdrop: true, + backdropBlur: true, backdropOpacity: 0.4, + animationType: 'ease', + animationDuration: 300, fitHeight: true, - showDraggable: true, + bottomClose: false, + showDraggable: false, buttonDestroy: false, + initialBreak: initialBreak, breaks: { - bottom: { enabled: true, height: 250 } + top: { enabled: true, height: 600 }, + middle: { enabled: true, height: 400 }, + bottom: { enabled: true, height: 200 } }, - initialBreak: 'bottom', cssClass: 'modal', events: { onBackdropTap: () => dismiss() } }); - - present(); - - return () => { - if (paneModal) paneModal.destroy({ animate: false }); - }; }); @@ -60,17 +61,18 @@