2023-10-28 14:50:37 +01:00
|
|
|
import { useParams } from "wouter";
|
2023-10-28 19:21:13 +01:00
|
|
|
import { useQuery } from "react-query";
|
|
|
|
import { fetchGuildReminders } from "../../api";
|
|
|
|
import { QueryKeys } from "../../consts";
|
2023-10-30 21:24:05 +00:00
|
|
|
import { EditReminder } from "../Reminder/EditReminder";
|
|
|
|
import { CreateReminder } from "../Reminder/CreateReminder";
|
2023-10-28 14:50:37 +01:00
|
|
|
|
|
|
|
export const GuildReminders = () => {
|
2023-10-28 19:21:13 +01:00
|
|
|
const { guild } = useParams();
|
2023-10-28 14:50:37 +01:00
|
|
|
|
2023-11-01 22:10:56 +00:00
|
|
|
const { isSuccess, data } = useQuery(fetchGuildReminders(guild));
|
2023-10-28 19:21:13 +01:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div style={{ margin: "0 12px 12px 12px" }}>
|
|
|
|
<strong>Create Reminder</strong>
|
|
|
|
<div id={"reminderCreator"}>
|
2023-10-30 21:24:05 +00:00
|
|
|
<CreateReminder></CreateReminder>
|
2023-10-28 19:21:13 +01:00
|
|
|
</div>
|
|
|
|
<br></br>
|
|
|
|
<div class={"field"}>
|
|
|
|
<div class={"columns is-mobile"}>
|
|
|
|
<div class={"column"}>
|
|
|
|
<strong>Reminders</strong>
|
|
|
|
</div>
|
|
|
|
<div class={"column is-narrow"}>
|
|
|
|
<div class="control has-icons-left">
|
|
|
|
<div class="select is-small">
|
|
|
|
<select id="orderBy">
|
|
|
|
<option value="time" selected>
|
|
|
|
Time
|
|
|
|
</option>
|
|
|
|
<option value="name">Name</option>
|
|
|
|
<option value="channel">Channel</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="icon is-small is-left">
|
|
|
|
<i class="fas fa-sort-amount-down"></i>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class={"column is-narrow"}>
|
|
|
|
<div class="control has-icons-left">
|
|
|
|
<div class="select is-small">
|
|
|
|
<select id="expandAll">
|
|
|
|
<option value="" selected></option>
|
|
|
|
<option value="expand">Expand All</option>
|
|
|
|
<option value="collapse">Collapse All</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="icon is-small is-left">
|
|
|
|
<i class="fas fa-expand-arrows"></i>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id={"guildReminders"}>
|
|
|
|
{isSuccess &&
|
|
|
|
data.map((reminder) => <EditReminder reminder={reminder}></EditReminder>)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
2023-10-28 14:50:37 +01:00
|
|
|
};
|