mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-08 01:45:28 +00:00
feat(@ui): migrate line divider, preloader and save status
This commit is contained in:
@@ -16,6 +16,8 @@ import {
|
||||
useState,
|
||||
} from "preact/hooks";
|
||||
|
||||
import { Preloader } from "@revoltchat/ui";
|
||||
|
||||
import { defer } from "../../../lib/defer";
|
||||
import { internalEmit, internalSubscribe } from "../../../lib/eventEmitter";
|
||||
import { getRenderer } from "../../../lib/renderer/Singleton";
|
||||
@@ -28,8 +30,6 @@ import {
|
||||
StatusContext,
|
||||
} from "../../../context/revoltjs/RevoltClient";
|
||||
|
||||
import Preloader from "../../../components/ui/Preloader";
|
||||
|
||||
import ConversationStart from "./ConversationStart";
|
||||
import MessageRenderer from "./MessageRenderer";
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* eslint-disable react-hooks/rules-of-hooks */
|
||||
import { X } from "@styled-icons/boxicons-regular";
|
||||
import dayjs from "dayjs";
|
||||
import isEqual from "lodash.isequal";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { API } from "revolt.js";
|
||||
@@ -11,7 +12,7 @@ import { decodeTime } from "ulid";
|
||||
import { Text } from "preact-i18n";
|
||||
import { useEffect, useState } from "preact/hooks";
|
||||
|
||||
import { MessageDivider } from "@revoltchat/ui";
|
||||
import { MessageDivider, Preloader } from "@revoltchat/ui";
|
||||
|
||||
import { internalSubscribe, internalEmit } from "../../../lib/eventEmitter";
|
||||
import { ChannelRenderer } from "../../../lib/renderer/Singleton";
|
||||
@@ -23,11 +24,9 @@ import { useClient } from "../../../context/revoltjs/RevoltClient";
|
||||
|
||||
import Message from "../../../components/common/messaging/Message";
|
||||
import { SystemMessage } from "../../../components/common/messaging/SystemMessage";
|
||||
import Preloader from "../../../components/ui/Preloader";
|
||||
import { Children } from "../../../types/Preact";
|
||||
import ConversationStart from "./ConversationStart";
|
||||
import MessageEditor from "./MessageEditor";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
interface Props {
|
||||
last_id?: string;
|
||||
@@ -126,7 +125,12 @@ export default observer(({ last_id, renderer, highlight }: Props) => {
|
||||
}
|
||||
|
||||
if (unread || date) {
|
||||
render.push(<MessageDivider date={dayjs(date).format("LL")} unread={unread} />);
|
||||
render.push(
|
||||
<MessageDivider
|
||||
date={dayjs(date).format("LL")}
|
||||
unread={unread}
|
||||
/>,
|
||||
);
|
||||
head = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user