diff --git a/app/views/partials/modal.js b/app/views/partials/modal.js new file mode 100644 index 0000000..77b3667 --- /dev/null +++ b/app/views/partials/modal.js @@ -0,0 +1,66 @@ +import html from 'choo/html'; + +export const modal = (modalId, controller, contentHTML, options = {}) => { + /* Options: + * controller : Pass the controller class with state; Requires get/set for openModal in state. + * buttonHTML : Displayed in place of the default button to open the modal + * buttonText : Displayed if no buttonHTML is specified + * noHeader : Set to `true` and exclude headerHTML to not include a modal header + * headerHTML : Displayed in place of the default header; Recommended to use `
` tag + * headerText : Displayed in an `

` if no header is specified + * noFooter : Set to `true` and exclude footerHTML to not include a modal footer + * footerHTML : Displayed in place of the default footer; Recommended to use `