-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor structure of modal component
- Loading branch information
1 parent
bf74463
commit faefc3c
Showing
26 changed files
with
965 additions
and
837 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Modal as SemiUIModal } from "@douyinfe/semi-ui"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
export default function Modal({ | ||
children, | ||
modalTitle, | ||
okText, | ||
onOk, | ||
onCancel, | ||
okBtnDisabled, | ||
width, | ||
}) { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<SemiUIModal | ||
title={modalTitle || ""} | ||
visible={true} | ||
onOk={onOk} | ||
onCancel={onCancel} | ||
centered | ||
closeOnEsc={true} | ||
okText={okText || t("confirm")} | ||
okButtonProps={{ | ||
disabled: okBtnDisabled, | ||
}} | ||
cancelText={t("cancel")} | ||
width={width || 600} | ||
// bodyStyle={{ maxHeight: window.innerHeight - 280, overflow: "auto" }} | ||
> | ||
{children} | ||
</SemiUIModal> | ||
); | ||
} |
Oops, something went wrong.