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 = { ...@@ -9,6 +9,7 @@ type ModalProps = {
title?: string; title?: string;
text?: string; text?: string;
visible?: boolean; visible?: boolean;
buttons?: boolean;
overlayClose?: boolean; overlayClose?: boolean;
style?: string[]; style?: string[];
onConfirm?: () => void; onConfirm?: () => void;
...@@ -19,6 +20,7 @@ export const Modal: FC<ModalProps> = ({ ...@@ -19,6 +20,7 @@ export const Modal: FC<ModalProps> = ({
title = "Alert", title = "Alert",
text = "Do you confirm the following operation?", text = "Do you confirm the following operation?",
visible = false, visible = false,
buttons = true,
overlayClose = true, overlayClose = true,
style = [], style = [],
onConfirm, onConfirm,
...@@ -75,20 +77,22 @@ export const Modal: FC<ModalProps> = ({ ...@@ -75,20 +77,22 @@ export const Modal: FC<ModalProps> = ({
className="modal-text" className="modal-text"
dangerouslySetInnerHTML={getTextHtml()} dangerouslySetInnerHTML={getTextHtml()}
></p> ></p>
<div className="modal-buttons"> {buttons && (
<Button <div className="modal-buttons">
text={"Cancel"} <Button
size={"medium"} text={"Cancel"}
style={["simple", "red", "border", "padded-large"]} size={"medium"}
onClick={onCancel} style={["simple", "red", "border", "padded-large"]}
/> onClick={onCancel}
<Button />
text={"Confirm"} <Button
size={"medium"} text={"Confirm"}
style={["simple", "border", "padded-large"]} size={"medium"}
onClick={onConfirm} style={["simple", "border", "padded-large"]}
/> onClick={onConfirm}
</div> />
</div>
)}
</div> </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