diff --git a/web/src/lib/components/shared-components/control-app-bar.svelte b/web/src/lib/components/shared-components/control-app-bar.svelte index 4a86dd115b..96cee6e102 100644 --- a/web/src/lib/components/shared-components/control-app-bar.svelte +++ b/web/src/lib/components/shared-components/control-app-bar.svelte @@ -56,7 +56,9 @@ -
+ + +
diff --git a/web/src/lib/components/shared-components/navigation-bar/navigation-bar.svelte b/web/src/lib/components/shared-components/navigation-bar/navigation-bar.svelte index 091ba535da..67aadfc045 100644 --- a/web/src/lib/components/shared-components/navigation-bar/navigation-bar.svelte +++ b/web/src/lib/components/shared-components/navigation-bar/navigation-bar.svelte @@ -9,9 +9,9 @@ import { AppRoute } from '../../../constants'; import AccountInfoPanel from './account-info-panel.svelte'; import ImmichLogo from '../immich-logo.svelte'; + import SearchBar from '../search-bar/search-bar.svelte'; export let user: UserResponseDto; export let shouldShowUploadButton = true; - export let term = ''; let shouldShowAccountInfo = false; @@ -36,100 +36,94 @@ goto(data.redirectUri || '/auth/login?autoLaunch=0'); }; - - const onSearch = () => { - goto(`/search?q=${term}`); - };
-
+

IMMICH

-
- -
-
- - - {#if !$page.url.pathname.includes('/admin') && shouldShowUploadButton} - - {/if} - - {#if user.isAdmin} - - - - {/if} - -
(shouldShowAccountInfo = true)} - on:focus={() => (shouldShowAccountInfo = true)} - on:mouseleave={() => (shouldShowAccountInfo = false)} - on:click={showAccountInfoPanel} - on:keydown={showAccountInfoPanel} - > - - - {#if shouldShowAccountInfo} -
-

{user.firstName} {user.lastName}

-

{user.email}

-
- {/if} +
+
+
-
+ +
+ + + {#if !$page.url.pathname.includes('/admin') && shouldShowUploadButton} + + {/if} + + {#if user.isAdmin} + + + + {/if} + +
(shouldShowAccountInfo = true)} + on:focus={() => (shouldShowAccountInfo = true)} + on:mouseleave={() => (shouldShowAccountInfo = false)} + on:click={showAccountInfoPanel} + on:keydown={showAccountInfoPanel} + > + + + {#if shouldShowAccountInfo} +
+

{user.firstName} {user.lastName}

+

{user.email}

+
+ {/if} +
+
+
{#if shouldShowAccountInfoPanel} diff --git a/web/src/lib/components/shared-components/search-bar/search-bar.svelte b/web/src/lib/components/shared-components/search-bar/search-bar.svelte new file mode 100644 index 0000000000..d6518daed2 --- /dev/null +++ b/web/src/lib/components/shared-components/search-bar/search-bar.svelte @@ -0,0 +1,59 @@ + + +
(value = '')} + on:submit|preventDefault={onSearch} +> + + {#if showClearIcon} +
+ +
+ {/if} +
diff --git a/web/src/lib/constants.ts b/web/src/lib/constants.ts index 0cfb898a44..b31eda302f 100644 --- a/web/src/lib/constants.ts +++ b/web/src/lib/constants.ts @@ -12,5 +12,7 @@ export enum AppRoute { PHOTOS = '/photos', EXPLORE = '/explore', SHARING = '/sharing', + SEARCH = '/search', + AUTH_LOGIN = '/auth/login' } diff --git a/web/src/routes/(user)/search/+page.svelte b/web/src/routes/(user)/search/+page.svelte index 8f38109516..8d8b53ee7c 100644 --- a/web/src/routes/(user)/search/+page.svelte +++ b/web/src/routes/(user)/search/+page.svelte @@ -5,44 +5,33 @@ import type { PageData } from './$types'; import ArrowLeft from 'svelte-material-icons/ArrowLeft.svelte'; import ImageOffOutline from 'svelte-material-icons/ImageOffOutline.svelte'; - import { afterNavigate, goto } from '$app/navigation'; + import SearchBar from '$lib/components/shared-components/search-bar/search-bar.svelte'; export let data: PageData; - const term = $page.url.searchParams.get('q') || data.term || ''; - - let goBackRoute = '/explore'; - afterNavigate((r) => { - if (r.from) { - goBackRoute = r.from.url.href; - } - }); + $: term = $page.url.searchParams.get('q') || data.term || '';
- goto(goBackRoute)} backIcon={ArrowLeft}> - -

- Search - {#if term} - - {term} - {/if} -

-
+ history.back()} backIcon={ArrowLeft}> +
+ +
-
+
-
- {#if data.results?.assets?.items.length != 0} - +
+ {#if data.results?.assets?.items.length > 0} +
+ +
{:else} -
-
- +
+
+

No results

Try a synonym or more general keyword