flockstr/components/Modals/NewEvent.tsx

70 lines
2.1 KiB
TypeScript
Raw Normal View History

2023-10-17 09:06:09 -04:00
"use client";
import { useState, useRef, useEffect } from "react";
import Link from "next/link";
import Template from "./Template";
import { Button } from "@/components/ui/button";
import { useModal } from "@/app/_providers/modal/provider";
import { nip19 } from "nostr-tools";
// import { useKeys } from "@/app/_providers/keysProvider";
import { useNDK } from "@/app/_providers/ndk";
import useCurrentUser from "@/lib/hooks/useCurrentUser";
import {
HiChatBubbleLeftEllipsis,
HiBookmarkSquare,
HiNewspaper,
2023-10-24 14:39:10 -04:00
HiCalendarDays,
2023-10-17 09:06:09 -04:00
} from "react-icons/hi2";
import { RiSubtractFill, RiAddFill } from "react-icons/ri";
import { formatCount } from "@/lib/utils";
import LoginModal from "./Login";
2023-10-17 14:25:26 -04:00
import CreateList from "./CreateList";
2023-10-18 08:15:06 -04:00
import ShortTextNoteModal from "./ShortTextNote";
2023-10-23 14:14:56 -04:00
import CreateCalendarEventModal from "./CreateCalendarEvent";
2023-10-27 20:31:13 -04:00
import CreateCalendarModal from "./CreateCalendar";
2023-10-17 09:06:09 -04:00
export default function NewEventModal() {
const modal = useModal();
return (
<Template title="New Event" className="md:max-w-[400px]">
<div className="flex flex-col gap-y-5">
<Button
onClick={() => {
2023-10-18 08:15:06 -04:00
modal?.swap(<ShortTextNoteModal />);
2023-10-17 09:06:09 -04:00
}}
className="w-full gap-x-1"
>
<span>Short Text</span>
<HiChatBubbleLeftEllipsis className="h-4 w-4" />
</Button>
2023-10-23 14:14:56 -04:00
<Button
onClick={() => {
modal?.swap(<CreateCalendarEventModal />);
}}
className="w-full gap-x-1"
>
<span>Calendar Event</span>
2023-10-27 20:31:13 -04:00
<HiNewspaper className="h-4 w-4" />
2023-10-23 14:14:56 -04:00
</Button>
2023-10-17 14:25:26 -04:00
<Button
2023-10-27 20:31:13 -04:00
onClick={() => {
modal?.swap(<CreateCalendarModal />);
}}
className="w-full gap-x-1"
>
<span>Create Calendar</span>
<HiCalendarDays className="h-4 w-4" />
</Button>
{/* <Button
2023-10-17 14:25:26 -04:00
onClick={() => {
modal?.swap(<CreateList />);
}}
className="w-full gap-x-1"
>
2023-10-17 09:06:09 -04:00
<span>Content List</span>
<HiBookmarkSquare className="h-4 w-4" />
2023-10-27 20:31:13 -04:00
</Button> */}
2023-10-17 09:06:09 -04:00
</div>
</Template>
);
}