feat(modal): Add in prop for Close button text

This commit is contained in:
Sophia Dao
2024-07-17 12:47:25 -05:00
parent ec7df134b4
commit 7093261f84
2 changed files with 4 additions and 3 deletions
-1
View File
@@ -27,7 +27,6 @@ export default function Providers() {
<p>Modal body content</p>
</>
}
actionText="Save"
onAction={onAction}
/>
</>
+4 -2
View File
@@ -13,6 +13,7 @@ interface ModalProps {
isOpen: boolean;
onOpenChange: (isOpen: boolean) => void;
body: React.ReactNode;
onCloseText?: string;
actionText?: string;
onAction?: () => void;
isDismissable?: boolean;
@@ -23,7 +24,8 @@ export const Modal: React.FC<ModalProps> = ({
isOpen,
onOpenChange,
body,
actionText,
onCloseText = "Close",
actionText = "Save",
onAction,
isDismissable = true,
}) => {
@@ -46,7 +48,7 @@ export const Modal: React.FC<ModalProps> = ({
<ModalBody>{body}</ModalBody>
<ModalFooter>
<Button color="danger" variant="light" onPress={onClose}>
Close
{onCloseText && onCloseText}
</Button>
{hasActionButton && (
<Button color="primary" onPress={onAction}>