Explorar o código

new button center

visuddhinanda hai 8 meses
pai
achega
885fc99f10

+ 43 - 42
dashboard-v4/dashboard/src/components/template/SentEdit/SentCanRead.tsx

@@ -105,51 +105,52 @@ const SentCanReadWidget = ({
           onClick={() => load()}
           onClick={() => load()}
         />
         />
       </div>
       </div>
-      <SentAdd
-        disableChannels={channels}
-        type={type}
-        onSelect={(channel: IChannel) => {
-          if (typeof user === "undefined") {
-            return;
-          }
-          const newSent: ISentence = {
-            content: "",
-            contentType: "markdown",
-            html: "",
-            book: book,
-            para: para,
-            wordStart: wordStart,
-            wordEnd: wordEnd,
-            editor: {
-              id: user.id,
-              nickName: user.nickName,
-              userName: user.realName,
-            },
-            channel: channel,
-            translationChannels: channelsId,
-            updateAt: "",
-            openInEditMode: true,
-          };
-          setSentData((origin) => {
-            return [newSent, ...origin];
-          });
+      <div style={{ textAlign: "center" }}>
+        <SentAdd
+          disableChannels={channels}
+          type={type}
+          onSelect={(channel: IChannel) => {
+            if (typeof user === "undefined") {
+              return;
+            }
+            const newSent: ISentence = {
+              content: "",
+              contentType: "markdown",
+              html: "",
+              book: book,
+              para: para,
+              wordStart: wordStart,
+              wordEnd: wordEnd,
+              editor: {
+                id: user.id,
+                nickName: user.nickName,
+                userName: user.realName,
+              },
+              channel: channel,
+              translationChannels: channelsId,
+              updateAt: "",
+              openInEditMode: true,
+            };
+            setSentData((origin) => {
+              return [newSent, ...origin];
+            });
 
 
-          setChannels((origin) => {
-            if (origin) {
-              if (!origin.includes(newSent.channel.id)) {
-                origin.push(newSent.channel.id);
-                return origin;
+            setChannels((origin) => {
+              if (origin) {
+                if (!origin.includes(newSent.channel.id)) {
+                  origin.push(newSent.channel.id);
+                  return origin;
+                }
+              } else {
+                return [newSent.channel.id];
               }
               }
-            } else {
-              return [newSent.channel.id];
+            });
+            if (typeof onCreate !== "undefined") {
+              onCreate();
             }
             }
-          });
-          if (typeof onCreate !== "undefined") {
-            onCreate();
-          }
-        }}
-      />
-
+          }}
+        />
+      </div>
       {sentData.map((item, id) => {
       {sentData.map((item, id) => {
         let diffText: string | null = null;
         let diffText: string | null = null;
         if (origin) {
         if (origin) {