send/app/ui/modal.js

26 lines
629 B
JavaScript
Raw Normal View History

2018-10-25 02:07:10 +00:00
const html = require('choo/html');
module.exports = function(state, emit) {
return html`
<send-modal
class="absolute pin flex items-center justify-center overflow-hidden z-40 bg-white md:my-8"
2018-11-16 20:39:36 +00:00
onclick="${close}"
>
<div class="h-full max-h-screen absolute pin-t flex items-center">
<div class="" onclick="${e => e.stopPropagation()}">
2018-11-16 20:39:36 +00:00
${state.modal(state, emit, close)}
</div>
2018-11-02 09:27:59 +00:00
</div>
</send-modal>
2018-11-16 20:39:36 +00:00
`;
2018-10-25 02:07:10 +00:00
function close(event) {
2018-10-29 16:52:24 +00:00
if (event) {
event.preventDefault();
event.stopPropagation();
}
2018-10-25 02:07:10 +00:00
state.modal = null;
emit('render');
}
};