updated modal
This commit is contained in:
parent
7ad63ae004
commit
0e5202c470
10 changed files with 38 additions and 28 deletions
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue