1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-14 15:12:48 +01:00
send/app/ui/modal.js
2018-11-16 12:39:36 -08:00

29 lines
665 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 md:my-8"
onclick="${close}"
>
<div class="h-full max-h-screen absolute pin-t flex items-center">
<div
class="shadow-cloud bg-white"
onclick="${e => e.stopPropagation()}"
>
${state.modal(state, emit, close)}
</div>
</div>
</div>
`;
function close(event) {
if (event) {
event.preventDefault();
event.stopPropagation();
}
state.modal = null;
emit('render');
}
};