From 6d52707ad38511ea2131c6a34a23d8ed400297dd Mon Sep 17 00:00:00 2001 From: xion Date: Sun, 6 Apr 2025 23:22:16 +0800 Subject: [PATCH] temp --- package.json | 4 +++- src/drag-modal/index.tsx | 22 ++++++++++++++++++---- src/theme/Provider.tsx | 9 +++++++++ src/toast/ToastLogin.tsx | 4 +++- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 45a527b..7f550bd 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,14 @@ "dependencies": { "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.0", + "@kevisual/query-login": "^0.0.4", "@mui/material": "^7.0.1", "re-resizable": "^6.11.2", "react": "19.1.0", "react-dom": "19.1.0", "react-draggable": "^4.4.6", - "react-hook-form": "^7.55.0" + "react-hook-form": "^7.55.0", + "react-i18next": "^15.4.1" }, "exports": { ".": "./src/index.tsx", diff --git a/src/drag-modal/index.tsx b/src/drag-modal/index.tsx index 242d1c7..cb73703 100644 --- a/src/drag-modal/index.tsx +++ b/src/drag-modal/index.tsx @@ -11,6 +11,7 @@ type DragModalProps = { containerClassName?: string; handleClassName?: string; contentClassName?: string; + focus?: boolean; /** * 默认大小, 单位为px * width: defaultSize.width || 320 @@ -29,7 +30,7 @@ export const DragModal = (props: DragModalProps) => { { - console.log(e, data); + // console.log(e, data); }} handle='.handle' grid={[1, 1]} @@ -40,7 +41,7 @@ export const DragModal = (props: DragModalProps) => { y: 0, }}>
{props.title || 'Move'}
@@ -70,15 +71,28 @@ type DragModalTitleProps = { className?: string; onClose?: () => void; children?: React.ReactNode; + onClick?: () => void; }; export const DragModalTitle = (props: DragModalTitleProps) => { return ( -
+
{ + e.stopPropagation(); + props.onClick?.(); + }}>
{props.title} {props.children}
- +
{ + e.stopPropagation(); + props.onClose?.(); + }}> + +
); }; diff --git a/src/theme/Provider.tsx b/src/theme/Provider.tsx index da8f8c8..31803dd 100644 --- a/src/theme/Provider.tsx +++ b/src/theme/Provider.tsx @@ -1,4 +1,5 @@ import { ToastContainer } from 'react-toastify'; +import { CustomThemeProvider } from '.'; type ToastProviderProps = { children?: React.ReactNode; @@ -11,3 +12,11 @@ export const ToastProvider = ({ children }: ToastProviderProps) => { ); }; +export const Provider = ({ children }) => { + return ( + + {children} + + + ); +}; diff --git a/src/toast/ToastLogin.tsx b/src/toast/ToastLogin.tsx index 1277716..002c23c 100644 --- a/src/toast/ToastLogin.tsx +++ b/src/toast/ToastLogin.tsx @@ -38,5 +38,7 @@ type ToastLoginProps = { * }); */ export const toastLogin = (props: ToastLoginProps = {}) => { - toast.info(); + toast.info(, { + autoClose: 5000 * 3, + }); };