Profile: add items into menu

This commit is contained in:
thislight 2024-11-03 18:00:13 +08:00
parent b61012f12b
commit 20a5e565b1
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E

View file

@ -26,10 +26,14 @@ import {
Close,
Edit,
ExpandMore,
Group,
MoreVert,
OpenInBrowser,
PersonOff,
PlaylistAdd,
Send,
Share,
Translate,
Verified,
} from "@suid/icons-material";
import { Title } from "../material/typography";
@ -90,6 +94,10 @@ const Profile: Component = () => {
console.error(err);
});
const isCurrentSessionProfile = () => {
return session().account?.inf?.url === profile()?.url;
};
const [recentTootFilter, setRecentTootFilter] = createSignal({
pinned: true,
boost: false,
@ -260,6 +268,17 @@ const Profile: Component = () => {
anchor={() =>
document.getElementById(menuButId)!.getBoundingClientRect()
}
>
<Show
when={isCurrentSessionProfile()}
fallback={
<MenuItem disabled>
<ListItemIcon>
<PlaylistAdd />
</ListItemIcon>
<ListItemText>Subscribe...</ListItemText>
</MenuItem>
}
>
<MenuItem disabled>
<ListItemIcon>
@ -267,12 +286,31 @@ const Profile: Component = () => {
</ListItemIcon>
<ListItemText>Edit...</ListItemText>
</MenuItem>
</Show>
<Divider />
<MenuItem disabled>
<ListItemIcon>
<Group />
</ListItemIcon>
<ListItemText>Subscribers</ListItemText>
</MenuItem>
<MenuItem disabled>
<ListItemIcon>
<PersonOff />
</ListItemIcon>
<ListItemText>Blocklist</ListItemText>
</MenuItem>
<MenuItem disabled>
<ListItemIcon>
<Translate />
</ListItemIcon>
<ListItemText>Translate Name and Bio...</ListItemText>
</MenuItem>
<MenuItem disabled>
<ListItemIcon>
<Send />
</ListItemIcon>
<ListItemText>Mention {profile()?.displayName || ""}...</ListItemText>
<ListItemText>Mention in...</ListItemText>
</MenuItem>
<Divider />
<MenuItem