diff --git a/app/(app)/alpha/new/[[...postIdArr]]/_client.tsx b/app/(app)/alpha/new/[[...postIdArr]]/_client.tsx index c9ea67c9..d459ac6b 100644 --- a/app/(app)/alpha/new/[[...postIdArr]]/_client.tsx +++ b/app/(app)/alpha/new/[[...postIdArr]]/_client.tsx @@ -2,7 +2,12 @@ import { redirect, useParams } from "next/navigation"; import React, { useEffect, Fragment } from "react"; import { Controller } from "react-hook-form"; -import { Disclosure, Transition } from "@headlessui/react"; +import { + Disclosure, + DisclosureButton, + DisclosurePanel, + Transition, +} from "@headlessui/react"; import { ChevronUpIcon } from "@heroicons/react/20/solid"; import Editor from "@/components/editor/editor"; import RenderPost from "@/components/editor/editor/RenderPost"; @@ -57,7 +62,7 @@ const Create = () => { Preview
- +
-
+ {dataStatus === "loading" && postId && (
diff --git a/app/(app)/alpha/settings/_client.tsx b/app/(app)/alpha/settings/_client.tsx index 1bce13f8..4b08de9c 100644 --- a/app/(app)/alpha/settings/_client.tsx +++ b/app/(app)/alpha/settings/_client.tsx @@ -1,7 +1,7 @@ "use client"; import { useEffect, useState } from "react"; -import { Switch } from "@headlessui/react"; +import { Description, Field, Label, Switch } from "@headlessui/react"; import { zodResolver } from "@hookform/resolvers/zod"; import type { SubmitHandler } from "react-hook-form"; import { useForm } from "react-hook-form"; @@ -357,17 +357,17 @@ const Settings = ({ profile }: { profile: User }) => { aria-labelledby="privacy-heading" className="mt-2 divide-y divide-neutral-200" > -
- + - + + Occasional email notifications from the platform. - +
{ )} /> -
- +
- + - + + Opt-in to our weekly newsletter. - +
{ )} /> -
+
diff --git a/app/(app)/create/[[...paramsArr]]/_client.tsx b/app/(app)/create/[[...paramsArr]]/_client.tsx index e529b128..85e9d96e 100644 --- a/app/(app)/create/[[...paramsArr]]/_client.tsx +++ b/app/(app)/create/[[...paramsArr]]/_client.tsx @@ -5,7 +5,12 @@ import React, { useState, useEffect, Fragment, useRef } from "react"; import { useForm } from "react-hook-form"; import CustomTextareaAutosize from "@/components/CustomTextareAutosize/CustomTextareaAutosize"; import { toast } from "sonner"; -import { Disclosure, Transition } from "@headlessui/react"; +import { + Disclosure, + DisclosureButton, + DisclosurePanel, + Transition, +} from "@headlessui/react"; import { ChevronUpIcon } from "@heroicons/react/20/solid"; import type { SavePostInput } from "@/schema/post"; import { ConfirmPostSchema } from "@/schema/post"; @@ -363,7 +368,7 @@ const Create = ({ session }: { session: Session }) => { return ( <> - +
- + {dataStatus === "loading" && postId && (
diff --git a/app/(app)/my-posts/_client.tsx b/app/(app)/my-posts/_client.tsx index 91e1b3f7..49389e0d 100644 --- a/app/(app)/my-posts/_client.tsx +++ b/app/(app)/my-posts/_client.tsx @@ -1,7 +1,13 @@ "use client"; import { useState, Fragment } from "react"; -import { Transition, Menu } from "@headlessui/react"; +import { + Transition, + Menu, + MenuButton, + MenuItems, + MenuItem, +} from "@headlessui/react"; import Link from "next/link"; import { ChevronDownIcon, @@ -167,13 +173,13 @@ const MyPosts = () => { className="relative inline-block text-left" >
- + Options +
{ leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95" > - +
- - {({ active }) => ( - - - - - {({ active }) => ( - - )} - + + + + + + +
-
+
diff --git a/app/(app)/settings/_client.tsx b/app/(app)/settings/_client.tsx index c2ff6542..833b70d2 100644 --- a/app/(app)/settings/_client.tsx +++ b/app/(app)/settings/_client.tsx @@ -1,7 +1,7 @@ "use client"; import { useEffect, useState } from "react"; -import { Switch } from "@headlessui/react"; +import { Description, Field, Label, Switch } from "@headlessui/react"; import { zodResolver } from "@hookform/resolvers/zod"; import type { SubmitHandler } from "react-hook-form"; import { useForm } from "react-hook-form"; @@ -357,17 +357,17 @@ const Settings = ({ profile }: { profile: User }) => { aria-labelledby="privacy-heading" className="mt-2 divide-y divide-neutral-200" > -
- + - + + Occasional email notifications from the platform. - +
{ )} /> -
- +
- + - + + Opt-in to our weekly newsletter. - +
{ )} /> -
+
diff --git a/components/ArticleMenu/ArticleMenu.tsx b/components/ArticleMenu/ArticleMenu.tsx index a97aca71..2e4a1448 100644 --- a/components/ArticleMenu/ArticleMenu.tsx +++ b/components/ArticleMenu/ArticleMenu.tsx @@ -1,6 +1,11 @@ "use client"; -import { Popover, Transition } from "@headlessui/react"; +import { + Popover, + PopoverButton, + PopoverPanel, + Transition, +} from "@headlessui/react"; import React, { Fragment, useEffect, useState } from "react"; import { api } from "@/server/trpc/react"; @@ -166,14 +171,14 @@ const ArticleMenu = ({ - Open user menu - + - @@ -223,7 +228,7 @@ const ArticleMenu = ({
- +
diff --git a/components/ArticlePreview/ArticlePreview.tsx b/components/ArticlePreview/ArticlePreview.tsx index 4c724ead..766df4af 100644 --- a/components/ArticlePreview/ArticlePreview.tsx +++ b/components/ArticlePreview/ArticlePreview.tsx @@ -8,7 +8,13 @@ import { BookmarkIcon, EllipsisHorizontalIcon, } from "@heroicons/react/20/solid"; -import { Menu, Transition } from "@headlessui/react"; +import { + Menu, + MenuButton, + MenuItem, + MenuItems, + Transition, +} from "@headlessui/react"; import { api } from "@/server/trpc/react"; import { signIn, useSession } from "next-auth/react"; @@ -160,10 +166,10 @@ const ArticlePreview: NextPage = ({ {menuOptions && (
- + Open user menu - +
= ({ leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95" > - + {menuOptions.map((item) => ( - + {"href" in item ? ( = ({ {item.label} )} - + ))} - +
)} diff --git a/components/Comments/CommentsArea.tsx b/components/Comments/CommentsArea.tsx index 86b730f1..e98c7e4c 100644 --- a/components/Comments/CommentsArea.tsx +++ b/components/Comments/CommentsArea.tsx @@ -1,7 +1,13 @@ "use client"; import React, { useEffect } from "react"; -import { Menu, Transition } from "@headlessui/react"; +import { + Menu, + MenuButton, + MenuItem, + MenuItems, + Transition, +} from "@headlessui/react"; import { EllipsisHorizontalIcon } from "@heroicons/react/20/solid"; import { signIn, useSession } from "next-auth/react"; import { useForm } from "react-hook-form"; @@ -249,10 +255,10 @@ const CommentsArea = ({ postId, postOwnerId }: Props) => { {isCurrentUser ? (
- + Open user menu - +
{ leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95" > - + <> - + - - + + - + - +
) : null} diff --git a/components/ImageDetailsModal/ImageDetailsModal.tsx b/components/ImageDetailsModal/ImageDetailsModal.tsx index bd83cc53..de6b028b 100644 --- a/components/ImageDetailsModal/ImageDetailsModal.tsx +++ b/components/ImageDetailsModal/ImageDetailsModal.tsx @@ -6,7 +6,7 @@ import { XIcon } from "lucide-react"; import { z } from "zod"; import { zodResolver } from "@hookform/resolvers/zod"; import { useForm } from "react-hook-form"; -import { Dialog } from "@headlessui/react"; +import { Description, DialogTitle } from "@headlessui/react"; const imageDetailsSchema = z.object({ src: z @@ -62,14 +62,14 @@ export default function ImageDetailsModal(props: Props) { }} > <> - + Image details - + - + Please enter a URL for the image, along with an alt description and a title. - +
diff --git a/components/Modal/Modal.tsx b/components/Modal/Modal.tsx index 72f5d751..701d950b 100644 --- a/components/Modal/Modal.tsx +++ b/components/Modal/Modal.tsx @@ -1,5 +1,10 @@ import React, { Fragment } from "react"; -import { Dialog, Transition } from "@headlessui/react"; +import { + Dialog, + DialogPanel, + Transition, + TransitionChild, +} from "@headlessui/react"; interface Props { open: boolean; @@ -9,9 +14,9 @@ interface Props { export function Modal({ open, onClose, children }: Props) { return ( - + -
- +
- - + {children} - - + +
-
+ ); } diff --git a/components/Nav/MobileNav.tsx b/components/Nav/MobileNav.tsx index e1717527..2bfa83c4 100644 --- a/components/Nav/MobileNav.tsx +++ b/components/Nav/MobileNav.tsx @@ -1,5 +1,10 @@ import { type UserNavigationItem } from "@/types/types"; -import { Disclosure, Transition } from "@headlessui/react"; +import { + Disclosure, + DisclosureButton, + DisclosurePanel, + Transition, +} from "@headlessui/react"; import { type Session } from "next-auth"; import { PromptLink as Link } from "../PromptService/PromptLink"; import { type MutableRefObject, useRef, type FunctionComponent } from "react"; @@ -27,7 +32,7 @@ const MobileNav: FunctionComponent = ({ enterTo="transform translate-y-0 opacity-100" className="absolute z-10 w-screen bg-neutral-100 dark:bg-black" > - +
{navigation.map((item) => ( @@ -69,12 +74,12 @@ const MobileNav: FunctionComponent = ({ ) : ( - {item.name} - + ), )} @@ -82,7 +87,7 @@ const MobileNav: FunctionComponent = ({
)} - + ); }; @@ -99,7 +104,7 @@ interface NavItemProps { const NavItem: FunctionComponent = ({ item }) => { return item.href.includes("http") ? ( - = ({ item }) => { className="nav-button flex w-full items-center text-sm font-medium lg:text-base" > {item.name} - + ) : ( - {item.name} - + ); }; @@ -140,7 +145,7 @@ const SubNav: FunctionComponent = ({ session, close }) => { <> {data.map((item) => ( - = ({ session, close }) => { )} > {item.name} - + ))} diff --git a/components/Nav/Nav.tsx b/components/Nav/Nav.tsx index 80534b76..e376b641 100644 --- a/components/Nav/Nav.tsx +++ b/components/Nav/Nav.tsx @@ -1,6 +1,14 @@ "use client"; import { api } from "@/server/trpc/react"; -import { Disclosure, Menu, Transition } from "@headlessui/react"; +import { + Disclosure, + DisclosureButton, + Menu, + MenuButton, + MenuItem, + MenuItems, + Transition, +} from "@headlessui/react"; import { BellIcon, PlusIcon } from "@heroicons/react/20/solid"; import { signIn, signOut } from "next-auth/react"; import { PromptLink as Link } from "../PromptService/PromptLink"; @@ -139,7 +147,7 @@ const Nav = ({
- + Open user menu {session.user?.image ? ( )} - +
- + {userNavigation.map((item) => ( - + {item.onClick ? (
@@ -208,10 +216,10 @@ const Nav = ({ )} {/* Mobile menu button */} - + Open main menu - + diff --git a/components/PromptService/PromptDialog.tsx b/components/PromptService/PromptDialog.tsx index 29beced3..ea4d3d70 100644 --- a/components/PromptService/PromptDialog.tsx +++ b/components/PromptService/PromptDialog.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Modal } from "../Modal/Modal"; import { ExclamationCircleIcon, XMarkIcon } from "@heroicons/react/20/solid"; -import { Dialog } from "@headlessui/react"; +import { DialogTitle } from "@headlessui/react"; export interface serviceProps { confirm: () => void; @@ -42,12 +42,12 @@ export const PromptDialog = ({ />
- {title} - +

{subTitle}

{content && ( diff --git a/components/ReportModal/ReportModal.tsx b/components/ReportModal/ReportModal.tsx index b1b96695..bb956e4f 100644 --- a/components/ReportModal/ReportModal.tsx +++ b/components/ReportModal/ReportModal.tsx @@ -3,7 +3,12 @@ import { XMarkIcon, FlagIcon } from "@heroicons/react/20/solid"; import { toast } from "sonner"; import { signIn, useSession } from "next-auth/react"; import { api } from "@/server/trpc/react"; -import { Dialog } from "@headlessui/react"; +import { + Description, + Dialog, + DialogPanel, + DialogTitle, +} from "@headlessui/react"; type Props = Post | Comment; @@ -109,13 +114,13 @@ export const ReportModal = (props: Props) => { >