Add dashboard to build
This commit is contained in:
32
reminder-dashboard/src/components/Sidebar/GuildEntry.tsx
Normal file
32
reminder-dashboard/src/components/Sidebar/GuildEntry.tsx
Normal file
@ -0,0 +1,32 @@
|
||||
import { GuildInfo } from "../../api";
|
||||
import { Link, useLocation } from "wouter";
|
||||
|
||||
type Props = {
|
||||
guild: GuildInfo;
|
||||
};
|
||||
|
||||
export const GuildEntry = ({ guild }: Props) => {
|
||||
const [loc] = useLocation();
|
||||
const currentId = loc.match(/^\/(?<id>\d+)/);
|
||||
|
||||
return (
|
||||
<li>
|
||||
<Link
|
||||
class={
|
||||
currentId !== null && guild.id === currentId.groups.id
|
||||
? "is-active switch-pane"
|
||||
: "switch-pane"
|
||||
}
|
||||
data-pane="guild"
|
||||
data-guild={guild.id}
|
||||
data-name={guild.name}
|
||||
href={`/${guild.id}/reminders`}
|
||||
>
|
||||
<span class="icon">
|
||||
<i class="fas fa-map-pin"></i>
|
||||
</span>{" "}
|
||||
<span class="guild-name">{guild.name}</span>
|
||||
</Link>
|
||||
</li>
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user