File tree 9 files changed +18
-50
lines changed
lib/components/shared-components
9 files changed +18
-50
lines changed Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import empty1Url from ' $lib/assets/empty-1.svg' ;
3
3
4
- export let actionHandler: undefined | (() => unknown ) = undefined ;
5
- export let text = ' ' ;
6
- export let alt = ' ' ;
4
+ export let onClick: undefined | (() => unknown ) = undefined ;
5
+ export let text: string ;
7
6
export let fullWidth = false ;
8
7
export let src = empty1Url ;
9
8
10
- const noop = () => {} ;
9
+ $ : width = fullWidth ? ' w-full ' : ' w-1/2 ' ;
11
10
12
- $ : handler = actionHandler || noop ;
13
- $ : width = fullWidth ? ' w-full' : ' w-[50%]' ;
14
-
15
- const hoverClasses = actionHandler
16
- ? ` border dark:border-immich-dark-gray hover:bg-immich-primary/5 dark:hover:bg-immich-dark-primary/25 hover:cursor-pointer `
11
+ const hoverClasses = onClick
12
+ ? ` border dark:border-immich-dark-gray hover:bg-immich-primary/5 dark:hover:bg-immich-dark-primary/25 `
17
13
: ' ' ;
18
14
</script >
19
15
20
16
<!-- svelte-ignore a11y-no-static-element-interactions -->
21
- <div
22
- on:click ={ handler }
23
- on:keydown ={ handler }
17
+ <svelte:element
18
+ this ={ onClick ? ' button ' : ' div ' }
19
+ on:click ={ onClick }
24
20
class =" {width } m-auto mt-10 flex flex-col place-content-center place-items-center rounded-3xl bg-gray-50 p-5 dark:bg-immich-dark-gray {hoverClasses }"
25
21
>
26
- <img {src } { alt } width =" 500" draggable =" false" />
27
- <p class ="text-immich-text-gray-500 text-center dark:text-immich-dark-fg" >{text }</p >
28
- </div >
22
+ <img {src } alt = " " width =" 500" draggable =" false" />
23
+ <p class ="text-immich-text-gray-500 dark:text-immich-dark-fg" >{text }</p >
24
+ </svelte:element >
Original file line number Diff line number Diff line change 375
375
376
376
<!-- Empty Message -->
377
377
{:else }
378
- <EmptyPlaceholder
379
- text =" Create an album to organize your photos and videos"
380
- actionHandler ={handleCreateAlbum }
381
- alt =" Empty albums"
382
- />
378
+ <EmptyPlaceholder text ="Create an album to organize your photos and videos" onClick ={handleCreateAlbum } />
383
379
{/if }
384
380
</UserPageLayout >
385
381
Original file line number Diff line number Diff line change 45
45
46
46
<UserPageLayout hideNavbar ={$isMultiSelectState } title ={data .meta .title } scrollbar ={false }>
47
47
<AssetGrid {assetStore } {assetInteractionStore } removeAction ={AssetAction .UNARCHIVE }>
48
- <EmptyPlaceholder
49
- text =" Archive photos and videos to hide them from your Photos view"
50
- alt =" Empty archive"
51
- slot =" empty"
52
- />
48
+ <EmptyPlaceholder text =" Archive photos and videos to hide them from your Photos view" slot =" empty" />
53
49
</AssetGrid >
54
50
</UserPageLayout >
Original file line number Diff line number Diff line change 50
50
51
51
<UserPageLayout hideNavbar ={$isMultiSelectState } title ={data .meta .title } scrollbar ={false }>
52
52
<AssetGrid {assetStore } {assetInteractionStore } removeAction ={AssetAction .UNFAVORITE }>
53
- <EmptyPlaceholder
54
- text =" Add favorites to quickly find your best pictures and videos"
55
- alt =" Empty favorites"
56
- slot =" empty"
57
- />
53
+ <EmptyPlaceholder text =" Add favorites to quickly find your best pictures and videos" slot =" empty" />
58
54
</AssetGrid >
59
55
</UserPageLayout >
Original file line number Diff line number Diff line change 88
88
{#if $user .memoriesEnabled }
89
89
<MemoryLane />
90
90
{/if }
91
- <EmptyPlaceholder
92
- text =" CLICK TO UPLOAD YOUR FIRST PHOTO"
93
- actionHandler ={() => openFileUploadDialog ()}
94
- slot =" empty"
95
- />
91
+ <EmptyPlaceholder text ="CLICK TO UPLOAD YOUR FIRST PHOTO" onClick ={() => openFileUploadDialog ()} slot =" empty" />
96
92
</AssetGrid >
97
93
</UserPageLayout >
Original file line number Diff line number Diff line change 92
92
{#if data .sharedAlbums .length === 0 }
93
93
<EmptyPlaceholder
94
94
text =" Create a shared album to share photos and videos with people in your network"
95
- alt =" Empty album list"
96
95
src ={empty2Url }
97
96
/>
98
97
{/if }
Original file line number Diff line number Diff line change 91
91
<p class =" font-medium text-gray-500/60 dark:text-gray-300/60 p-4" >
92
92
Trashed items will be permanently deleted after {$serverConfig .trashDays } days.
93
93
</p >
94
- <EmptyPlaceholder
95
- text =" Trashed photos and videos will show up here."
96
- alt =" Empty trash can"
97
- slot =" empty"
98
- src ={empty3Url }
99
- />
94
+ <EmptyPlaceholder text ="Trashed photos and videos will show up here." src ={empty3Url } slot =" empty" />
100
95
</AssetGrid >
101
96
</UserPageLayout >
102
97
{/if }
Original file line number Diff line number Diff line change 462
462
{:else }
463
463
<EmptyPlaceholder
464
464
text =" Create an external library to view your photos and videos"
465
- actionHandler ={() => (toCreateLibrary = true )}
466
- alt =" Empty albums"
465
+ onClick ={() => (toCreateLibrary = true )}
467
466
/>
468
467
{/if }
469
468
</div >
Original file line number Diff line number Diff line change 203
203
<section class =" w-full pb-28 sm:w-5/6 md:w-[850px]" >
204
204
{#if matches .length + extras .length + orphans .length === 0 }
205
205
<div class =" w-full" >
206
- <EmptyPlaceholder
207
- fullWidth
208
- text =" Untracked and missing files will show up here"
209
- alt =" Empty report"
210
- src ={empty4Url }
211
- />
206
+ <EmptyPlaceholder fullWidth text ="Untracked and missing files will show up here" src ={empty4Url } />
212
207
</div >
213
208
{:else }
214
209
<div class =" gap-2" >
You can’t perform that action at this time.
0 commit comments