diff --git a/public/locales/en/setting.json b/public/locales/en/setting.json index 1189efb0..611b7c80 100644 --- a/public/locales/en/setting.json +++ b/public/locales/en/setting.json @@ -30,6 +30,7 @@ "transfer_desc": "You need to transfer your channel ownership to someone else before leaving the channel.", "delete": "Delete Channel", "delete_desc": "Are you sure want to delete this channel?", + "id": "Channel ID", "name": "Channel Name", "topic": "Channel Topic", "topic_placeholder": "Let everyone know how to use this channel.", diff --git a/public/locales/zh/setting.json b/public/locales/zh/setting.json index df6af37c..557b5890 100644 --- a/public/locales/zh/setting.json +++ b/public/locales/zh/setting.json @@ -30,7 +30,7 @@ "transfer_desc": "在离开此频道前,需要转让所有权。", "delete": "删除频道", "delete_desc": "确定删除该频道?", - + "id": "频道ID", "name": "频道名", "topic": "频道主题", "topic_placeholder": "让别人知道这个频道是用来做啥的", diff --git a/src/components/User/index.tsx b/src/components/User/index.tsx index 2ef5a3e0..aa77d46e 100644 --- a/src/components/User/index.tsx +++ b/src/components/User/index.tsx @@ -21,6 +21,7 @@ interface Props { compact?: boolean; avatarSize?: number; enableContextMenu?: boolean; + enableNavToSetting?: boolean; } const User: FC = ({ @@ -32,7 +33,8 @@ const User: FC = ({ popover = false, compact = false, avatarSize = 32, - enableContextMenu = false + enableContextMenu = false, + enableNavToSetting = false }) => { const navigate = useNavigate(); const { visible: contextMenuVisible, handleContextMenuEvent, hideContextMenu } = useContextMenu(); @@ -46,12 +48,16 @@ const User: FC = ({ const handleDoubleClick = () => { navigate(`/chat/dm/${uid}`); }; + const handleNavToSetting = () => { + navigate(`/setting/dm/${uid}/overview?f=/chat/dm/${uid}`); + }; if (!curr) return null; const online = curr.online || curr.uid == loginUid; const containerClass = clsx( `relative flex items-center justify-start gap-2 rounded-lg select-none`, interactive && "md:hover:bg-gray-500/10", - compact ? "p-0" : "p-2" + compact ? "p-0" : "p-2", + enableNavToSetting && "cursor-pointer" ); const nameClass = clsx( `text-sm text-gray-500 max-w-[190px] truncate font-semibold dark:text-white` @@ -73,6 +79,7 @@ const User: FC = ({ >
diff --git a/src/routes/chat/ChannelChat/index.tsx b/src/routes/chat/ChannelChat/index.tsx index b6b60c86..89377c28 100644 --- a/src/routes/chat/ChannelChat/index.tsx +++ b/src/routes/chat/ChannelChat/index.tsx @@ -1,7 +1,7 @@ import { memo, useEffect } from "react"; import { useTranslation } from "react-i18next"; import { useDispatch } from "react-redux"; -import { useLocation, useNavigate } from "react-router-dom"; +import { Link, useLocation, useNavigate } from "react-router-dom"; import Tippy from "@tippyjs/react"; import { updateChannelVisibleAside } from "@/app/slices/footprint"; @@ -118,8 +118,13 @@ function ChannelChat({ cid = 0, dropFiles = [] }: Props) {
- - {name} + + + {name} + {description}
diff --git a/src/routes/chat/DMChat/index.tsx b/src/routes/chat/DMChat/index.tsx index 778becba..809c4522 100644 --- a/src/routes/chat/DMChat/index.tsx +++ b/src/routes/chat/DMChat/index.tsx @@ -56,7 +56,7 @@ const DMChat: FC = ({ uid = 0, dropFiles }) => { header={
- +
} /> diff --git a/src/routes/settingChannel/Overview.tsx b/src/routes/settingChannel/Overview.tsx index 4f8e6a62..f8745b23 100644 --- a/src/routes/settingChannel/Overview.tsx +++ b/src/routes/settingChannel/Overview.tsx @@ -94,6 +94,10 @@ export default function Overview({ id = 0 }) {
+
+ + #{id} +