2023-10-16 12:10:52 -05:00
|
|
|
import useCollectionStore from "@/store/collections";
|
|
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
|
|
import {
|
|
|
|
faUser,
|
|
|
|
faPalette,
|
|
|
|
faBoxArchive,
|
|
|
|
faKey,
|
|
|
|
} from "@fortawesome/free-solid-svg-icons";
|
|
|
|
import Link from "next/link";
|
|
|
|
import { useRouter } from "next/router";
|
|
|
|
import { useEffect, useState } from "react";
|
|
|
|
import {
|
|
|
|
faCircleQuestion,
|
|
|
|
faCreditCard,
|
|
|
|
} from "@fortawesome/free-regular-svg-icons";
|
|
|
|
import {
|
|
|
|
faGithub,
|
|
|
|
faMastodon,
|
|
|
|
faXTwitter,
|
|
|
|
} from "@fortawesome/free-brands-svg-icons";
|
|
|
|
|
|
|
|
export default function SettingsSidebar({ className }: { className?: string }) {
|
2023-11-09 10:44:49 -06:00
|
|
|
const LINKWARDEN_VERSION = "v2.1.0";
|
|
|
|
|
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-10-28 11:50:11 -05:00
|
|
|
className={`dark:bg-neutral-900 bg-white h-full w-64 overflow-y-auto border-solid border-white border dark:border-neutral-900 border-r-sky-100 dark:border-r-neutral-700 p-5 z-20 flex flex-col gap-5 justify-between ${
|
|
|
|
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-11-11 13:57:46 -06:00
|
|
|
? "bg-sky-500"
|
|
|
|
: "hover:bg-slate-500"
|
|
|
|
} duration-100 py-2 px-2 hover:bg-opacity-20 bg-opacity-20 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
|
|
|
<FontAwesomeIcon
|
|
|
|
icon={faUser}
|
|
|
|
className="w-6 h-6 text-sky-500 dark:text-sky-500"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<p className="text-black dark:text-white truncate w-full pr-7">
|
2023-10-18 16:50:55 -05:00
|
|
|
Account
|
2023-10-16 12:10:52 -05:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
<Link href="/settings/appearance">
|
|
|
|
<div
|
|
|
|
className={`${
|
|
|
|
active === `/settings/appearance`
|
2023-11-11 13:57:46 -06:00
|
|
|
? "bg-sky-500"
|
|
|
|
: "hover:bg-slate-500"
|
|
|
|
} duration-100 py-2 px-2 hover:bg-opacity-20 bg-opacity-20 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
|
|
|
<FontAwesomeIcon
|
|
|
|
icon={faPalette}
|
|
|
|
className="w-6 h-6 text-sky-500 dark:text-sky-500"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<p className="text-black dark:text-white truncate w-full pr-7">
|
|
|
|
Appearance
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
<Link href="/settings/archive">
|
|
|
|
<div
|
|
|
|
className={`${
|
|
|
|
active === `/settings/archive`
|
2023-11-11 13:57:46 -06:00
|
|
|
? "bg-sky-500"
|
|
|
|
: "hover:bg-slate-500"
|
|
|
|
} duration-100 py-2 px-2 hover:bg-opacity-20 bg-opacity-20 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
|
|
|
<FontAwesomeIcon
|
|
|
|
icon={faBoxArchive}
|
|
|
|
className="w-6 h-6 text-sky-500 dark:text-sky-500"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<p className="text-black dark:text-white truncate w-full pr-7">
|
|
|
|
Archive
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
<Link href="/settings/password">
|
|
|
|
<div
|
|
|
|
className={`${
|
|
|
|
active === `/settings/password`
|
2023-11-11 13:57:46 -06:00
|
|
|
? "bg-sky-500"
|
|
|
|
: "hover:bg-slate-500"
|
|
|
|
} duration-100 py-2 px-2 hover:bg-opacity-20 bg-opacity-20 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
|
|
|
<FontAwesomeIcon
|
|
|
|
icon={faKey}
|
|
|
|
className="w-6 h-6 text-sky-500 dark:text-sky-500"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<p className="text-black dark:text-white truncate w-full pr-7">
|
|
|
|
Password
|
|
|
|
</p>
|
|
|
|
</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-11-11 13:57:46 -06:00
|
|
|
? "bg-sky-500"
|
|
|
|
: "hover:bg-slate-500"
|
|
|
|
} duration-100 py-2 px-2 hover:bg-opacity-20 bg-opacity-20 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
|
|
|
<FontAwesomeIcon
|
|
|
|
icon={faCreditCard}
|
|
|
|
className="w-6 h-6 text-sky-500 dark:text-sky-500"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<p className="text-black dark:text-white truncate w-full pr-7">
|
|
|
|
Billing
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
) : undefined}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="flex flex-col gap-1">
|
2023-11-09 10:44:49 -06:00
|
|
|
<Link
|
|
|
|
href={`https://github.com/linkwarden/linkwarden/releases/tag/${LINKWARDEN_VERSION}`}
|
|
|
|
target="_blank"
|
|
|
|
className="dark:text-gray-300 text-gray-500 text-sm ml-2 hover:opacity-50 duration-100"
|
|
|
|
>
|
|
|
|
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-11 13:57:46 -06:00
|
|
|
className={`hover:bg-slate-500 duration-100 py-2 px-2 hover:bg-opacity-20 bg-opacity-20 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
|
|
|
<FontAwesomeIcon
|
2023-10-18 16:50:55 -05:00
|
|
|
icon={faCircleQuestion as any}
|
2023-10-16 12:10:52 -05:00
|
|
|
className="w-6 h-6 text-sky-500 dark:text-sky-500"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<p className="text-black dark:text-white truncate w-full pr-7">
|
2023-10-18 16:50:55 -05:00
|
|
|
Help
|
2023-10-16 12:10:52 -05:00
|
|
|
</p>
|
|
|
|
</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-11 13:57:46 -06:00
|
|
|
className={`hover:bg-slate-500 duration-100 py-2 px-2 hover:bg-opacity-20 bg-opacity-20 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
|
|
|
<FontAwesomeIcon
|
2023-10-18 16:50:55 -05:00
|
|
|
icon={faGithub as any}
|
2023-10-16 12:10:52 -05:00
|
|
|
className="w-6 h-6 text-sky-500 dark:text-sky-500"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<p className="text-black dark:text-white truncate w-full pr-7">
|
2023-10-18 16:50:55 -05:00
|
|
|
GitHub
|
2023-10-16 12:10:52 -05:00
|
|
|
</p>
|
|
|
|
</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-11 13:57:46 -06:00
|
|
|
className={`hover:bg-slate-500 duration-100 py-2 px-2 hover:bg-opacity-20 bg-opacity-20 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
|
|
|
<FontAwesomeIcon
|
2023-10-18 16:50:55 -05:00
|
|
|
icon={faXTwitter as any}
|
2023-10-16 12:10:52 -05:00
|
|
|
className="w-6 h-6 text-sky-500 dark:text-sky-500"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<p className="text-black dark:text-white truncate w-full pr-7">
|
2023-10-18 16:50:55 -05:00
|
|
|
Twitter
|
2023-10-16 12:10:52 -05:00
|
|
|
</p>
|
|
|
|
</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-11 13:57:46 -06:00
|
|
|
className={`hover:bg-slate-500 duration-100 py-2 px-2 hover:bg-opacity-20 bg-opacity-20 cursor-pointer flex items-center gap-2 w-full rounded-md h-8`}
|
2023-10-16 12:10:52 -05:00
|
|
|
>
|
|
|
|
<FontAwesomeIcon
|
2023-10-18 16:50:55 -05:00
|
|
|
icon={faMastodon as any}
|
2023-10-16 12:10:52 -05:00
|
|
|
className="w-6 h-6 text-sky-500 dark:text-sky-500"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<p className="text-black dark:text-white truncate w-full pr-7">
|
2023-10-18 16:50:55 -05:00
|
|
|
Mastodon
|
2023-10-16 12:10:52 -05:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|