From 58ef5833b3f77f321c587dd86448c888029016ce Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Thu, 22 Dec 2022 14:44:26 +0100 Subject: feat: Many things - Working Login/Logout - Groundwork for web components - Loading web-components with version tag - Load temporal-polyfill globally --- code/api/wwwroot/scripts/components/profile-modal.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 code/api/wwwroot/scripts/components/profile-modal.js (limited to 'code/api/wwwroot/scripts/components/profile-modal.js') diff --git a/code/api/wwwroot/scripts/components/profile-modal.js b/code/api/wwwroot/scripts/components/profile-modal.js new file mode 100644 index 0000000..91d4ed3 --- /dev/null +++ b/code/api/wwwroot/scripts/components/profile-modal.js @@ -0,0 +1,18 @@ +class ProfileModal extends HTMLElement { + constructor() { + super(); + const sessionData = session.get(); + const root = create_element("div", { + style: { + padding: "5px", + display: "" + } + }, [ + create_element("h4", {innerText: sessionData.username, style: {margin:0}}), + create_element("p", {innerText: sessionData.role}) + ]); + this.innerHTML = root.innerHTML; + } +} + +customElements.define('profile-modal', ProfileModal); -- cgit v1.3