From ab646cdef17b530a5f4545fa96eba5927d368e1d Mon Sep 17 00:00:00 2001 From: Kellan Wampler Date: Thu, 14 Jul 2022 15:29:14 -0400 Subject: [PATCH] Fixed sizing on Example Code for mobile screen sizes. --- .../src/components/EngineOverviewDiagram.js | 28 ++-- frontend/src/components/ExampleCode.js | 135 ++++++++---------- 2 files changed, 76 insertions(+), 87 deletions(-) diff --git a/frontend/src/components/EngineOverviewDiagram.js b/frontend/src/components/EngineOverviewDiagram.js index ac5d2ef1..a86b125e 100644 --- a/frontend/src/components/EngineOverviewDiagram.js +++ b/frontend/src/components/EngineOverviewDiagram.js @@ -62,7 +62,7 @@ const _EngineOverviewDiagram = (props) => { @@ -71,7 +71,7 @@ const _EngineOverviewDiagram = (props) => { left="0" top="0" w={["260px", "260px", "400px"]} - h={["73", "73", "114px"]} + h="130px" > @@ -105,7 +105,7 @@ const _EngineOverviewDiagram = (props) => {
@@ -124,26 +124,26 @@ const _EngineOverviewDiagram = (props) => { >
- +
Admin Dashboard {!smallDiagram && ( - + Choose mechanics at engine.moonstream.to )} @@ -183,7 +183,7 @@ const _EngineOverviewDiagram = (props) => { > - + @@ -205,10 +205,10 @@ const _EngineOverviewDiagram = (props) => { h={["120px", "120px", "188px"]} position="relative" > - +
diff --git a/frontend/src/components/ExampleCode.js b/frontend/src/components/ExampleCode.js index f62949b0..066b959c 100644 --- a/frontend/src/components/ExampleCode.js +++ b/frontend/src/components/ExampleCode.js @@ -1,81 +1,70 @@ import React from "react"; import { Flex, Heading } from "@chakra-ui/react"; -import showdown from "showdown"; -import showdownHighlight from "showdown-highlight"; const ExampleCode = () => { - const converter = new showdown.Converter({ - ghCompatibleHeaderId: true, - parseImgDimensions: true, - simplifiedAutoLink: true, - literalMidWordUnderscores: true, - strikethrough: true, - tables: true, - tasklists: true, - openLinksInNewWindow: true, - emoji: true, - smartIndentationFix: true, - extensions: [showdownHighlight({ pre: true })], - disableForced4SpacesIndentedSublists: true, - ghCodeBlocks: true, - }); - const HtmlCode = () => { return ( -
-        
-          {"async"}{" "}
-          
-            function{" "}
-            startRandomLootboxOpening
-            {"("}
-            lootboxId
-            {")"}{" "}
-          
-          {"{"}
-          
-     - {"let"} {"userAddress ="}{" "} - {"window"} - {".ethereum.selectedAddress;"} -
-     - {"let"} activeOpening ={" "} - {"await"}{" "} - {"checkUsersActiveLootboxOpeningStatus(userAddress);"} -
-     - {"if"} (activeOpening !={" "} - null - {") {"} -
-         - {"console"} - {".log"}( - - "User already has active opening" - - {");"} -
-         - {"return"};
-     - {"}"} -
-     - const count ={" "} - 1;{" "} - - {"// you can open only 1 random lootbox at a time"} - -
-     - await{" "} - openOrdinaryLootbox(lootboxId, count); -
- {"}"} -
-
+ +
+          
+            {"async"}{" "}
+            
+              function{" "}
+              startRandomLootboxOpening
+              {"("}
+              lootboxId
+              {")"}{" "}
+            
+            {"{"}
+            
+     + {"let"} {"userAddress ="}{" "} + {"window"} + {".ethereum.selectedAddress;"} +
+     + {"let"} activeOpening ={" "} + {"await"}{" "} + {"checkUsersActiveLootboxOpeningStatus(userAddress);"} +
+     + {"if"} (activeOpening !={" "} + null + {") {"} +
+         + {"console"} + {".log"}( + + "User already has active opening" + + {");"} +
+         + {"return"};
+     + {"}"} +
+     + const count ={" "} + 1;{" "} + + {"// you can open only 1 random lootbox at a time"} + +
+     + await{" "} + openOrdinaryLootbox(lootboxId, count); +
+ {"}"} +
+
+
); }; @@ -84,7 +73,7 @@ const ExampleCode = () => { flexDirection="column" textColor="white" bgColor="#686464" - p="20px" + p={["5px", "10px", "25px"]} rounded="lg" >