1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-14 23:22:36 +01:00
send/app/ui/modal.js

22 lines
598 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-06 00:46:49 +01:00
<div class="absolute pin flex items-center justify-center overflow-hidden z-40 bg-cloud md:my-8" onclick=${close}>
2018-11-02 10:27:59 +01:00
<div class="h-full max-h-screen absolute pin-t flex items-center">
2018-11-02 19:28:56 +01:00
<div class="shadow-cloud bg-white" onclick=${e => e.stopPropagation()}>
2018-11-02 10:27:59 +01:00
${state.modal(state, emit, close)}
</div>
2018-10-25 04:07:10 +02:00
</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');
}
};