refactor: session list

This commit is contained in:
zerosoul
2022-06-15 14:18:26 +08:00
parent 0526ce16fd
commit 47b165f64a
8 changed files with 49 additions and 29 deletions
+2 -1
View File
@@ -10,10 +10,11 @@ const Styled = styled.span`
cursor: pointer;
}
`;
export default function Mention({ uid, popover = true, cid }) {
export default function Mention({ uid, popover = true, cid, textOnly = false }) {
const contactsData = useSelector((store) => store.contacts.byId);
const user = contactsData[uid];
if (!user) return null;
if (textOnly) return `@${user.name}`;
return (
<Tippy
disabled={!popover}