|
|
|
@ -3,7 +3,7 @@ import { App, Button, Popover, Tabs, List, Image, Avatar, Card, Flex, Space } fr
|
|
|
|
|
import { FileSearchOutlined, LoadingOutlined } from '@ant-design/icons';
|
|
|
|
|
import { RotateLeftOutlined, RotateRightOutlined, ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons'
|
|
|
|
|
import { InboxIcon, SendPlaneFillIcon } from '@/components/Icons';
|
|
|
|
|
import { groupBy, isEmpty, stringToColour } from '@/utils/commons';
|
|
|
|
|
import { groupBy, isEmpty, TagColorStyle as CalColorStyle } from '@/utils/commons';
|
|
|
|
|
import { useShallow } from 'zustand/react/shallow';
|
|
|
|
|
import EmailDetail from './EmailDetail';
|
|
|
|
|
import { MESSAGE_PAGE_SIZE, fetchMessagesHistory } from '@/actions/ConversationActions';
|
|
|
|
@ -16,11 +16,6 @@ import { v4 as uuid } from 'uuid';
|
|
|
|
|
|
|
|
|
|
const BIG_PAGE_SIZE = MESSAGE_PAGE_SIZE * 10;
|
|
|
|
|
|
|
|
|
|
const CalColorStyle = (tag, outerStyle = true) => {
|
|
|
|
|
const color = stringToColour(tag);
|
|
|
|
|
const outerStyleObj = outerStyle ? { borderColor: `${color}66`, backgroundColor: `${color}0D` } : {};
|
|
|
|
|
return { color: `${color}`, ...outerStyleObj };
|
|
|
|
|
};
|
|
|
|
|
const getVideoName = (vUrl) => {
|
|
|
|
|
if (!vUrl) return '';
|
|
|
|
|
const url = new URL(vUrl);
|
|
|
|
@ -202,7 +197,7 @@ const MessageListFilter = ({ ...props }) => {
|
|
|
|
|
<List.Item>
|
|
|
|
|
<List.Item.Meta
|
|
|
|
|
avatar={
|
|
|
|
|
<Avatar size='small' style={CalColorStyle(item.sender)}>
|
|
|
|
|
<Avatar size='small' style={CalColorStyle(item.sender, true)}>
|
|
|
|
|
{item.senderName}
|
|
|
|
|
</Avatar>
|
|
|
|
|
}
|
|
|
|
@ -243,7 +238,7 @@ const MessageListFilter = ({ ...props }) => {
|
|
|
|
|
<List.Item actions={[item.localDate]}>
|
|
|
|
|
<List.Item.Meta
|
|
|
|
|
avatar={
|
|
|
|
|
<Avatar size='small' style={CalColorStyle(item.senderName)}>
|
|
|
|
|
<Avatar size='small' style={CalColorStyle(item.senderName, true)}>
|
|
|
|
|
{item.senderName.substring(0, 5)}
|
|
|
|
|
</Avatar>
|
|
|
|
|
}
|
|
|
|
@ -291,7 +286,7 @@ const MessageListFilter = ({ ...props }) => {
|
|
|
|
|
<List.Item>
|
|
|
|
|
<List.Item.Meta
|
|
|
|
|
avatar={
|
|
|
|
|
<Avatar size='small' style={CalColorStyle(item.sender)}>
|
|
|
|
|
<Avatar size='small' style={CalColorStyle(item.sender, true)}>
|
|
|
|
|
{item.senderName}
|
|
|
|
|
</Avatar>
|
|
|
|
|
}
|
|
|
|
|