visuddhinanda 2 лет назад
Родитель
Сommit
c9840f0762
1 измененных файлов с 34 добавлено и 32 удалено
  1. 34 32
      dashboard/src/components/template/SentEdit/EditInfo.tsx

+ 34 - 32
dashboard/src/components/template/SentEdit/EditInfo.tsx

@@ -9,42 +9,42 @@ import { ISentence } from "../SentEdit";
 
 const { Text } = Typography;
 
+interface IDetailsWidget {
+  data: ISentence;
+  isPr?: boolean;
+}
+const Details = ({ data, isPr }: IDetailsWidget) => (
+  <Space>
+    <Channel {...data.channel} />
+    <User {...data.editor} showAvatar={isPr ? true : false} />
+    {data.prEditAt ? (
+      <TimeShow
+        type="secondary"
+        updatedAt={data.prEditAt}
+        createdAt={data.createdAt}
+      />
+    ) : (
+      <TimeShow
+        type="secondary"
+        updatedAt={data.updateAt}
+        createdAt={data.createdAt}
+      />
+    )}
+    {data.acceptor ? <User {...data.acceptor} showAvatar={false} /> : undefined}
+    {data.acceptor ? "accept at" : undefined}
+    {data.prEditAt ? (
+      <TimeShow type="secondary" updatedAt={data.updateAt} showLabel={false} />
+    ) : undefined}
+  </Space>
+);
+
 interface IWidget {
   data: ISentence;
   isPr?: boolean;
   compact?: boolean;
 }
 const EditInfoWidget = ({ data, isPr = false, compact = false }: IWidget) => {
-  const details = (
-    <Space>
-      <Channel {...data.channel} />
-      <User {...data.editor} showAvatar={isPr ? true : false} />
-      {data.prEditAt ? (
-        <TimeShow
-          type="secondary"
-          updatedAt={data.prEditAt}
-          createdAt={data.createdAt}
-        />
-      ) : (
-        <TimeShow
-          type="secondary"
-          updatedAt={data.updateAt}
-          createdAt={data.createdAt}
-        />
-      )}
-      {data.acceptor ? (
-        <User {...data.acceptor} showAvatar={false} />
-      ) : undefined}
-      {data.acceptor ? "accept at" : undefined}
-      {data.prEditAt ? (
-        <TimeShow
-          type="secondary"
-          updatedAt={data.updateAt}
-          showLabel={false}
-        />
-      ) : undefined}
-    </Space>
-  );
+  console.log("data.createdAt", data.createdAt, data.updateAt);
   return (
     <div style={{ fontSize: "80%" }}>
       <Text type="secondary">
@@ -53,10 +53,12 @@ const EditInfoWidget = ({ data, isPr = false, compact = false }: IWidget) => {
             <StudioName
               data={data.studio}
               showName={false}
-              popOver={compact ? details : undefined}
+              popOver={
+                compact ? <Details data={data} isPr={isPr} /> : undefined
+              }
             />
           )}
-          {compact ? undefined : details}
+          {compact ? undefined : <Details data={data} isPr={isPr} />}
         </Space>
       </Text>
     </div>