|
@@ -12,7 +12,7 @@ import {
|
|
|
import { useChatStore } from "../store";
|
|
import { useChatStore } from "../store";
|
|
|
|
|
|
|
|
import Locale from "../locales";
|
|
import Locale from "../locales";
|
|
|
-import { Link, useNavigate } from "react-router-dom";
|
|
|
|
|
|
|
+import { Link, useLocation, useNavigate } from "react-router-dom";
|
|
|
import { Path } from "../constant";
|
|
import { Path } from "../constant";
|
|
|
import { MaskAvatar } from "./mask";
|
|
import { MaskAvatar } from "./mask";
|
|
|
import { Mask } from "../store/mask";
|
|
import { Mask } from "../store/mask";
|
|
@@ -40,12 +40,16 @@ export function ChatItem(props: {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}, [props.selected]);
|
|
}, [props.selected]);
|
|
|
|
|
+
|
|
|
|
|
+ const { pathname: currentPath } = useLocation();
|
|
|
return (
|
|
return (
|
|
|
<Draggable draggableId={`${props.id}`} index={props.index}>
|
|
<Draggable draggableId={`${props.id}`} index={props.index}>
|
|
|
{(provided) => (
|
|
{(provided) => (
|
|
|
<div
|
|
<div
|
|
|
className={`${styles["chat-item"]} ${
|
|
className={`${styles["chat-item"]} ${
|
|
|
- props.selected && styles["chat-item-selected"]
|
|
|
|
|
|
|
+ props.selected &&
|
|
|
|
|
+ (currentPath === Path.Chat || currentPath === Path.Home) &&
|
|
|
|
|
+ styles["chat-item-selected"]
|
|
|
}`}
|
|
}`}
|
|
|
onClick={props.onClick}
|
|
onClick={props.onClick}
|
|
|
ref={(ele) => {
|
|
ref={(ele) => {
|