Start adding stuff for user reminders
This commit is contained in:
parent
329492b244
commit
85a114e55c
@ -175,3 +175,10 @@ export const deleteGuildTemplate = (guild: string) => ({
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
export const fetchUserReminders = () => ({
|
||||
queryKey: ["USER_REMINDERS"],
|
||||
queryFn: () =>
|
||||
axios.get(`/dashboard/api/user/reminders`).then((resp) => resp.data) as Promise<Reminder[]>,
|
||||
staleTime: OTHER_STALE_TIME,
|
||||
});
|
||||
|
@ -5,6 +5,7 @@ import { Welcome } from "../Welcome";
|
||||
import { Guild } from "../Guild";
|
||||
import { FlashProvider } from "./FlashProvider";
|
||||
import { TimezoneProvider } from "./TimezoneProvider";
|
||||
import { User } from "../User";
|
||||
|
||||
export function App() {
|
||||
const queryClient = new QueryClient();
|
||||
@ -18,6 +19,7 @@ export function App() {
|
||||
<Sidebar />
|
||||
<div class="column is-main-content">
|
||||
<Switch>
|
||||
<Route path={"/@me/reminders"} component={User}></Route>
|
||||
<Route path={"/:guild/reminders"} component={Guild}></Route>
|
||||
<Route>
|
||||
<Welcome />
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { useParams } from "wouter";
|
||||
import { useQuery } from "react-query";
|
||||
import { fetchGuildChannels, fetchGuildReminders } from "../../api";
|
||||
import { EditReminder } from "../Reminder/EditReminder";
|
||||
import { CreateReminder } from "../Reminder/CreateReminder";
|
||||
import { useState } from "preact/hooks";
|
||||
import { Loader } from "../Loader";
|
||||
import { useGuild } from "../App/useGuild";
|
||||
|
||||
enum Sort {
|
||||
Time = "time",
|
||||
@ -13,7 +13,7 @@ enum Sort {
|
||||
}
|
||||
|
||||
export const GuildReminders = () => {
|
||||
const { guild } = useParams();
|
||||
const guild = useGuild();
|
||||
|
||||
const {
|
||||
isSuccess,
|
||||
|
@ -1,13 +1,13 @@
|
||||
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";
|
||||
import { useGuild } from "../App/useGuild";
|
||||
|
||||
export const Guild = () => {
|
||||
const { guild } = useParams();
|
||||
const guild = useGuild();
|
||||
const { isSuccess, data: guildInfo } = useQuery(fetchGuildInfo(guild));
|
||||
|
||||
if (!isSuccess) {
|
||||
|
3
reminder-dashboard/src/components/User/UserReminders.tsx
Normal file
3
reminder-dashboard/src/components/User/UserReminders.tsx
Normal file
@ -0,0 +1,3 @@
|
||||
export const UserReminders = () => {
|
||||
return <></>;
|
||||
};
|
9
reminder-dashboard/src/components/User/index.tsx
Normal file
9
reminder-dashboard/src/components/User/index.tsx
Normal file
@ -0,0 +1,9 @@
|
||||
import { UserReminders } from "./UserReminders";
|
||||
|
||||
export const User = () => {
|
||||
return (
|
||||
<>
|
||||
<UserReminders />
|
||||
</>
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue
Block a user