2023-10-16 12:10:52 -05:00
|
|
|
import useCollectionStore from "@/store/collections";
|
|
|
|
import Link from "next/link";
|
|
|
|
import { useRouter } from "next/router";
|
2023-12-17 03:18:31 -06:00
|
|
|
import React, { useEffect, useState } from "react";
|
2023-10-16 12:10:52 -05:00
|
|
|
|
|
|
|
export default function SettingsSidebar({ className }: { className?: string }) {
|
2024-01-17 12:02:44 -06:00
|
|
|
const LINKWARDEN_VERSION = "v2.4.9";
|
2023-11-09 10:44:49 -06:00
|
|
|
|
2023-10-16 12:10:52 -05:00
|
|
|
const { collections } = useCollectionStore();
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
const [active, setActive] = useState("");
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
setActive(router.asPath);
|
|
|
|
}, [router, collections]);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div
|
2023-11-26 04:17:08 -06:00
|
|
|
className={`bg-base-100 h-full w-64 overflow-y-auto border-solid border border-base-100 border-r-neutral-content p-5 z-20 flex flex-col gap-5 justify-between ${
|
2023-10-28 11:50:11 -05:00
|
|
|
className || ""
|
|
|
|
}`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
|
|
|
<div className="flex flex-col gap-1">
|
2023-10-18 16:50:55 -05:00
|
|
|
<Link href="/settings/account">
|
2023-10-16 12:10:52 -05:00
|
|
|
<div
|
|
|
|
className={`${
|
2023-10-18 16:50:55 -05:00
|
|
|
active === `/settings/account`
|
2023-12-01 15:29:17 -06:00
|
|
|
? "bg-primary/20"
|
2023-11-27 15:38:38 -06:00
|
|
|
: "hover:bg-neutral/20"
|
2023-12-02 03:47:53 -06:00
|
|
|
} duration-100 py-5 px-2 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
2023-12-19 10:50:43 -06:00
|
|
|
<i className="bi-person text-primary text-2xl"></i>
|
2023-10-16 12:10:52 -05:00
|
|
|
|
2023-11-24 07:39:55 -06:00
|
|
|
<p className="truncate w-full pr-7">Account</p>
|
2023-10-16 12:10:52 -05:00
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
<Link href="/settings/appearance">
|
|
|
|
<div
|
|
|
|
className={`${
|
|
|
|
active === `/settings/appearance`
|
2023-12-01 15:29:17 -06:00
|
|
|
? "bg-primary/20"
|
2023-11-27 15:38:38 -06:00
|
|
|
: "hover:bg-neutral/20"
|
2023-12-02 03:47:53 -06:00
|
|
|
} duration-100 py-5 px-2 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
2023-12-19 10:50:43 -06:00
|
|
|
<i className="bi-palette text-primary text-2xl"></i>
|
2023-10-16 12:10:52 -05:00
|
|
|
|
2023-11-24 07:39:55 -06:00
|
|
|
<p className="truncate w-full pr-7">Appearance</p>
|
2023-10-16 12:10:52 -05:00
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
<Link href="/settings/archive">
|
|
|
|
<div
|
|
|
|
className={`${
|
|
|
|
active === `/settings/archive`
|
2023-12-01 15:29:17 -06:00
|
|
|
? "bg-primary/20"
|
2023-11-27 15:38:38 -06:00
|
|
|
: "hover:bg-neutral/20"
|
2023-12-02 03:47:53 -06:00
|
|
|
} duration-100 py-5 px-2 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
2023-12-19 10:50:43 -06:00
|
|
|
<i className="bi-archive text-primary text-2xl"></i>
|
2023-11-24 07:39:55 -06:00
|
|
|
<p className="truncate w-full pr-7">Archive</p>
|
2023-10-16 12:10:52 -05:00
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
|
2024-01-13 00:20:06 -06:00
|
|
|
<Link href="/settings/access-tokens">
|
2023-11-20 11:48:41 -06:00
|
|
|
<div
|
|
|
|
className={`${
|
2024-01-13 00:20:06 -06:00
|
|
|
active === `/settings/access-tokens`
|
2023-12-01 15:29:17 -06:00
|
|
|
? "bg-primary/20"
|
2023-11-27 15:38:38 -06:00
|
|
|
: "hover:bg-neutral/20"
|
2023-12-02 03:47:53 -06:00
|
|
|
} duration-100 py-5 px-2 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-11-20 11:48:41 -06:00
|
|
|
>
|
2023-12-19 10:50:43 -06:00
|
|
|
<i className="bi-key text-primary text-2xl"></i>
|
2024-01-24 14:48:40 -06:00
|
|
|
<p className="truncate w-full pr-7">Access Tokens</p>
|
2023-11-20 11:48:41 -06:00
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
|
2023-10-16 12:10:52 -05:00
|
|
|
<Link href="/settings/password">
|
|
|
|
<div
|
|
|
|
className={`${
|
|
|
|
active === `/settings/password`
|
2023-12-01 15:29:17 -06:00
|
|
|
? "bg-primary/20"
|
2023-11-27 15:38:38 -06:00
|
|
|
: "hover:bg-neutral/20"
|
2023-12-02 03:47:53 -06:00
|
|
|
} duration-100 py-5 px-2 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
2023-12-19 10:50:43 -06:00
|
|
|
<i className="bi-lock text-primary text-2xl"></i>
|
2023-11-24 07:39:55 -06:00
|
|
|
<p className="truncate w-full pr-7">Password</p>
|
2023-10-16 12:10:52 -05:00
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
|
2023-11-06 07:25:57 -06:00
|
|
|
{process.env.NEXT_PUBLIC_STRIPE ? (
|
2023-10-16 12:10:52 -05:00
|
|
|
<Link href="/settings/billing">
|
|
|
|
<div
|
|
|
|
className={`${
|
|
|
|
active === `/settings/billing`
|
2023-12-01 15:29:17 -06:00
|
|
|
? "bg-primary/20"
|
2023-11-27 15:38:38 -06:00
|
|
|
: "hover:bg-neutral/20"
|
2023-12-02 03:47:53 -06:00
|
|
|
} duration-100 py-5 px-2 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
2023-12-19 10:50:43 -06:00
|
|
|
<i className="bi-credit-card text-primary text-xl"></i>
|
2023-11-24 07:39:55 -06:00
|
|
|
<p className="truncate w-full pr-7">Billing</p>
|
2023-10-16 12:10:52 -05:00
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
) : undefined}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="flex flex-col gap-1">
|
2023-11-09 10:44:49 -06:00
|
|
|
<Link
|
2023-11-11 15:15:07 -06:00
|
|
|
href={`https://github.com/linkwarden/linkwarden/releases`}
|
2023-11-09 10:44:49 -06:00
|
|
|
target="_blank"
|
2023-11-26 04:17:08 -06:00
|
|
|
className="text-neutral text-sm ml-2 hover:opacity-50 duration-100"
|
2023-11-09 10:44:49 -06:00
|
|
|
>
|
|
|
|
Linkwarden {LINKWARDEN_VERSION}
|
|
|
|
</Link>
|
2023-10-18 16:50:55 -05:00
|
|
|
<Link href="https://docs.linkwarden.app" target="_blank">
|
2023-10-16 12:10:52 -05:00
|
|
|
<div
|
2023-11-27 15:38:38 -06:00
|
|
|
className={`hover:bg-neutral/20 duration-100 py-2 px-2 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
2023-12-19 10:50:43 -06:00
|
|
|
<i className="bi-question-circle text-primary text-xl"></i>
|
2023-10-16 12:10:52 -05:00
|
|
|
|
2023-11-24 07:39:55 -06:00
|
|
|
<p className="truncate w-full pr-7">Help</p>
|
2023-10-16 12:10:52 -05:00
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
|
2023-10-18 16:50:55 -05:00
|
|
|
<Link href="https://github.com/linkwarden/linkwarden" target="_blank">
|
2023-10-16 12:10:52 -05:00
|
|
|
<div
|
2023-11-27 15:38:38 -06:00
|
|
|
className={`hover:bg-neutral/20 duration-100 py-2 px-2 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
2023-12-19 10:50:43 -06:00
|
|
|
<i className="bi-github text-primary text-xl"></i>
|
2023-11-24 07:39:55 -06:00
|
|
|
<p className="truncate w-full pr-7">GitHub</p>
|
2023-10-16 12:10:52 -05:00
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
|
2023-10-20 14:34:47 -05:00
|
|
|
<Link href="https://twitter.com/LinkwardenHQ" target="_blank">
|
2023-10-16 12:10:52 -05:00
|
|
|
<div
|
2023-11-27 15:38:38 -06:00
|
|
|
className={`hover:bg-neutral/20 duration-100 py-2 px-2 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
2023-12-19 10:50:43 -06:00
|
|
|
<i className="bi-twitter-x text-primary text-xl"></i>
|
2023-11-24 07:39:55 -06:00
|
|
|
<p className="truncate w-full pr-7">Twitter</p>
|
2023-10-16 12:10:52 -05:00
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
|
2023-10-18 16:50:55 -05:00
|
|
|
<Link href="https://fosstodon.org/@linkwarden" target="_blank">
|
2023-10-16 12:10:52 -05:00
|
|
|
<div
|
2023-11-27 15:38:38 -06:00
|
|
|
className={`hover:bg-neutral/20 duration-100 py-2 px-2 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
2023-12-19 10:50:43 -06:00
|
|
|
<i className="bi-mastodon text-primary text-xl"></i>
|
2023-11-24 07:39:55 -06:00
|
|
|
<p className="truncate w-full pr-7">Mastodon</p>
|
2023-10-16 12:10:52 -05:00
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|