File tree Expand file tree Collapse file tree 2 files changed +20
-29
lines changed Expand file tree Collapse file tree 2 files changed +20
-29
lines changed Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import { createEventDispatcher , onDestroy , onMount } from " svelte" ;
3
3
import { cubicOut } from " svelte/easing" ;
4
- import { fade } from " svelte/transition" ;
4
+ import { fade , fly } from " svelte/transition" ;
5
5
import Portal from " ./Portal.svelte" ;
6
6
import { browser } from " $app/environment" ;
7
7
63
63
tabindex =" -1"
64
64
bind:this ={modalEl }
65
65
onkeydown ={handleKeydown }
66
- class ="max-h-[90dvh] overflow-y-auto overflow-x-hidden rounded-2xl bg-white shadow-2xl outline-none sm:-mt-10 {width }"
66
+ in:fly ={{ y : 100 }}
67
+ class ={[
68
+ " max-h-[90dvh] overflow-y-auto overflow-x-hidden rounded-2xl bg-white shadow-2xl outline-none sm:-mt-10" ,
69
+ width ,
70
+ ]}
67
71
>
68
72
{@render children ?.()}
69
73
</div >
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import { base } from " $app/paths" ;
3
- import { clickOutside } from " $lib/actions/clickOutside" ;
4
3
import { afterNavigate , goto } from " $app/navigation" ;
5
4
import { useSettingsStore } from " $lib/stores/settings" ;
6
5
import CarbonCheckmark from " ~icons/carbon/checkmark" ;
7
6
8
- import { fade , fly } from " svelte/transition " ;
7
+ import Modal from " $lib/components/Modal.svelte " ;
9
8
interface Props {
10
9
children? : import (" svelte" ).Snippet ;
11
10
}
23
22
const settings = useSettingsStore ();
24
23
</script >
25
24
26
- <div
27
- class = " fixed inset-0 z-20 flex items-center justify-center bg-black/80 backdrop-blur-sm dark:bg-black/50 "
28
- in:fade
25
+ <Modal
26
+ on:close ={() => goto ( previousPage )}
27
+ width = " !h-[95dvh] !w-[90dvw] overflow-hidden rounded-2xl bg-white shadow-2xl outline-none sm:!h-[85dvh] xl:!w-[1200px] 2xl:!h-[75dvh] "
29
28
>
30
- <dialog
31
- in:fly ={{ y : 100 }}
32
- open
33
- use:clickOutside ={() => {
34
- if (window ?.getSelection ()?.toString ()) {
35
- return ;
36
- }
37
- goto (previousPage );
38
- }}
39
- class =" h-[95dvh] w-[90dvw] overflow-hidden rounded-2xl bg-white shadow-2xl outline-none sm:h-[85dvh] xl:w-[1200px] 2xl:h-[75dvh]"
40
- >
41
- {@render children ?.()}
42
- {#if $settings .recentlySaved }
43
- <div
44
- class =" absolute bottom-4 right-4 m-2 flex items-center gap-1.5 rounded-full border border-gray-300 bg-gray-200 px-3 py-1 text-black"
45
- >
46
- <CarbonCheckmark class =" text-green-500" />
47
- Saved
48
- </div >
49
- {/if }
50
- </dialog >
51
- </div >
29
+ {@render children ?.()}
30
+ {#if $settings .recentlySaved }
31
+ <div
32
+ class =" absolute bottom-4 right-4 m-2 flex items-center gap-1.5 rounded-full border border-gray-300 bg-gray-200 px-3 py-1 text-black"
33
+ >
34
+ <CarbonCheckmark class =" text-green-500" />
35
+ Saved
36
+ </div >
37
+ {/if }
38
+ </Modal >
You can’t perform that action at this time.
0 commit comments