refactor: dayjs and tippy setting

This commit is contained in:
Tristan Yang
2022-07-17 22:02:57 +08:00
parent 963fd9a0a3
commit 37ad42170e
9 changed files with 36 additions and 53 deletions
@@ -1,6 +1,5 @@
import { FC, useEffect, useState } from "react";
import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
import Styled from "./styled";
import ImageMessage from "./ImageMessage";
import useRemoveLocalMessage from "../../hook/useRemoveLocalMessage";
@@ -8,15 +7,10 @@ import useUploadFile from "../../hook/useUploadFile";
import useSendMessage from "../../hook/useSendMessage";
import Progress from "./Progress";
import { getFileIcon, formatBytes, isImage, getImageSize, ImageSize } from "../../utils";
// import { ReactComponent as IconDownload } from "../../../assets/icons/download.svg";
// import { ReactComponent as IconClose } from "../../../assets/icons/close.circle.svg";
import { useAppSelector } from "../../../app/store";
import IconDownload from "../../../assets/icons/download.svg";
import IconClose from "../../../assets/icons/close.circle.svg";
// todo: move to root file
dayjs.extend(relativeTime);
const isLocalFile = (content: string) => {
return content.startsWith("blob:");
};