drop.chapril.org-firefoxsend/app/ui/modal.js
2018-11-01 10:44:48 -07:00

20 lines
502 B
JavaScript

const html = require('choo/html');
module.exports = function(state, emit) {
return html`
<div class="absolute pin flex items-center justify-center overflow-hidden z-40 bg-cloud" onclick=${close}>
<div class="shadow-cloud bg-white" onclick=${e => e.stopPropagation()}>
${state.modal(state, emit, close)}
</div>
</div>`;
function close(event) {
if (event) {
event.preventDefault();
event.stopPropagation();
}
state.modal = null;
emit('render');
}
};