Jelajahi Sumber

fix: #965 improve loading animation

Yidadaa 1 tahun lalu
induk
melakukan
ab826363ea
2 mengubah file dengan 6 tambahan dan 6 penghapusan
  1. 4 1
      app/components/home.module.scss
  2. 2 5
      app/components/home.tsx

+ 4 - 1
app/components/home.module.scss

@@ -313,6 +313,10 @@
 .chat-message {
 .chat-message {
   display: flex;
   display: flex;
   flex-direction: row;
   flex-direction: row;
+
+  &:last-child {
+    animation: slide-in ease 0.3s;
+  }
 }
 }
 
 
 .chat-message-user {
 .chat-message-user {
@@ -325,7 +329,6 @@
   display: flex;
   display: flex;
   flex-direction: column;
   flex-direction: column;
   align-items: flex-start;
   align-items: flex-start;
-  animation: slide-in ease 0.3s;
 
 
   &:hover {
   &:hover {
     .chat-message-top-actions {
     .chat-message-top-actions {

+ 2 - 5
app/components/home.tsx

@@ -2,7 +2,7 @@
 
 
 require("../polyfill");
 require("../polyfill");
 
 
-import { useState, useEffect } from "react";
+import { useState, useEffect, StyleHTMLAttributes } from "react";
 
 
 import styles from "./home.module.scss";
 import styles from "./home.module.scss";
 
 
@@ -23,6 +23,7 @@ import {
   Route,
   Route,
   useLocation,
   useLocation,
 } from "react-router-dom";
 } from "react-router-dom";
+import { SideBar } from "./sidebar";
 
 
 export function Loading(props: { noLogo?: boolean }) {
 export function Loading(props: { noLogo?: boolean }) {
   return (
   return (
@@ -37,10 +38,6 @@ const Settings = dynamic(async () => (await import("./settings")).Settings, {
   loading: () => <Loading noLogo />,
   loading: () => <Loading noLogo />,
 });
 });
 
 
-const SideBar = dynamic(async () => (await import("./sidebar")).SideBar, {
-  loading: () => <Loading noLogo />,
-});
-
 export function useSwitchTheme() {
 export function useSwitchTheme() {
   const config = useChatStore((state) => state.config);
   const config = useChatStore((state) => state.config);