+
+
+
+ Add favorites to quickly find your best pictures and videos
-
-
-
-
-
-
- {/if}
-
-
- {#if isShowCreateSharedLinkModal}
-
- {/if}
-
-
-
-
+
diff --git a/web/src/routes/(user)/photos/+page.server.ts b/web/src/routes/(user)/photos/+page.server.ts
index 726bcc8ef7..db2e0b5391 100644
--- a/web/src/routes/(user)/photos/+page.server.ts
+++ b/web/src/routes/(user)/photos/+page.server.ts
@@ -1,21 +1,16 @@
import type { PageServerLoad } from './$types';
-import { redirect, error } from '@sveltejs/kit';
+import { redirect } from '@sveltejs/kit';
+import { AppRoute } from '$lib/constants';
-export const load: PageServerLoad = async ({ parent }) => {
- try {
- const { user } = await parent();
- if (!user) {
- throw error(400, 'Not logged in');
- }
-
- return {
- user,
- meta: {
- title: 'Photos'
- }
- };
- } catch (e) {
- console.log('Photo page load error', e);
- throw redirect(302, '/auth/login');
+export const load = (async ({ locals: { user } }) => {
+ if (!user) {
+ throw redirect(302, AppRoute.AUTH_LOGIN);
}
-};
+
+ return {
+ user,
+ meta: {
+ title: 'Photos'
+ }
+ };
+}) satisfies PageServerLoad;
diff --git a/web/src/routes/(user)/photos/+page.svelte b/web/src/routes/(user)/photos/+page.svelte
index d19ac96ca5..fd46a69430 100644
--- a/web/src/routes/(user)/photos/+page.svelte
+++ b/web/src/routes/(user)/photos/+page.svelte
@@ -7,12 +7,10 @@
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
import ControlAppBar from '$lib/components/shared-components/control-app-bar.svelte';
import CreateSharedLinkModal from '$lib/components/shared-components/create-share-link-modal/create-shared-link-modal.svelte';
- import NavigationBar from '$lib/components/shared-components/navigation-bar/navigation-bar.svelte';
import {
notificationController,
NotificationType
} from '$lib/components/shared-components/notification/notification';
- import SideBar from '$lib/components/shared-components/side-bar/side-bar.svelte';
import {
assetInteractionStore,
isMultiSelectStoreState,
@@ -20,17 +18,18 @@
} from '$lib/stores/asset-interaction.store';
import { assetStore } from '$lib/stores/assets.store';
import { addAssetsToAlbum, bulkDownload } from '$lib/utils/asset-utils';
- import { openFileUploadDialog } from '$lib/utils/file-uploader';
import { AlbumResponseDto, api, SharedLinkType } from '@api';
import Close from 'svelte-material-icons/Close.svelte';
import CloudDownloadOutline from 'svelte-material-icons/CloudDownloadOutline.svelte';
import DeleteOutline from 'svelte-material-icons/DeleteOutline.svelte';
import Plus from 'svelte-material-icons/Plus.svelte';
import ShareVariantOutline from 'svelte-material-icons/ShareVariantOutline.svelte';
- import type { PageData } from './$types';
import { locale } from '$lib/stores/preferences.store';
+ import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
+ import type { PageData } from './$types';
export let data: PageData;
+
let isShowCreateSharedLinkModal = false;
const deleteSelectedAssetHandler = async () => {
try {
@@ -144,73 +143,68 @@
};
-
- {#if $isMultiSelectStoreState}
- assetInteractionStore.clearMultiselect()}
- backIcon={Close}
- tailwindClasses={'bg-white shadow-md'}
- >
-
-
- Selected {$selectedAssets.size.toLocaleString($locale)}
-
-
-
-
-
-
-
-
-
- {:else}
- openFileUploadDialog()} />
- {/if}
+
+
+ {#if $isMultiSelectStoreState}
+ assetInteractionStore.clearMultiselect()}
+ backIcon={Close}
+ tailwindClasses={'bg-white shadow-md'}
+ >
+
+
+ Selected {$selectedAssets.size.toLocaleString($locale)}
+
+
+
+
+
+
+
+
+
+ {/if}
- {#if isShowAddMenu}
- (isShowAddMenu = false)}>
-
-
- handleShowAlbumPicker(false)} text="Add to Album" />
- handleShowAlbumPicker(true)} text="Add to Shared Album" />
-
-
- {/if}
+ {#if isShowAddMenu}
+ (isShowAddMenu = false)}>
+
+
+ handleShowAlbumPicker(false)} text="Add to Album" />
+ handleShowAlbumPicker(true)} text="Add to Shared Album" />
+
+
+ {/if}
- {#if isShowAlbumPicker}
- (isShowAlbumPicker = false)}
- />
- {/if}
+ {#if isShowAlbumPicker}
+ (isShowAlbumPicker = false)}
+ />
+ {/if}
- {#if isShowCreateSharedLinkModal}
-
- {/if}
-
+ {#if isShowCreateSharedLinkModal}
+
+ {/if}
+
-
+
+
diff --git a/web/src/routes/(user)/share/[key]/+page.server.ts b/web/src/routes/(user)/share/[key]/+page.server.ts
index 3db0b8740d..4948ccb49f 100644
--- a/web/src/routes/(user)/share/[key]/+page.server.ts
+++ b/web/src/routes/(user)/share/[key]/+page.server.ts
@@ -1,14 +1,10 @@
-export const prerender = false;
import { error } from '@sveltejs/kit';
-
import { getThumbnailUrl } from '$lib/utils/asset-utils';
import { ThumbnailFormat } from '@api';
import type { PageServerLoad } from './$types';
import featurePanelUrl from '$lib/assets/feature-panel.png';
-export const load: PageServerLoad = async ({ params, parent, locals: { api } }) => {
- const { user } = await parent();
-
+export const load = (async ({ params, locals: { api } }) => {
const { key } = params;
try {
@@ -25,12 +21,11 @@ export const load: PageServerLoad = async ({ params, parent, locals: { api } })
imageUrl: assetId
? getThumbnailUrl(assetId, ThumbnailFormat.Webp, sharedLink.key)
: featurePanelUrl
- },
- user
+ }
};
} catch (e) {
throw error(404, {
message: 'Invalid shared link'
});
}
-};
+}) satisfies PageServerLoad;
diff --git a/web/src/routes/(user)/sharing/+page.server.ts b/web/src/routes/(user)/sharing/+page.server.ts
index 837a39f550..f52be4ba99 100644
--- a/web/src/routes/(user)/sharing/+page.server.ts
+++ b/web/src/routes/(user)/sharing/+page.server.ts
@@ -1,25 +1,23 @@
-export const prerender = false;
-
+import { AppRoute } from '$lib/constants';
import { redirect } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
-export const load = (async ({ parent, locals: { api } }) => {
- try {
- const { user } = await parent();
- if (!user) {
- throw redirect(302, '/auth/login');
- }
+export const load = (async ({ locals: { api, user } }) => {
+ if (!user) {
+ throw redirect(302, AppRoute.AUTH_LOGIN);
+ }
+ try {
const { data: sharedAlbums } = await api.albumApi.getAllAlbums(true);
return {
- user: user,
+ user,
sharedAlbums,
meta: {
title: 'Albums'
}
};
} catch (e) {
- throw redirect(302, '/auth/login');
+ throw redirect(302, AppRoute.AUTH_LOGIN);
}
}) satisfies PageServerLoad;
diff --git a/web/src/routes/(user)/sharing/+page.svelte b/web/src/routes/(user)/sharing/+page.svelte
index f4c4a3c0f0..d84848a2e9 100644
--- a/web/src/routes/(user)/sharing/+page.svelte
+++ b/web/src/routes/(user)/sharing/+page.svelte
@@ -1,9 +1,6 @@
-
-
-
-
-
-
-
+
+