aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/wwwroot/scripts/components/profile-modal.js
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-12-22 14:44:26 +0100
committerivarlovlie <git@ivarlovlie.no>2022-12-22 14:44:26 +0100
commit58ef5833b3f77f321c587dd86448c888029016ce (patch)
treefe5e6f47781573cc1fb5938f9b8cd8b51022946a /code/api/wwwroot/scripts/components/profile-modal.js
parent82ade3c31fb17b662feec59e9e654ceb66edbb7a (diff)
downloadstorage-58ef5833b3f77f321c587dd86448c888029016ce.tar.xz
storage-58ef5833b3f77f321c587dd86448c888029016ce.zip
feat: Many things
- Working Login/Logout - Groundwork for web components - Loading web-components with version tag - Load temporal-polyfill globally
Diffstat (limited to 'code/api/wwwroot/scripts/components/profile-modal.js')
-rw-r--r--code/api/wwwroot/scripts/components/profile-modal.js18
1 files changed, 18 insertions, 0 deletions
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);