Feat: Hydrate shell from app state
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user