Bläddra i källkod

阅读模式无边框

visuddhinanda 1 år sedan
förälder
incheckning
ea7dd4e621
1 ändrade filer med 7 tillägg och 6 borttagningar
  1. 7 6
      dashboard/src/components/template/ParaShell.tsx

+ 7 - 6
dashboard/src/components/template/ParaShell.tsx

@@ -41,12 +41,15 @@ const ParaShellCtl = ({
       setIsFocus(false);
       setIsFocus(false);
     }
     }
   }, [book, focus, para]);
   }, [book, focus, para]);
+
+  const borderColor = isFocus ? "#e35f00bd " : "rgba(128, 128, 128, 0.3)";
+
+  const border = mode === "read" ? "" : "2px solid " + borderColor;
+
   return (
   return (
     <div
     <div
       style={{
       style={{
-        border: isFocus
-          ? "2px solid #e35f00bd "
-          : "2px solid rgba(128, 128, 128, 0.3)",
+        border: border,
         borderRadius: 6,
         borderRadius: 6,
         marginTop: 20,
         marginTop: 20,
         marginBottom: 28,
         marginBottom: 28,
@@ -58,9 +61,7 @@ const ParaShellCtl = ({
           position: "absolute",
           position: "absolute",
           marginTop: -31,
           marginTop: -31,
           marginLeft: -6,
           marginLeft: -6,
-          border: isFocus
-            ? "2px solid #e35f00bd "
-            : "2px solid rgba(128, 128, 128, 0.3)",
+          border: border,
           borderRadius: "6px",
           borderRadius: "6px",
         }}
         }}
       >
       >