-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lijiahao
committed
Sep 20, 2024
1 parent
d359f98
commit b91dbe7
Showing
16 changed files
with
625 additions
and
604 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
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 |
---|---|---|
@@ -1,30 +1,34 @@ | ||
import {Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button} from "@nextui-org/react"; | ||
import { | ||
Modal, | ||
ModalContent, | ||
ModalHeader, | ||
ModalBody, | ||
ModalFooter, | ||
Button, | ||
} from "@nextui-org/react"; | ||
|
||
function Alert(props) { | ||
|
||
const handleConfirm = () => { | ||
props.onClose && props.onClose() | ||
} | ||
props.onClose && props.onClose(); | ||
}; | ||
|
||
return ( | ||
<Modal isOpen={true} scrollBehavior="inside" onClose={handleConfirm}> | ||
<ModalContent> | ||
{(onClose) => ( | ||
<> | ||
<ModalHeader className="flex flex-col gap-1">{ props.title || 'Warning' }</ModalHeader> | ||
<ModalBody className="scroll"> | ||
{ props.content } | ||
</ModalBody> | ||
<ModalFooter> | ||
<Button color="primary" onPress={handleConfirm}> | ||
Confirm | ||
</Button> | ||
</ModalFooter> | ||
</> | ||
)} | ||
<> | ||
<ModalHeader className="flex flex-col gap-1"> | ||
{props.title || "Warning"} | ||
</ModalHeader> | ||
<ModalBody className="scroll">{props.content}</ModalBody> | ||
<ModalFooter> | ||
<Button color="primary" onPress={handleConfirm}> | ||
Confirm | ||
</Button> | ||
</ModalFooter> | ||
</> | ||
</ModalContent> | ||
</Modal> | ||
); | ||
} | ||
|
||
export default Alert | ||
export default Alert; |
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
Oops, something went wrong.