@authduo/authduo
Version:
Free User-sovereign Authentication for the World
39 lines (35 loc) • 1.1 kB
JavaScript
import { html, shadowView } from "@benev/slate";
import stylesCss from "./styles.css.js";
import themeCss from "../../../../common/theme.css.js";
import { PassportEditor } from "../../common/passport-editor/view.js";
export const EditPage = shadowView(use => (situation) => {
use.styles([themeCss, stylesCss]);
const passport = use.signal(situation.passport);
function save() {
if (passport.value)
situation.onComplete(passport.value);
}
return html `
<div class=plate>
<header>
<h2 class=instruction>Edit your passport</h2>
</header>
${PassportEditor([{
passport: situation.passport,
onUpdate: updated => passport.value = updated,
}])}
<footer class=buttonbar>
<button class=angry @click="${() => situation.onDelete(situation.passport)}">
Delete
</button>
<button @click="${() => situation.onCancel()}">
Cancel
</button>
<button class=happy ?disabled="${!passport.value}" @click="${save}">
Save
</button>
</footer>
</div>
`;
});
//# sourceMappingURL=view.js.map