Skip to content

Commit

Permalink
feat: add basic project settings layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Slartibartfass2 committed Jan 20, 2025
1 parent 75b0859 commit fee36d2
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<script lang="ts">
import type { Snippet } from "svelte";
import Settings from "lucide-svelte/icons/settings";
import Users from "lucide-svelte/icons/users";
import Snowflake from "lucide-svelte/icons/snowflake";
import ClipboardCheck from "lucide-svelte/icons/clipboard-check";
import { cn } from "$lib/utils/shadcn-helper";
import Separator from "$lib/components/primitives/separator/separator.svelte";
type TabValue = (typeof tabs)[number]["value"];
interface Props {
projectId: number;
selectedTab: TabValue;
children?: Snippet | undefined;
}
let { projectId, selectedTab, children = undefined }: Props = $props();
const tabs = [
{
icon: Settings,
label: "General",
value: "general",
href: `/project/${projectId}/settings/general`,
},
{
icon: Users,
label: "Members",
value: "members",
href: `/project/${projectId}/settings/members`,
},
{ icon: Snowflake, label: "SLR", value: "slr", href: `/project/${projectId}/settings/slr` },
{
icon: ClipboardCheck,
label: "Review",
value: "review",
href: `/project/${projectId}/settings/review`,
},
] as const;
</script>

<main class="flex flex-row w-full h-full px-[3.75rem] py-2.5 gap-4">
<div class="flex flex-col w-full max-w-[20%] h-full px-1.5 py-2.5 gap-2.5">
{#each tabs as tab}
<a
class={cn(
"flex flex-row w-full items-center h-12 px-3 gap-3",
tab.value === selectedTab ? "bg-slate-200 rounded-lg" : "",
)}
href={tab.href}
>
<tab.icon class="size-4" />
<span>{tab.label}</span>
</a>
{/each}
</div>
<Separator orientation="vertical" />
<div class="flex flex-col w-full h-full p-2.5 gap-3">
{@render children?.()}
</div>
</main>
6 changes: 5 additions & 1 deletion src/routes/project/[projectId]/settings/general/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<script lang="ts">
import ProjectSettingsLayout from "$lib/components/composites/project-components/ProjectSettingsLayout.svelte";
let { data } = $props();
const { project } = data;
const { projectId, loadingProject } = data;

Check failure on line 5 in src/routes/project/[projectId]/settings/general/+page.svelte

View workflow job for this annotation

GitHub Actions / Linting

'loadingProject' is assigned a value but never used
</script>

<svelte:head>
<title>General | Settings | {project.name}</title>

Check failure on line 9 in src/routes/project/[projectId]/settings/general/+page.svelte

View workflow job for this annotation

GitHub Actions / Linting

'project' is not defined
</svelte:head>
<h4>Project {project.id} Settings - General</h4>

Check failure on line 11 in src/routes/project/[projectId]/settings/general/+page.svelte

View workflow job for this annotation

GitHub Actions / Linting

'project' is not defined

<ProjectSettingsLayout {projectId} selectedTab="general">General content</ProjectSettingsLayout>
6 changes: 5 additions & 1 deletion src/routes/project/[projectId]/settings/members/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<script lang="ts">
import ProjectSettingsLayout from "$lib/components/composites/project-components/ProjectSettingsLayout.svelte";
let { data } = $props();
const { project } = data;
const { projectId, loadingProject } = data;

Check failure on line 5 in src/routes/project/[projectId]/settings/members/+page.svelte

View workflow job for this annotation

GitHub Actions / Linting

'loadingProject' is assigned a value but never used
</script>

<svelte:head>
<title>Members | Settings | {project.name}</title>

Check failure on line 9 in src/routes/project/[projectId]/settings/members/+page.svelte

View workflow job for this annotation

GitHub Actions / Linting

'project' is not defined
</svelte:head>
<h4>Project {project.id} Settings - Members</h4>

Check failure on line 11 in src/routes/project/[projectId]/settings/members/+page.svelte

View workflow job for this annotation

GitHub Actions / Linting

'project' is not defined

<ProjectSettingsLayout {projectId} selectedTab="members">Members content</ProjectSettingsLayout>
6 changes: 5 additions & 1 deletion src/routes/project/[projectId]/settings/review/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<script lang="ts">
import ProjectSettingsLayout from "$lib/components/composites/project-components/ProjectSettingsLayout.svelte";
let { data } = $props();
const { project } = data;
const { projectId, loadingProject } = data;

Check failure on line 5 in src/routes/project/[projectId]/settings/review/+page.svelte

View workflow job for this annotation

GitHub Actions / Linting

'loadingProject' is assigned a value but never used
</script>

<svelte:head>
<title>Review | Settings | {project.name}</title>

Check failure on line 9 in src/routes/project/[projectId]/settings/review/+page.svelte

View workflow job for this annotation

GitHub Actions / Linting

'project' is not defined
</svelte:head>
<h4>Project {project.id} Settings - Review</h4>

Check failure on line 11 in src/routes/project/[projectId]/settings/review/+page.svelte

View workflow job for this annotation

GitHub Actions / Linting

'project' is not defined

<ProjectSettingsLayout {projectId} selectedTab="review">Review content</ProjectSettingsLayout>
6 changes: 5 additions & 1 deletion src/routes/project/[projectId]/settings/slr/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<script lang="ts">
import ProjectSettingsLayout from "$lib/components/composites/project-components/ProjectSettingsLayout.svelte";
let { data } = $props();
const { project } = data;
const { projectId, loadingProject } = data;

Check failure on line 5 in src/routes/project/[projectId]/settings/slr/+page.svelte

View workflow job for this annotation

GitHub Actions / Linting

'loadingProject' is assigned a value but never used
</script>

<svelte:head>
<title>SLR | Settings | {project.name}</title>
</svelte:head>
<h4>Project {project.id} Settings - SLR</h4>

<ProjectSettingsLayout {projectId} selectedTab="slr">SLR content</ProjectSettingsLayout>

0 comments on commit fee36d2

Please sign in to comment.