diff --git a/packages/next/app/signup/SignUpForm.tsx b/packages/next/app/signup/SignUpForm.tsx index 28ccddc..e511414 100644 --- a/packages/next/app/signup/SignUpForm.tsx +++ b/packages/next/app/signup/SignUpForm.tsx @@ -7,7 +7,7 @@ import { computeVdfInWorker } from "@/lib/vdf"; import useSWR from "swr"; import { ApiRequestError } from "@/lib/net"; import { Portal } from "@/components/utils/Portal"; -import { Dialog, DialogHeadline, DialogSupportingText } from "@/components/ui/Dialog"; +import { Dialog, DialogButton, DialogButtonGroup, DialogHeadline, DialogSupportingText } from "@/components/ui/Dialog"; import { FilledButton } from "@/components/ui/Buttons/FilledButton"; interface CaptchaSessionResponse { @@ -154,6 +154,9 @@ const SignUpForm: React.FC = ({ backendURL }) => {

Your operation frequency is too high. Please try again later. (RATE_LIMIT_EXCEED)

+ + setShowDialog(false)}>Close + ); }} @@ -166,9 +169,7 @@ const SignUpForm: React.FC = ({ backendURL }) => { {!loading ? 注册 : } - setShowDialog(false)}> - {dialogContent} - + {dialogContent} ); diff --git a/packages/next/components/shell/Header.tsx b/packages/next/components/shell/Header.tsx index 2ce8990..1dd6690 100644 --- a/packages/next/components/shell/Header.tsx +++ b/packages/next/components/shell/Header.tsx @@ -15,7 +15,6 @@ import { SearchIcon } from "@/components/icons/SearchIcon"; import { InfoIcon } from "@/components/icons/InfoIcon"; import { HomeIcon } from "@/components/icons/HomeIcon"; import { TextButton } from "@/components/ui/Buttons/TextButton"; -import { useRouter } from "next/navigation"; import Link from "next/link"; export const HeaderDestop = () => { diff --git a/packages/next/components/ui/Dialog.tsx b/packages/next/components/ui/Dialog.tsx index 1fc3d25..c866b6d 100644 --- a/packages/next/components/ui/Dialog.tsx +++ b/packages/next/components/ui/Dialog.tsx @@ -1,19 +1,22 @@ import { motion, AnimatePresence } from "framer-motion"; -import React, { useEffect, useRef } from "react"; +import React from "react"; import { TextButton } from "./Buttons/TextButton"; interface DialogProps { show: boolean; - onClose: () => void; children?: React.ReactNode; } -interface DialogHeadlineProps { +interface OptionalChidrenProps { children?: React.ReactNode; } -interface DialogSupportingTextProps { - children?: React.ReactNode; +type DialogHeadlineProps = OptionalChidrenProps; +type DialogSupportingTextProps = OptionalChidrenProps; +type DialogButtonGroupProps = OptionalChidrenProps; + +interface DialogButtonProps extends OptionalChidrenProps { + onClick?: React.MouseEventHandler; } export const DialogHeadline: React.FC = ({ children }: DialogHeadlineProps) => { @@ -23,7 +26,16 @@ export const DialogHeadline: React.FC = ({ children }: Dial export const DialogSupportingText: React.FC = ({ children }: DialogHeadlineProps) => { return
{children}
; }; -export const Dialog: React.FC = ({ show, onClose, children }: DialogProps) => { + +export const DialogButton: React.FC = ({ children, onClick }: DialogButtonProps) => { + return {children}; +}; + +export const DialogButtonGroup: React.FC = ({ children }: DialogButtonGroupProps) => { + return
{children}
; +}; + +export const Dialog: React.FC = ({ show, children }: DialogProps) => { return ( {show && ( @@ -38,17 +50,13 @@ export const Dialog: React.FC = ({ show, onClose, children }: Dialo /> {children} -
- Action 1 - Action 2 -
)} diff --git a/packages/next/components/ui/NavigatinDrawer.tsx b/packages/next/components/ui/NavigatinDrawer.tsx index 3be7013..384b405 100644 --- a/packages/next/components/ui/NavigatinDrawer.tsx +++ b/packages/next/components/ui/NavigatinDrawer.tsx @@ -41,7 +41,8 @@ export const NavigationDrawer = ({ show = false, onClose, children }: DrawerProp {/* Drawer - Slide from left */}