updated modal

This commit is contained in:
Danny Coates 2018-10-29 09:52:24 -07:00
parent 7ad63ae004
commit 0e5202c470
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
10 changed files with 38 additions and 28 deletions

View file

@ -2,14 +2,17 @@ const html = require('choo/html');
module.exports = function(state, emit) {
return html`
<div class="fixed pin flex items-center justify-center overflow-hidden z-40 bg-shades" onclick=${close}>
<div class="rounded max-w-md bg-white m-1" onclick=${e =>
e.stopPropagation()}>
<div class="absolute pin flex items-center justify-center overflow-hidden z-40 bg-shades" onclick=${close}>
<div class="border-modal bg-white" onclick=${e => e.stopPropagation()}>
${state.modal(state, emit, close)}
</div>
</div>`;
function close(event) {
if (event) {
event.preventDefault();
event.stopPropagation();
}
state.modal = null;
emit('render');
}