fix: ModalContainer modals sometimes stay closed / fix autofill not working after 1 usage
This commit is contained in:
4 files changed
+77
-72
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "photon-lemmy",
|
"name": "photon-lemmy",
|
||||||
"version": "2.2.2",
|
"version": "2.3.0",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@dicebear/core": "^9.3.1",
|
"@dicebear/core": "^9.3.1",
|
||||||
|
|||||||
@@ -175,40 +175,42 @@
|
|||||||
{#snippet autofillPostModal()}
|
{#snippet autofillPostModal()}
|
||||||
<svelte:boundary>
|
<svelte:boundary>
|
||||||
{#if form.url}
|
{#if form.url}
|
||||||
{#await autofill(new URL(form.url))}
|
{#key form.url}
|
||||||
<div class="w-full h-48 grid place-items-center">
|
{#await autofill(new URL(form.url))}
|
||||||
<TextLoader>
|
<div class="w-full h-48 grid place-items-center">
|
||||||
{$t('form.post.fetching')}
|
<TextLoader>
|
||||||
</TextLoader>
|
{$t('form.post.fetching')}
|
||||||
</div>
|
</TextLoader>
|
||||||
<Button size="lg" color="secondary" onclick={history.back}>
|
</div>
|
||||||
{$t('common.cancel')}
|
<Button size="lg" color="secondary" onclick={history.back}>
|
||||||
</Button>
|
{$t('common.cancel')}
|
||||||
{:then url}
|
</Button>
|
||||||
{#if !url}
|
{:then url}
|
||||||
<!--cursed svelte template abuse. don't do this lads-->
|
{#if !url}
|
||||||
{history.back()}
|
<!--cursed svelte template abuse. don't do this lads-->
|
||||||
{/if}
|
{history.back()}
|
||||||
<Material color="info" class="space-y-2 h-48">
|
{/if}
|
||||||
<h2 class="text-xl font-display font-medium">{url.title}</h2>
|
<Material color="info" class="space-y-2 h-48">
|
||||||
<p class="overflow-hidden text-ellipsis">{url.body ?? '...'}</p>
|
<h2 class="text-xl font-display font-medium">{url.title}</h2>
|
||||||
</Material>
|
<p class="overflow-hidden text-ellipsis">{url.body ?? '...'}</p>
|
||||||
<Button
|
</Material>
|
||||||
size="lg"
|
<Button
|
||||||
color="primary"
|
size="lg"
|
||||||
onclick={() => {
|
color="primary"
|
||||||
autofill({ title: url.title, body: url.body })
|
onclick={() => {
|
||||||
history.back()
|
autofill({ title: url.title, body: url.body })
|
||||||
}}
|
history.back()
|
||||||
>
|
}}
|
||||||
{$t('form.submit')}
|
>
|
||||||
</Button>
|
{$t('form.submit')}
|
||||||
{:catch err}
|
</Button>
|
||||||
<ErrorContainer scope="-1" message={err} />
|
{:catch err}
|
||||||
{/await}
|
<ErrorContainer scope="-1" message={err} />
|
||||||
<Switch class="mt-4" bind:checked={settings.forms.autosubmitAutofill}>
|
{/await}
|
||||||
{$t('form.post.autosubmit')}
|
<Switch class="mt-4" bind:checked={settings.forms.autosubmitAutofill}>
|
||||||
</Switch>
|
{$t('form.post.autosubmit')}
|
||||||
|
</Switch>
|
||||||
|
{/key}
|
||||||
{/if}
|
{/if}
|
||||||
</svelte:boundary>
|
</svelte:boundary>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -161,7 +161,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.post-media-indicator {
|
.post-media-indicator {
|
||||||
/*bg-linear-180 from-zinc-900/0 to-zinc-900/95 h-16 absolute bottom-0 w-full left-0 flex items-end p-2*/
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
@@ -170,6 +169,8 @@
|
|||||||
padding: calc(var(--spacing) * 2);
|
padding: calc(var(--spacing) * 2);
|
||||||
height: calc(var(--spacing) * 16);
|
height: calc(var(--spacing) * 16);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
border-bottom-left-radius: inherit;
|
||||||
|
border-bottom-right-radius: inherit;
|
||||||
|
|
||||||
background-image: linear-gradient(
|
background-image: linear-gradient(
|
||||||
to bottom,
|
to bottom,
|
||||||
|
|||||||
@@ -4,39 +4,41 @@
|
|||||||
import { shownModal } from './modal'
|
import { shownModal } from './modal'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $shownModal}
|
{#key $shownModal}
|
||||||
<Modal
|
{#if $shownModal}
|
||||||
title={$shownModal.title}
|
<Modal
|
||||||
dismissable={$shownModal.dismissable}
|
title={$shownModal.title}
|
||||||
ondismissed={() => shownModal.set(undefined)}
|
dismissable={$shownModal.dismissable}
|
||||||
open={!!$shownModal}
|
ondismissed={() => shownModal.set(undefined)}
|
||||||
>
|
open={!!$shownModal}
|
||||||
{#if $shownModal.snippet}
|
>
|
||||||
{@render $shownModal.snippet?.()}
|
{#if $shownModal.snippet}
|
||||||
{/if}
|
{@render $shownModal.snippet?.()}
|
||||||
{#if $shownModal.body}
|
{/if}
|
||||||
<p>{$shownModal.body}</p>
|
{#if $shownModal.body}
|
||||||
{/if}
|
<p>{$shownModal.body}</p>
|
||||||
{#if $shownModal.actions}
|
{/if}
|
||||||
<div
|
{#if $shownModal.actions}
|
||||||
class="flex items-center gap-2 {$shownModal.actions.length >= 3
|
<div
|
||||||
? 'flex-col'
|
class="flex items-center gap-2 {$shownModal.actions.length >= 3
|
||||||
: 'flex-row'}"
|
? 'flex-col'
|
||||||
>
|
: 'flex-row'}"
|
||||||
{#each $shownModal.actions as action (action)}
|
>
|
||||||
<Button
|
{#each $shownModal.actions as action (action)}
|
||||||
size="lg"
|
<Button
|
||||||
class="flex-1 w-full"
|
size="lg"
|
||||||
onclick={action.action}
|
class="flex-1 w-full"
|
||||||
color={action.type}
|
onclick={action.action}
|
||||||
>
|
color={action.type}
|
||||||
{#if action.icon}
|
>
|
||||||
<Icon src={action.icon} mini size="16" />
|
{#if action.icon}
|
||||||
{/if}
|
<Icon src={action.icon} mini size="16" />
|
||||||
{action.content}
|
{/if}
|
||||||
</Button>
|
{action.content}
|
||||||
{/each}
|
</Button>
|
||||||
</div>
|
{/each}
|
||||||
{/if}
|
</div>
|
||||||
</Modal>
|
{/if}
|
||||||
{/if}
|
</Modal>
|
||||||
|
{/if}
|
||||||
|
{/key}
|
||||||
Reference in new issue
Block a user