Feat: Hydrate shell from app state

This commit is contained in:
MangoPig
2026-06-19 17:39:39 +01:00
parent 913825f596
commit 6ba04effcf
15 changed files with 1258 additions and 131 deletions

View File

@@ -1,6 +1,7 @@
import { For, type JSX } from "solid-js";
import { User } from "../../../lib/icons";
import { activeUserProfile, profileMenuSections } from "../data/shell.data";
import { useAppShellData } from "../data/app-shell.context";
import { profileMenuSections } from "../data/shell.data";
import styles from "./ProfileMenu.module.scss";
type ProfileMenuProps = {
@@ -12,6 +13,8 @@ type ProfileMenuProps = {
export const ProfileMenu = (props: ProfileMenuProps): JSX.Element => {
const variant = props.variant ?? "popover";
const appShellData = useAppShellData();
const activeUserProfile = () => appShellData.activeUserProfile();
return (
<div
@@ -35,10 +38,10 @@ export const ProfileMenu = (props: ProfileMenuProps): JSX.Element => {
</div>
<div class={styles.summaryCopy}>
<strong class={styles.name}>{activeUserProfile.name}</strong>
<span class={styles.email}>{activeUserProfile.email}</span>
<span class={styles.role}>{activeUserProfile.roleLabel}</span>
<span class={styles.context}>{activeUserProfile.contextLabel}</span>
<strong class={styles.name}>{activeUserProfile().name}</strong>
<span class={styles.email}>{activeUserProfile().email}</span>
<span class={styles.role}>{activeUserProfile().roleLabel}</span>
<span class={styles.context}>{activeUserProfile().contextLabel}</span>
</div>
</div>