Skip to content

Commit

Permalink
Restricts more layout to SignedIn
Browse files Browse the repository at this point in the history
  • Loading branch information
allanlasser committed Mar 7, 2024
1 parent a374735 commit 52fd9df
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
13 changes: 9 additions & 4 deletions src/routes/app/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import AddOns from "./sidebar/AddOns.svelte";
import type { AddOnListItem } from "@/lib/api/types";
import type { Page } from "@/api/types";
import SignedIn from "@/lib/components/common/SignedIn.svelte";
export let data: {
pinnedAddons: Promise<Page<AddOnListItem>>;
Expand All @@ -22,14 +23,18 @@
<MainLayout>
<svelte:fragment slot="navigation">
<Documents />
<Projects />
<SignedIn>
<Projects />
</SignedIn>
</svelte:fragment>

<slot slot="content" />

<svelte:fragment slot="action">
<Button mode="primary"><PlusCircle16 /> Upload Documents</Button>
<Actions />
<AddOns pinnedAddOns={data.pinnedAddons} />
<SignedIn>
<Button mode="primary"><PlusCircle16 /> Upload Documents</Button>
<Actions />
<AddOns pinnedAddOns={data.pinnedAddons} />
</SignedIn>
</svelte:fragment>
</MainLayout>
21 changes: 13 additions & 8 deletions src/routes/app/sidebar/Documents.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@
import Flex from "@/lib/components/common/Flex.svelte";
import SidebarItem from "@/lib/components/sidebar/SidebarItem.svelte";
import { Globe16, Infinity16, Lock16, Organization16 } from "svelte-octicons";
import SignedIn from "@/lib/components/common/SignedIn.svelte";
</script>

<Flex direction="column">
<SidebarItem hover><Infinity16 /> {$_("projects.allDocuments")}</SidebarItem>
<SidebarItem hover><Globe16 /> {$_("projects.yourPubDocuments")}</SidebarItem>
<SidebarItem hover><Lock16 /> {$_("projects.yourDocuments")}</SidebarItem>
<SidebarItem hover>
<Organization16 />
{$_("projects.orgDocuments", {
values: { name: "MuckRock" },
})}
</SidebarItem>
<SignedIn>
<SidebarItem hover
><Globe16 /> {$_("projects.yourPubDocuments")}</SidebarItem
>
<SidebarItem hover><Lock16 /> {$_("projects.yourDocuments")}</SidebarItem>
<SidebarItem hover>
<Organization16 />
{$_("projects.orgDocuments", {
values: { name: "MuckRock" },
})}
</SidebarItem>
</SignedIn>
</Flex>

0 comments on commit 52fd9df

Please sign in to comment.