refactor(web): common layout for user pages (#1995)

* refactor(web): common layout for user pages

* remove unused imports
This commit is contained in:
Michel Heusschen
2023-03-18 22:31:15 +01:00
committed by GitHub
parent dd02f1025f
commit 9a332074c7
17 changed files with 437 additions and 552 deletions

View File

@@ -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;