Skip to content
Snippets Groups Projects
Verified Commit 57055b49 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: new conditional buttons support

parent b67768ca
No related branches found
No related tags found
No related merge requests found
Pipeline #1689 passed
......@@ -9,6 +9,7 @@ type ModalProps = {
title?: string;
text?: string;
visible?: boolean;
buttons?: boolean;
overlayClose?: boolean;
style?: string[];
onConfirm?: () => void;
......@@ -19,6 +20,7 @@ export const Modal: FC<ModalProps> = ({
title = "Alert",
text = "Do you confirm the following operation?",
visible = false,
buttons = true,
overlayClose = true,
style = [],
onConfirm,
......@@ -75,20 +77,22 @@ export const Modal: FC<ModalProps> = ({
className="modal-text"
dangerouslySetInnerHTML={getTextHtml()}
></p>
<div className="modal-buttons">
<Button
text={"Cancel"}
size={"medium"}
style={["simple", "red", "border", "padded-large"]}
onClick={onCancel}
/>
<Button
text={"Confirm"}
size={"medium"}
style={["simple", "border", "padded-large"]}
onClick={onConfirm}
/>
</div>
{buttons && (
<div className="modal-buttons">
<Button
text={"Cancel"}
size={"medium"}
style={["simple", "red", "border", "padded-large"]}
onClick={onCancel}
/>
<Button
text={"Confirm"}
size={"medium"}
style={["simple", "border", "padded-large"]}
onClick={onConfirm}
/>
</div>
)}
</div>
</div>
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment