mirror of
https://github.com/usememos/memos.git
synced 2025-11-10 01:10:52 +08:00
chore: remove username click event (#1167)
chore: remove user name click event
This commit is contained in:
parent
a09b2c4eea
commit
039b6b247a
1 changed files with 3 additions and 11 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useLocationStore, useMemoStore, useTagStore, useUserStore } from "../store/module";
|
import { useMemoStore, useTagStore, useUserStore } from "../store/module";
|
||||||
import { getMemoStats } from "../helpers/api";
|
import { getMemoStats } from "../helpers/api";
|
||||||
import * as utils from "../helpers/utils";
|
import * as utils from "../helpers/utils";
|
||||||
import Dropdown from "./common/Dropdown";
|
import Dropdown from "./common/Dropdown";
|
||||||
|
|
@ -10,7 +10,6 @@ import UserAvatar from "./UserAvatar";
|
||||||
|
|
||||||
const UserBanner = () => {
|
const UserBanner = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const locationStore = useLocationStore();
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const memoStore = useMemoStore();
|
const memoStore = useMemoStore();
|
||||||
const tagStore = useTagStore();
|
const tagStore = useTagStore();
|
||||||
|
|
@ -45,10 +44,6 @@ const UserBanner = () => {
|
||||||
});
|
});
|
||||||
}, [memos]);
|
}, [memos]);
|
||||||
|
|
||||||
const handleUsernameClick = useCallback(() => {
|
|
||||||
locationStore.clearQuery();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleArchivedBtnClick = () => {
|
const handleArchivedBtnClick = () => {
|
||||||
showArchivedMemoDialog();
|
showArchivedMemoDialog();
|
||||||
};
|
};
|
||||||
|
|
@ -68,10 +63,7 @@ const UserBanner = () => {
|
||||||
<Dropdown
|
<Dropdown
|
||||||
className="w-full"
|
className="w-full"
|
||||||
trigger={
|
trigger={
|
||||||
<div
|
<div className="px-2 py-1 max-w-full flex flex-row justify-start items-center cursor-pointer rounded hover:shadow hover:bg-white dark:hover:bg-zinc-700">
|
||||||
className="px-2 py-1 max-w-full flex flex-row justify-start items-center cursor-pointer rounded hover:shadow hover:bg-white dark:hover:bg-zinc-700"
|
|
||||||
onClick={handleUsernameClick}
|
|
||||||
>
|
|
||||||
<UserAvatar avatarUrl={user?.avatarUrl} />
|
<UserAvatar avatarUrl={user?.avatarUrl} />
|
||||||
<span className="px-1 text-lg font-medium text-slate-800 dark:text-gray-200 shrink truncate">{username}</span>
|
<span className="px-1 text-lg font-medium text-slate-800 dark:text-gray-200 shrink truncate">{username}</span>
|
||||||
{!isVisitorMode && user?.role === "HOST" ? (
|
{!isVisitorMode && user?.role === "HOST" ? (
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue