mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-24 12:35:31 +00:00
feat: add ssr for dashboard
This commit is contained in:
parent
a95e89e8f1
commit
71f1e6b0b0
2 changed files with 14 additions and 11 deletions
|
|
@ -8,4 +8,12 @@ export const load: LayoutServerLoad = async ({ fetch }) => {
|
|||
if (details === null) {
|
||||
throw redirect(302, '/register');
|
||||
}
|
||||
|
||||
return {
|
||||
candidate: {
|
||||
name: details.name,
|
||||
surname: details.surname,
|
||||
email: details.email
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,15 +11,10 @@
|
|||
import PortfolioLetterUploadCard from '$lib/components/dashboard/PortfolioLetterUploadCard.svelte';
|
||||
import PortfolioZipUploadCard from '$lib/components/dashboard/PortfolioZipUploadCard.svelte';
|
||||
import { fetchSubmProgress } from '$lib/stores/portfolio';
|
||||
import type { PageData } from './$types';
|
||||
|
||||
|
||||
let fullName = "";
|
||||
let email = "";
|
||||
|
||||
$: if ($candidateData) {
|
||||
fullName = ($candidateData.name ?? "") + " " + ($candidateData.surname ?? "");
|
||||
email = $candidateData.email ?? "";
|
||||
}
|
||||
export let data: PageData;
|
||||
|
||||
fetchSubmProgress(); // TODO: move to a better place
|
||||
|
||||
|
|
@ -39,8 +34,8 @@
|
|||
<FullLayout>
|
||||
<div class="dashboard dashboardDesktop">
|
||||
<div class="name col-span-3">
|
||||
<DashboardInfoCard title={fullName}>
|
||||
<span class="mt-3 text-sspsBlue truncate">{email}</span>
|
||||
<DashboardInfoCard title={data.candidate.name ?? ""}>
|
||||
<span class="mt-3 text-sspsBlue truncate">{data.candidate.email}</span>
|
||||
<span class="mt-3 text-sspsGray text-xs">Uchazeč na SSPŠ</span>
|
||||
</DashboardInfoCard>
|
||||
</div>
|
||||
|
|
@ -56,8 +51,8 @@
|
|||
</div>
|
||||
<div class="dashboard dashboardMobile">
|
||||
<div class="my-10 name w-[90%] mx-auto">
|
||||
<DashboardInfoCard title={fullName}>
|
||||
<span class="mt-3 text-sspsBlue truncate">{fullName}</span>
|
||||
<DashboardInfoCard title={data.candidate.name ?? ""}>
|
||||
<span class="mt-3 text-sspsBlue truncate">{data.candidate.email}</span>
|
||||
<span class="mt-3 text-sspsGray text-xs">Uchazeč na SSPŠ</span>
|
||||
</DashboardInfoCard>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue