aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/wwwroot/scripts/components/profile-modal.js
diff options
context:
space:
mode:
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);