Browse Source

control buttons styling

AykutSarac 3 years ago
parent
commit
77baa95fa9
1 changed files with 24 additions and 4 deletions
  1. 24 4
      src/pages/editor/LiveEditor/index.tsx

+ 24 - 4
src/pages/editor/LiveEditor/index.tsx

@@ -1,6 +1,7 @@
 import React from "react";
 import React from "react";
 import styled, { css } from "styled-components";
 import styled, { css } from "styled-components";
 import ReactFlow, {
 import ReactFlow, {
+  ControlButton,
   Controls,
   Controls,
   Elements,
   Elements,
   isNode,
   isNode,
@@ -25,6 +26,27 @@ const nodeExtent: NodeExtent = [
 const StyledLiveEditor = styled.div`
 const StyledLiveEditor = styled.div`
   width: 100%;
   width: 100%;
   height: 100%;
   height: 100%;
+
+  .react-flow__controls {
+    display: grid;
+    grid-template-columns: repeat(3, 1fr);
+    grid-template-rows: repeat(2, 1fr);
+    gap: 8px;
+    right: 10px;
+    left: unset;
+  }
+
+  .react-flow__controls-button {
+    background: ${({ theme }) => theme.BLACK_PRIMARY};
+    fill: ${({ theme }) => theme.SILVER};
+    color: ${({ theme }) => theme.SILVER};
+    font-weight: 600;
+    border: 1px solid ${({ theme }) => theme.BLACK};
+
+    &:hover {
+      background: unset;
+    }
+  }
 `;
 `;
 
 
 const onLayout = (
 const onLayout = (
@@ -105,13 +127,11 @@ const LiveEditor: React.FC = () => {
           }}
           }}
         >
         >
           <Controls>
           <Controls>
-            <button
-              type="button"
-              className="react-flow__controls-button react-flow__controls-zoomin"
+            <ControlButton
               onClick={() => onLayout("RL", elements, setElements)}
               onClick={() => onLayout("RL", elements, setElements)}
             >
             >
               Style
               Style
-            </button>
+            </ControlButton>
           </Controls>
           </Controls>
         </ReactFlow>
         </ReactFlow>
       </ReactFlowProvider>
       </ReactFlowProvider>