2022-01-01 02:31:55 +00:00
|
|
|
import Link from "next/link";
|
2022-01-03 02:40:54 +00:00
|
|
|
import NavOption from "components/PanelComponents/NavOption";
|
2022-01-29 09:43:51 +00:00
|
|
|
import { useRouter } from "next/router";
|
2022-01-29 16:52:47 +00:00
|
|
|
import Button from "components/Button";
|
|
|
|
import HorizontalLine from "components/HorizontalLine";
|
2022-02-12 10:02:22 +00:00
|
|
|
import { GetWebsiteInterfaceQuery } from "graphql/operations-types";
|
|
|
|
import Markdown from "markdown-to-jsx";
|
2022-02-20 13:59:56 +00:00
|
|
|
import { useMediaDesktop } from "hooks/useMediaQuery";
|
2022-02-22 12:53:44 +00:00
|
|
|
import { useAppLayout } from "contexts/AppLayoutContext";
|
2021-11-04 18:48:31 +00:00
|
|
|
|
2022-02-15 14:50:51 +00:00
|
|
|
type MainPanelProps = {
|
2022-02-12 10:02:22 +00:00
|
|
|
langui: GetWebsiteInterfaceQuery["websiteInterfaces"]["data"][number]["attributes"];
|
|
|
|
};
|
|
|
|
|
2022-02-15 14:50:51 +00:00
|
|
|
export default function MainPanel(props: MainPanelProps): JSX.Element {
|
2022-02-12 10:02:22 +00:00
|
|
|
const langui = props.langui;
|
2022-01-29 09:43:51 +00:00
|
|
|
const router = useRouter();
|
2022-02-20 13:59:56 +00:00
|
|
|
const isDesktop = useMediaDesktop();
|
2022-02-22 12:53:44 +00:00
|
|
|
const appLayout = useAppLayout();
|
2022-02-20 12:49:44 +00:00
|
|
|
|
2021-11-04 11:45:18 +00:00
|
|
|
return (
|
2022-02-17 04:50:18 +00:00
|
|
|
<div
|
2022-02-21 00:01:27 +00:00
|
|
|
className={`flex flex-col justify-center content-start gap-y-2 justify-items-center text-center p-8 ${
|
2022-02-23 23:57:43 +00:00
|
|
|
appLayout.mainPanelReduced && isDesktop && "px-4"
|
2022-02-21 00:01:27 +00:00
|
|
|
}`}
|
2022-02-17 04:50:18 +00:00
|
|
|
>
|
2022-02-23 12:13:05 +00:00
|
|
|
<div>
|
|
|
|
<div className="grid place-items-center">
|
2022-01-29 16:52:47 +00:00
|
|
|
<Link href="/" passHref>
|
2022-02-22 12:53:44 +00:00
|
|
|
<div
|
|
|
|
onClick={() => appLayout.setMainPanelOpen(false)}
|
2022-02-23 12:13:05 +00:00
|
|
|
className={`${
|
|
|
|
appLayout.mainPanelReduced && isDesktop ? "w-12" : "w-1/2"
|
2022-02-24 01:06:25 +00:00
|
|
|
} aspect-square cursor-pointer transition-colors [mask:url('/icons/accords.svg')] ![mask-size:contain] ![mask-repeat:no-repeat] ![mask-position:center] bg-black hover:bg-dark mb-4`}
|
|
|
|
></div>
|
2022-01-29 16:52:47 +00:00
|
|
|
</Link>
|
2022-02-23 12:13:05 +00:00
|
|
|
|
|
|
|
{appLayout.mainPanelReduced && isDesktop ? (
|
2022-02-20 12:49:44 +00:00
|
|
|
""
|
2022-02-23 12:13:05 +00:00
|
|
|
) : (
|
|
|
|
<h2 className="text-3xl">Accord’s Library</h2>
|
2022-02-20 12:49:44 +00:00
|
|
|
)}
|
2022-02-22 02:55:38 +00:00
|
|
|
|
2022-02-23 12:13:05 +00:00
|
|
|
<div
|
|
|
|
className={`flex ${
|
2022-02-24 01:06:25 +00:00
|
|
|
appLayout.mainPanelReduced && isDesktop
|
|
|
|
? "flex-col gap-3"
|
|
|
|
: "flex-row"
|
2022-02-23 12:13:05 +00:00
|
|
|
} flex-wrap gap-2`}
|
|
|
|
>
|
|
|
|
<Button
|
|
|
|
className={
|
|
|
|
appLayout.mainPanelReduced && isDesktop ? "" : "!py-0.5 !px-2.5"
|
|
|
|
}
|
2022-03-06 15:50:17 +00:00
|
|
|
onClick={() => {
|
|
|
|
appLayout.setConfigPanelOpen(true);
|
|
|
|
}}
|
2022-02-23 12:13:05 +00:00
|
|
|
>
|
2022-03-06 15:50:17 +00:00
|
|
|
<span
|
|
|
|
className={`material-icons ${
|
|
|
|
!(appLayout.mainPanelReduced && isDesktop) && "!text-sm"
|
|
|
|
} `}
|
|
|
|
>
|
|
|
|
settings
|
2022-02-23 12:13:05 +00:00
|
|
|
</span>
|
|
|
|
</Button>
|
2022-02-22 02:55:38 +00:00
|
|
|
|
2022-02-23 12:13:05 +00:00
|
|
|
{router.locale && (
|
2022-02-22 02:55:38 +00:00
|
|
|
<Button
|
2022-02-23 12:13:05 +00:00
|
|
|
onClick={() => appLayout.setLanguagePanelOpen(true)}
|
|
|
|
className={
|
|
|
|
appLayout.mainPanelReduced && isDesktop
|
|
|
|
? ""
|
|
|
|
: "!py-0.5 !px-2.5 !text-sm"
|
|
|
|
}
|
2022-02-22 02:55:38 +00:00
|
|
|
>
|
2022-02-23 12:13:05 +00:00
|
|
|
{router.locale.toUpperCase()}
|
2022-02-22 02:55:38 +00:00
|
|
|
</Button>
|
2022-02-23 12:13:05 +00:00
|
|
|
)}
|
2022-01-29 09:43:51 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-02-23 12:13:05 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<HorizontalLine />
|
2022-01-01 02:31:55 +00:00
|
|
|
|
|
|
|
<NavOption
|
|
|
|
url="/library"
|
2022-01-03 02:40:54 +00:00
|
|
|
icon="library_books"
|
2022-03-05 14:36:43 +00:00
|
|
|
title={langui.library}
|
|
|
|
subtitle={langui.library_short_description}
|
2022-02-20 16:56:22 +00:00
|
|
|
tooltipId="MainPanelTooltip"
|
2022-02-22 12:53:44 +00:00
|
|
|
reduced={appLayout.mainPanelReduced && isDesktop}
|
|
|
|
onClick={() => appLayout.setMainPanelOpen(false)}
|
2022-02-21 18:08:15 +00:00
|
|
|
/>
|
|
|
|
|
|
|
|
<NavOption
|
|
|
|
url="/contents"
|
|
|
|
icon="workspaces"
|
2022-03-05 14:36:43 +00:00
|
|
|
title={langui.contents}
|
|
|
|
subtitle={langui.contents_short_description}
|
2022-02-21 18:08:15 +00:00
|
|
|
tooltipId="MainPanelTooltip"
|
2022-02-22 12:53:44 +00:00
|
|
|
reduced={appLayout.mainPanelReduced && isDesktop}
|
|
|
|
onClick={() => appLayout.setMainPanelOpen(false)}
|
2021-11-07 19:17:54 +00:00
|
|
|
/>
|
2022-01-01 02:31:55 +00:00
|
|
|
|
|
|
|
<NavOption
|
2022-02-16 16:09:46 +00:00
|
|
|
url="/wiki"
|
|
|
|
icon="travel_explore"
|
2022-03-05 14:36:43 +00:00
|
|
|
title={langui.wiki}
|
|
|
|
subtitle={langui.wiki_short_description}
|
2022-02-20 16:56:22 +00:00
|
|
|
tooltipId="MainPanelTooltip"
|
2022-02-22 12:53:44 +00:00
|
|
|
reduced={appLayout.mainPanelReduced && isDesktop}
|
|
|
|
onClick={() => appLayout.setMainPanelOpen(false)}
|
2021-11-07 19:17:54 +00:00
|
|
|
/>
|
2022-01-01 02:31:55 +00:00
|
|
|
|
|
|
|
<NavOption
|
2022-02-14 04:49:43 +00:00
|
|
|
url="/chronicles"
|
2022-01-03 02:40:54 +00:00
|
|
|
icon="watch_later"
|
2022-03-05 14:36:43 +00:00
|
|
|
title={langui.chronicles}
|
|
|
|
subtitle={langui.chronicles_short_description}
|
2022-02-20 16:56:22 +00:00
|
|
|
tooltipId="MainPanelTooltip"
|
2022-02-22 12:53:44 +00:00
|
|
|
reduced={appLayout.mainPanelReduced && isDesktop}
|
|
|
|
onClick={() => appLayout.setMainPanelOpen(false)}
|
2021-11-07 19:17:54 +00:00
|
|
|
/>
|
2021-11-04 11:45:18 +00:00
|
|
|
|
2022-01-29 16:52:47 +00:00
|
|
|
<HorizontalLine />
|
2021-11-04 11:45:18 +00:00
|
|
|
|
2022-02-20 12:49:44 +00:00
|
|
|
<NavOption
|
|
|
|
url="/news"
|
|
|
|
icon="feed"
|
2022-03-05 14:36:43 +00:00
|
|
|
title={langui.news}
|
2022-02-20 16:56:22 +00:00
|
|
|
tooltipId="MainPanelTooltip"
|
2022-02-22 12:53:44 +00:00
|
|
|
reduced={appLayout.mainPanelReduced && isDesktop}
|
|
|
|
onClick={() => appLayout.setMainPanelOpen(false)}
|
2022-02-20 12:49:44 +00:00
|
|
|
/>
|
|
|
|
|
|
|
|
<NavOption
|
|
|
|
url="/merch"
|
|
|
|
icon="store"
|
2022-03-05 14:36:43 +00:00
|
|
|
title={langui.merch}
|
2022-02-20 16:56:22 +00:00
|
|
|
tooltipId="MainPanelTooltip"
|
2022-02-22 12:53:44 +00:00
|
|
|
reduced={appLayout.mainPanelReduced && isDesktop}
|
|
|
|
onClick={() => appLayout.setMainPanelOpen(false)}
|
2022-02-20 12:49:44 +00:00
|
|
|
/>
|
|
|
|
|
2022-02-12 10:02:22 +00:00
|
|
|
<NavOption
|
|
|
|
url="/gallery"
|
|
|
|
icon="collections"
|
2022-03-05 14:36:43 +00:00
|
|
|
title={langui.gallery}
|
2022-02-20 16:56:22 +00:00
|
|
|
tooltipId="MainPanelTooltip"
|
2022-02-22 12:53:44 +00:00
|
|
|
reduced={appLayout.mainPanelReduced && isDesktop}
|
|
|
|
onClick={() => appLayout.setMainPanelOpen(false)}
|
2022-02-12 10:02:22 +00:00
|
|
|
/>
|
2022-02-20 12:49:44 +00:00
|
|
|
|
2022-02-12 10:02:22 +00:00
|
|
|
<NavOption
|
|
|
|
url="/archives"
|
|
|
|
icon="inventory"
|
2022-03-05 14:36:43 +00:00
|
|
|
title={langui.archives}
|
2022-02-20 16:56:22 +00:00
|
|
|
tooltipId="MainPanelTooltip"
|
2022-02-22 12:53:44 +00:00
|
|
|
reduced={appLayout.mainPanelReduced && isDesktop}
|
|
|
|
onClick={() => appLayout.setMainPanelOpen(false)}
|
2022-02-12 10:02:22 +00:00
|
|
|
/>
|
2021-11-04 11:45:18 +00:00
|
|
|
|
2022-02-20 12:49:44 +00:00
|
|
|
<NavOption
|
|
|
|
url="/about-us"
|
|
|
|
icon="info"
|
2022-03-05 14:36:43 +00:00
|
|
|
title={langui.about_us}
|
2022-02-20 16:56:22 +00:00
|
|
|
tooltipId="MainPanelTooltip"
|
2022-02-22 12:53:44 +00:00
|
|
|
reduced={appLayout.mainPanelReduced && isDesktop}
|
|
|
|
onClick={() => appLayout.setMainPanelOpen(false)}
|
2022-02-20 12:49:44 +00:00
|
|
|
/>
|
|
|
|
|
2022-02-22 12:53:44 +00:00
|
|
|
{appLayout.mainPanelReduced && isDesktop ? "" : <HorizontalLine />}
|
2021-11-04 11:45:18 +00:00
|
|
|
|
2022-02-20 13:59:56 +00:00
|
|
|
<div
|
|
|
|
className={`text-center ${
|
2022-02-22 12:53:44 +00:00
|
|
|
appLayout.mainPanelReduced && isDesktop ? "hidden" : ""
|
2022-02-20 13:59:56 +00:00
|
|
|
}`}
|
|
|
|
>
|
2022-01-01 02:31:55 +00:00
|
|
|
<p>
|
2022-03-05 14:36:43 +00:00
|
|
|
{langui.licensing_notice ? (
|
|
|
|
<Markdown>{langui.licensing_notice}</Markdown>
|
2022-02-12 10:02:22 +00:00
|
|
|
) : (
|
|
|
|
""
|
|
|
|
)}
|
2022-01-01 02:31:55 +00:00
|
|
|
</p>
|
2022-01-03 02:40:54 +00:00
|
|
|
<a
|
2022-02-27 07:17:58 +00:00
|
|
|
aria-label="Read more about the license we use for this website"
|
2022-02-24 01:06:25 +00:00
|
|
|
className="transition-[filter] colorize-black hover:colorize-dark"
|
2022-01-03 02:40:54 +00:00
|
|
|
href="https://creativecommons.org/licenses/by-sa/4.0/"
|
|
|
|
>
|
2022-02-24 01:06:25 +00:00
|
|
|
<div className="mt-4 mb-8 grid grid-flow-col place-content-center gap-1 hover:[--theme-color-black:var(--theme-color-dark)]">
|
|
|
|
<div className="w-6 aspect-square [mask:url('/icons/creative-commons-brands.svg')] ![mask-size:contain] ![mask-repeat:no-repeat] ![mask-position:center] bg-black" />
|
|
|
|
<div className="w-6 aspect-square [mask:url('/icons/creative-commons-by-brands.svg')] ![mask-size:contain] ![mask-repeat:no-repeat] ![mask-position:center] bg-black" />
|
|
|
|
<div className="w-6 aspect-square [mask:url('/icons/creative-commons-sa-brands.svg')] ![mask-size:contain] ![mask-repeat:no-repeat] ![mask-position:center] bg-black" />
|
2021-11-04 18:48:31 +00:00
|
|
|
</div>
|
|
|
|
</a>
|
2022-01-01 02:31:55 +00:00
|
|
|
<p>
|
2022-03-05 14:36:43 +00:00
|
|
|
{langui.copyright_notice ? (
|
|
|
|
<Markdown>{langui.copyright_notice}</Markdown>
|
2022-02-12 10:02:22 +00:00
|
|
|
) : (
|
|
|
|
""
|
|
|
|
)}
|
2022-01-01 02:31:55 +00:00
|
|
|
</p>
|
2022-01-02 15:14:39 +00:00
|
|
|
<div className="mt-12 mb-4 grid h-4 grid-flow-col place-content-center gap-8">
|
2022-01-03 02:40:54 +00:00
|
|
|
<a
|
2022-02-27 07:17:58 +00:00
|
|
|
aria-label="Browse our GitHub repository, which include this website source code"
|
2022-02-24 01:06:25 +00:00
|
|
|
className="transition-colors [mask:url('/icons/github-brands.svg')] ![mask-size:contain] ![mask-repeat:no-repeat] ![mask-position:center] w-10 aspect-square bg-black hover:bg-dark"
|
2022-01-03 02:40:54 +00:00
|
|
|
href="https://github.com/Accords-Library"
|
2022-01-29 09:43:51 +00:00
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
2022-02-24 01:06:25 +00:00
|
|
|
></a>
|
2022-01-03 02:40:54 +00:00
|
|
|
<a
|
2022-02-27 07:17:58 +00:00
|
|
|
aria-label="Join our Discord server!"
|
2022-02-24 01:06:25 +00:00
|
|
|
className="transition-colors [mask:url('/icons/discord-brands.svg')] ![mask-size:contain] ![mask-repeat:no-repeat] ![mask-position:center] w-10 aspect-square bg-black hover:bg-dark"
|
2022-02-14 04:49:43 +00:00
|
|
|
href="/discord"
|
2022-01-29 09:43:51 +00:00
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
2022-02-24 01:06:25 +00:00
|
|
|
></a>
|
2021-11-04 11:45:18 +00:00
|
|
|
</div>
|
2021-11-04 18:48:31 +00:00
|
|
|
</div>
|
2021-11-04 11:45:18 +00:00
|
|
|
</div>
|
2022-01-01 02:31:55 +00:00
|
|
|
);
|
|
|
|
}
|