This commit is contained in:
parent
376f97c5cd
commit
4a46a0fbc9
1 changed files with 31 additions and 7 deletions
|
@ -19,6 +19,7 @@ import {
|
||||||
CircularProgress,
|
CircularProgress,
|
||||||
Divider,
|
Divider,
|
||||||
IconButton,
|
IconButton,
|
||||||
|
ListItemAvatar,
|
||||||
ListItemIcon,
|
ListItemIcon,
|
||||||
ListItemText,
|
ListItemText,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
|
@ -67,8 +68,6 @@ const Profile: Component = () => {
|
||||||
const menuButId = createUniqueId();
|
const menuButId = createUniqueId();
|
||||||
|
|
||||||
const [menuOpen, setMenuOpen] = createSignal(false);
|
const [menuOpen, setMenuOpen] = createSignal(false);
|
||||||
const [subscribeMenuOpen, setSubscribeMenuOpen] = createSignal(false);
|
|
||||||
let subcribeMenuAnchor: { top: number; right: number; left: number };
|
|
||||||
|
|
||||||
const [openSubscribeMenu, subscribeMenuState] = createManagedMenuState();
|
const [openSubscribeMenu, subscribeMenuState] = createManagedMenuState();
|
||||||
|
|
||||||
|
@ -192,11 +191,22 @@ const Profile: Component = () => {
|
||||||
document.getElementById(menuButId)!.getBoundingClientRect()
|
document.getElementById(menuButId)!.getBoundingClientRect()
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Show when={session().account}>
|
<Show when={session().account && profile()}>
|
||||||
<Show
|
<Show
|
||||||
when={isCurrentSessionProfile()}
|
when={isCurrentSessionProfile()}
|
||||||
fallback={
|
fallback={
|
||||||
<MenuItem disabled>
|
<MenuItem
|
||||||
|
onClick={(event) => {
|
||||||
|
const { left, right, top } =
|
||||||
|
event.currentTarget.getBoundingClientRect();
|
||||||
|
openSubscribeMenu({
|
||||||
|
left,
|
||||||
|
right,
|
||||||
|
top,
|
||||||
|
e: 1,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<PlaylistAdd />
|
<PlaylistAdd />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
|
@ -287,9 +297,21 @@ const Profile: Component = () => {
|
||||||
|
|
||||||
<Menu {...subscribeMenuState}>
|
<Menu {...subscribeMenuState}>
|
||||||
<MenuItem disabled>
|
<MenuItem disabled>
|
||||||
|
<ListItemAvatar>
|
||||||
|
<Avatar src={session().account?.inf?.avatar}></Avatar>
|
||||||
|
</ListItemAvatar>
|
||||||
<ListItemText>
|
<ListItemText>
|
||||||
<span>{session().account?.inf?.displayName || ""}</span>
|
<span
|
||||||
<span>'s timeline</span>
|
ref={(e) =>
|
||||||
|
createRenderEffect(() => {
|
||||||
|
e.innerHTML = resolveCustomEmoji(
|
||||||
|
session().account?.inf?.displayName || "",
|
||||||
|
session().account?.inf?.emojis ?? [],
|
||||||
|
);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
></span>
|
||||||
|
<span>'s Home</span>
|
||||||
</ListItemText>
|
</ListItemText>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
@ -320,7 +342,9 @@ const Profile: Component = () => {
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Match when={!session().account}>{<></>}</Match>
|
<Match when={!session().account || profileErrorUncaught.loading}>
|
||||||
|
{<></>}
|
||||||
|
</Match>
|
||||||
<Match when={isCurrentSessionProfile()}>
|
<Match when={isCurrentSessionProfile()}>
|
||||||
<IconButton color="inherit">
|
<IconButton color="inherit">
|
||||||
<Edit />
|
<Edit />
|
||||||
|
|
Loading…
Reference in a new issue