diff --git a/bun.lockb b/bun.lockb index 8f677ae..cefd2ef 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index c9331b8..c19a0e8 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@tailwindcss/typography": "^0.5.16", "@types/markdown-it": "^14.1.2", "autoprefixer": "^10.4.20", - "bits-ui": "^0.22.0", + "bits-ui": "0.22.0", "clsx": "^2.1.1", "eslint": "^9.18.0", "eslint-config-prettier": "^10.0.1", diff --git a/src/lib/components/mainLayout.svelte b/src/lib/components/mainLayout.svelte index 428b717..efa0d4d 100644 --- a/src/lib/components/mainLayout.svelte +++ b/src/lib/components/mainLayout.svelte @@ -41,7 +41,7 @@ -
+
{@render children()}
diff --git a/src/lib/components/ui/select/index.ts b/src/lib/components/ui/select/index.ts new file mode 100644 index 0000000..10a33c5 --- /dev/null +++ b/src/lib/components/ui/select/index.ts @@ -0,0 +1,34 @@ +import { Select as SelectPrimitive } from "bits-ui"; + +import Label from "./select-label.svelte"; +import Item from "./select-item.svelte"; +import Content from "./select-content.svelte"; +import Trigger from "./select-trigger.svelte"; +import Separator from "./select-separator.svelte"; + +const Root = SelectPrimitive.Root; +const Group = SelectPrimitive.Group; +const Input = SelectPrimitive.Input; +const Value = SelectPrimitive.Value; + +export { + Root, + Item, + Group, + Input, + Label, + Value, + Content, + Trigger, + Separator, + // + Root as Select, + Item as SelectItem, + Group as SelectGroup, + Input as SelectInput, + Label as SelectLabel, + Value as SelectValue, + Content as SelectContent, + Trigger as SelectTrigger, + Separator as SelectSeparator, +}; diff --git a/src/lib/components/ui/select/select-content.svelte b/src/lib/components/ui/select/select-content.svelte new file mode 100644 index 0000000..7ed541c --- /dev/null +++ b/src/lib/components/ui/select/select-content.svelte @@ -0,0 +1,36 @@ + + + +
+ +
+
diff --git a/src/lib/components/ui/select/select-item.svelte b/src/lib/components/ui/select/select-item.svelte new file mode 100644 index 0000000..73cb954 --- /dev/null +++ b/src/lib/components/ui/select/select-item.svelte @@ -0,0 +1,37 @@ + + + + + + + + + + {label || value} + + diff --git a/src/lib/components/ui/select/select-label.svelte b/src/lib/components/ui/select/select-label.svelte new file mode 100644 index 0000000..29b319b --- /dev/null +++ b/src/lib/components/ui/select/select-label.svelte @@ -0,0 +1,13 @@ + + + + + diff --git a/src/lib/components/ui/select/select-separator.svelte b/src/lib/components/ui/select/select-separator.svelte new file mode 100644 index 0000000..78fc46d --- /dev/null +++ b/src/lib/components/ui/select/select-separator.svelte @@ -0,0 +1,11 @@ + + + diff --git a/src/lib/components/ui/select/select-trigger.svelte b/src/lib/components/ui/select/select-trigger.svelte new file mode 100644 index 0000000..cd958b7 --- /dev/null +++ b/src/lib/components/ui/select/select-trigger.svelte @@ -0,0 +1,24 @@ + + +span]:text-muted-foreground flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", + className + )} + {...$$restProps} +> + +
+ +
+
diff --git a/src/routes/(main)/account/+page.server.ts b/src/routes/(main)/account/+page.server.ts new file mode 100644 index 0000000..045674b --- /dev/null +++ b/src/routes/(main)/account/+page.server.ts @@ -0,0 +1,12 @@ +import { auth } from '$lib/server/db/auth'; +import { redirect } from '@sveltejs/kit'; + +export async function load({ request }): Promise { + const session = await auth.api.getSession({ + headers: request.headers, + }); + + if (!session) { + redirect(307, '/signup'); + } +} diff --git a/src/routes/(main)/account/+page.svelte b/src/routes/(main)/account/+page.svelte new file mode 100644 index 0000000..1a3c801 --- /dev/null +++ b/src/routes/(main)/account/+page.svelte @@ -0,0 +1,76 @@ + + +
+
+ +
+
+ Update Password +
+ + +
+
+ + +
+ +
+
+ +
+
+ Update Username +
+ + +
+
+ + +
+ +
+
+ +
+
+ Upload Profile Image + + +
+
+ +
+
+ Account Actions +
+ +
+ +
+
+
+
+ + + + + Are you sure absolutely sure? + + This action cannot be undone. This will permanently delete your account and remove your data from our database. +
+ + +
+
+
+
+