diff options
author | Sebastian <sebasjm@gmail.com> | 2021-11-10 18:10:45 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-11-10 18:11:12 -0300 |
commit | 0ac7433ea7fa952c46062daef1c3de535d92b7f3 (patch) | |
tree | 42ac2856ef47073113bc3c30c600bdf1d6fd73bb /packages/anastasis-webui/src/pages/home/ConfirmModal.tsx | |
parent | ea13e19ece2deeb4ab9731373f68b1dcf5b6fa88 (diff) | |
download | wallet-core-0ac7433ea7fa952c46062daef1c3de535d92b7f3.tar.xz |
confirm personal information fix #7090
Diffstat (limited to 'packages/anastasis-webui/src/pages/home/ConfirmModal.tsx')
-rw-r--r-- | packages/anastasis-webui/src/pages/home/ConfirmModal.tsx | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/packages/anastasis-webui/src/pages/home/ConfirmModal.tsx b/packages/anastasis-webui/src/pages/home/ConfirmModal.tsx new file mode 100644 index 000000000..cab70de63 --- /dev/null +++ b/packages/anastasis-webui/src/pages/home/ConfirmModal.tsx @@ -0,0 +1,52 @@ +import { ComponentChildren, h, VNode } from "preact"; + +export interface ConfirmModelProps { + active?: boolean; + description?: string; + onCancel?: () => void; + onConfirm?: () => void; + label?: string; + cancelLabel?: string; + children?: ComponentChildren; + danger?: boolean; + disabled?: boolean; +} + +export function ConfirmModal({ + active, description, onCancel, onConfirm, children, danger, disabled, label = "Confirm", cancelLabel = "Dismiss" +}: ConfirmModelProps): VNode { + return ( + <div class={active ? "modal is-active" : "modal"}> + <div class="modal-background " onClick={onCancel} /> + <div class="modal-card" style={{ maxWidth: 700 }}> + <header class="modal-card-head"> + {!description ? null : ( + <p class="modal-card-title"> + <b>{description}</b> + </p> + )} + <button class="delete " aria-label="close" onClick={onCancel} /> + </header> + <section class="modal-card-body">{children}</section> + <footer class="modal-card-foot"> + <button class="button" onClick={onCancel}> + {cancelLabel} + </button> + <div class="buttons is-right" style={{ width: "100%" }}> + <button + class={danger ? "button is-danger " : "button is-info "} + disabled={disabled} + onClick={onConfirm} + > + {label} + </button> + </div> + </footer> + </div> + <button + class="modal-close is-large " + aria-label="close" + onClick={onCancel} /> + </div> + ); +} |