More work on todo list
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user