export interface WithWarnConfig
extends Factory,
Pick<ConfirmProps, "title" | "message"> {}
export const withWarn = (config?: WithWarnConfig): ConfirmProps => {
return {
...config,
contents: (onClickClose, onClickOk, contentMessage) => (
<>
<ModalBody>{contentMessage}</ModalBody>
<ModalFooter style={{ justifyContent: "flex-end" }}>
<Button
style={{ width: "100px" }}
autoFocus
onClick={onClickOk}
onKeyDown={(e: any) =>
e.key === "enter" && onClickOk && onClickOk(e)
}
color="primary"
>
Confirm
</Button>
</ModalFooter>
</>
)
};
};
Last active
April 18, 2021 12:22
-
-
Save qkreltms/a9b0ea9576b71772cb766f03e6167487 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment