2022-07-15 23:18:17 -05:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { AppSideBarSelection } from '$lib/models/admin-sidebar-selection';
|
|
|
|
|
import { onMount } from 'svelte';
|
|
|
|
|
import { page } from '$app/stores';
|
|
|
|
|
import ImageAlbum from 'svelte-material-icons/ImageAlbum.svelte';
|
|
|
|
|
import ImageOutline from 'svelte-material-icons/ImageOutline.svelte';
|
2022-07-16 23:52:00 -05:00
|
|
|
import AccountMultipleOutline from 'svelte-material-icons/AccountMultipleOutline.svelte';
|
2022-07-15 23:18:17 -05:00
|
|
|
import SideBarButton from './side-bar-button.svelte';
|
|
|
|
|
import StatusBox from '../status-box.svelte';
|
|
|
|
|
|
|
|
|
|
let selectedAction: AppSideBarSelection;
|
|
|
|
|
|
|
|
|
|
onMount(async () => {
|
|
|
|
|
if ($page.routeId == 'albums') {
|
|
|
|
|
selectedAction = AppSideBarSelection.ALBUMS;
|
|
|
|
|
} else if ($page.routeId == 'photos') {
|
|
|
|
|
selectedAction = AppSideBarSelection.PHOTOS;
|
2022-07-16 23:52:00 -05:00
|
|
|
} else if ($page.routeId == 'sharing') {
|
|
|
|
|
selectedAction = AppSideBarSelection.SHARING;
|
2022-07-15 23:18:17 -05:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
2022-07-16 23:52:00 -05:00
|
|
|
<section id="sidebar" class="flex flex-col gap-1 pt-8 pr-6">
|
2022-08-25 13:02:36 -07:00
|
|
|
<a sveltekit:prefetch sveltekit:noscroll href={$page.routeId !== 'photos' ? `/photos` : null}>
|
2022-07-15 23:18:17 -05:00
|
|
|
<SideBarButton
|
|
|
|
|
title="Photos"
|
|
|
|
|
logo={ImageOutline}
|
|
|
|
|
actionType={AppSideBarSelection.PHOTOS}
|
|
|
|
|
isSelected={selectedAction === AppSideBarSelection.PHOTOS}
|
|
|
|
|
/></a
|
|
|
|
|
>
|
2022-08-25 13:02:36 -07:00
|
|
|
<a sveltekit:prefetch href={$page.routeId !== 'sharing' ? `/sharing` : null}>
|
2022-07-16 23:52:00 -05:00
|
|
|
<SideBarButton
|
|
|
|
|
title="Sharing"
|
|
|
|
|
logo={AccountMultipleOutline}
|
|
|
|
|
actionType={AppSideBarSelection.SHARING}
|
|
|
|
|
isSelected={selectedAction === AppSideBarSelection.SHARING}
|
|
|
|
|
/></a
|
|
|
|
|
>
|
|
|
|
|
<div class="text-xs ml-5 my-4">
|
2022-07-15 23:18:17 -05:00
|
|
|
<p>LIBRARY</p>
|
|
|
|
|
</div>
|
2022-08-25 13:02:36 -07:00
|
|
|
<a sveltekit:prefetch href={$page.routeId !== 'albums' ? `/albums` : null}>
|
2022-07-15 23:18:17 -05:00
|
|
|
<SideBarButton
|
|
|
|
|
title="Albums"
|
|
|
|
|
logo={ImageAlbum}
|
|
|
|
|
actionType={AppSideBarSelection.ALBUMS}
|
|
|
|
|
isSelected={selectedAction === AppSideBarSelection.ALBUMS}
|
|
|
|
|
/>
|
|
|
|
|
</a>
|
|
|
|
|
|
2022-08-25 23:04:23 -07:00
|
|
|
<!-- Status Box -->
|
2022-07-15 23:18:17 -05:00
|
|
|
<div class="mb-6 mt-auto">
|
|
|
|
|
<StatusBox />
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|