drop.chapril.org-firefoxsend/app/ui/modal.js

20 lines
502 B
JavaScript
Raw Normal View History

2018-10-25 04:07:10 +02:00
const html = require('choo/html');
module.exports = function(state, emit) {
return html`
2018-11-01 18:20:36 +01:00
<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()}>
2018-10-25 04:07:10 +02:00
${state.modal(state, emit, close)}
</div>
</div>`;
function close(event) {
2018-10-29 17:52:24 +01:00
if (event) {
event.preventDefault();
event.stopPropagation();
}
2018-10-25 04:07:10 +02:00
state.modal = null;
emit('render');
}
};