More work on todo list

This commit is contained in:
jude
2024-04-09 21:21:46 +01:00
parent e128b9848f
commit 4063334953
7 changed files with 242 additions and 49 deletions

View File

@ -5,6 +5,7 @@ import { createPortal, PropsWithChildren } from "preact/compat";
import { Import } from "../Import";
import { useGuild } from "../App/useGuild";
import { Link } from "wouter";
import { usePathname } from "wouter/use-browser-location";
import "./index.scss";
@ -18,13 +19,14 @@ export const Guild = ({ children }: PropsWithChildren) => {
return <GuildError />;
} else {
const importModal = createPortal(<Import />, document.getElementById("bottom-sidebar"));
const path = usePathname();
return (
<>
{importModal}
<div class="page-links">
<Link
class="button is-outlined is-success is-small"
class={`button is-outlined is-success is-small ${path.endsWith("reminders") && "is-focused"}`}
href={`/${guild}/reminders`}
>
<span>Reminders</span>
@ -32,7 +34,10 @@ export const Guild = ({ children }: PropsWithChildren) => {
<i class="fa fa-chevron-right"></i>
</span>
</Link>
<Link class="button is-outlined is-success is-small" href={`/${guild}/todos`}>
<Link
class={`button is-outlined is-success is-small ${path.endsWith("todos") && "is-focused"}`}
href={`/${guild}/todos`}
>
<span>Todo lists</span>
<span class="icon">
<i class="fa fa-chevron-right"></i>