Add dashboard to build
This commit is contained in:
27
reminder-dashboard/src/components/Guild/index.tsx
Normal file
27
reminder-dashboard/src/components/Guild/index.tsx
Normal file
@ -0,0 +1,27 @@
|
||||
import { useQuery } from "react-query";
|
||||
import { fetchGuildInfo } from "../../api";
|
||||
import { useParams } from "wouter";
|
||||
import { GuildReminders } from "./GuildReminders";
|
||||
import { GuildError } from "./GuildError";
|
||||
import { createPortal } from "preact/compat";
|
||||
import { Import } from "../Import";
|
||||
|
||||
export const Guild = () => {
|
||||
const { guild } = useParams();
|
||||
const { isSuccess, data: guildInfo } = useQuery(fetchGuildInfo(guild));
|
||||
|
||||
if (!isSuccess) {
|
||||
return <></>;
|
||||
} else if (guildInfo.error) {
|
||||
return <GuildError />;
|
||||
} else {
|
||||
const importModal = createPortal(<Import />, document.getElementById("bottom-sidebar"));
|
||||
|
||||
return (
|
||||
<>
|
||||
{importModal}
|
||||
<GuildReminders />
|
||||
</>
|
||||
);
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user