-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add basic project settings layout
- Loading branch information
1 parent
75b0859
commit fee36d2
Showing
5 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
src/lib/components/composites/project-components/ProjectSettingsLayout.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
</script> | ||
|
||
<svelte:head> | ||
<title>General | Settings | {project.name}</title> | ||
</svelte:head> | ||
<h4>Project {project.id} Settings - General</h4> | ||
|
||
<ProjectSettingsLayout {projectId} selectedTab="general">General content</ProjectSettingsLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
</script> | ||
|
||
<svelte:head> | ||
<title>Members | Settings | {project.name}</title> | ||
</svelte:head> | ||
<h4>Project {project.id} Settings - Members</h4> | ||
|
||
<ProjectSettingsLayout {projectId} selectedTab="members">Members content</ProjectSettingsLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
</script> | ||
|
||
<svelte:head> | ||
<title>Review | Settings | {project.name}</title> | ||
</svelte:head> | ||
<h4>Project {project.id} Settings - Review</h4> | ||
|
||
<ProjectSettingsLayout {projectId} selectedTab="review">Review content</ProjectSettingsLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
</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> |