send/app/templates/modal/index.js

16 lines
331 B
JavaScript
Raw Normal View History

2018-09-07 17:53:40 +00:00
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, close)}
</div>
</div>`;
function close(event) {
state.modal = null;
emit('render');
}
};