The weeb for the next gen discord boat - Wamellow wamellow.com
bot discord
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor notification components

Luna 8293d34d 85d4f64c

+44 -41
+6 -1
app/dashboard/[guildId]/layout.tsx
··· 7 7 import { useCookies } from "next-client-cookies"; 8 8 import { Suspense, useEffect, useState } from "react"; 9 9 import { BiLogoYoutube } from "react-icons/bi"; 10 - import { HiArrowNarrowLeft, HiChartBar, HiCode, HiCursorClick, HiEye, HiHome, HiShare, HiStar, HiUserAdd, HiUsers, HiViewGridAdd } from "react-icons/hi"; 10 + import { HiArrowNarrowLeft, HiChartBar, HiCode, HiCursorClick, HiEye, HiHome, HiPaperAirplane, HiShare, HiStar, HiUserAdd, HiUsers, HiViewGridAdd } from "react-icons/hi"; 11 11 import { useQuery } from "react-query"; 12 12 13 13 import { guildStore } from "@/common/guilds"; ··· 206 206 name: "YouTube Notifications", 207 207 value: "/notifications", 208 208 icon: <BiLogoYoutube /> 209 + }, 210 + { 211 + name: "Dailyposts", 212 + value: "/dailyposts", 213 + icon: <HiPaperAirplane className="rotate-45" /> 209 214 }, 210 215 { 211 216 name: "NSFW Moderation",
-1
app/dashboard/[guildId]/notifications/create.component.tsx
··· 90 90 "Content-Type": "application/json" 91 91 }, 92 92 body: JSON.stringify({ 93 - guildId, 94 93 type: 0, 95 94 channelId, 96 95 creatorHandle: isId ? undefined : validated,
+38 -39
app/dashboard/[guildId]/notifications/delete.component.tsx
··· 10 10 interface Props { 11 11 id: string | null; 12 12 name: string; 13 + 13 14 remove: (id: string) => void; 14 15 } 15 16 16 17 export default function DeleteNotification({ 17 18 id, 18 19 name, 20 + 19 21 remove 20 22 }: Props) { 21 23 const guildId = guildStore((g) => g?.id); 22 24 const [open, setOpen] = useState(false); 23 25 24 - return ( 25 - <> 26 - <Tooltip 27 - content="Delete Notification" 28 - closeDelay={0} 26 + return (<> 27 + <Tooltip 28 + content="Delete Notification" 29 + closeDelay={0} 30 + > 31 + <Button 32 + isIconOnly 33 + color="danger" 34 + variant="flat" 35 + onClick={() => setOpen(true)} 36 + isDisabled={!id} 29 37 > 30 - <Button 31 - isIconOnly 32 - color="danger" 33 - variant="flat" 34 - onClick={() => setOpen(true)} 35 - isDisabled={!id} 36 - > 37 - <span> 38 - <HiTrash /> 39 - </span> 40 - <span className="sr-only">Delete selected notification</span> 41 - </Button> 42 - </Tooltip> 38 + <span> 39 + <HiTrash /> 40 + </span> 41 + <span className="sr-only">Delete selected notification</span> 42 + </Button> 43 + </Tooltip> 43 44 44 - <Modal 45 - buttonName="Delete" 46 - variant="danger" 47 - title={"Delete Notification: " + name} 48 - isOpen={open} 49 - onClose={() => setOpen(false)} 50 - onSubmit={() => { 51 - return fetch(`${process.env.NEXT_PUBLIC_API}/guilds/${guildId}/modules/notifications/${id}`, { 52 - method: "DELETE", 53 - credentials: "include" 54 - }); 55 - }} 56 - onSuccess={() => { 57 - if (id) remove(id); 58 - }} 59 - > 60 - Are you sure you want to delete the {'"'}{name}{'"'} channel from posting notifications? It will be gone forever, probably, who knows. 61 - </Modal> 62 - </> 63 - ); 64 - 45 + <Modal 46 + buttonName="Delete" 47 + variant="danger" 48 + title={"Delete Notification: " + name} 49 + isOpen={open} 50 + onClose={() => setOpen(false)} 51 + onSubmit={() => { 52 + return fetch(`${process.env.NEXT_PUBLIC_API}/guilds/${guildId}/modules/notifications/${id}`, { 53 + method: "DELETE", 54 + credentials: "include" 55 + }); 56 + }} 57 + onSuccess={() => { 58 + if (id) remove(id); 59 + }} 60 + > 61 + Are you sure you want to delete the {'"'}{name}{'"'} channel from posting notifications? It will be gone forever, probably, who knows. 62 + </Modal> 63 + </>); 65 64 }