15 lines
337 B
JavaScript
15 lines
337 B
JavaScript
const html = require('choo/html');
|
|
|
|
module.exports = function(state, emit) {
|
|
return html`
|
|
<div class="modal" onclick=${close}>
|
|
<div class="modal__box" onclick=${e => e.stopPropagation()}>
|
|
${state.modal(state, emit, close)}
|
|
</div>
|
|
</div>`;
|
|
|
|
function close(event) {
|
|
state.modal = null;
|
|
emit('render');
|
|
}
|
|
};
|