diff --git a/site/src/components/ShapeBuilder/index.js b/site/src/components/ShapeBuilder/index.js index 2ac9fc4..439bdce 100644 --- a/site/src/components/ShapeBuilder/index.js +++ b/site/src/components/ShapeBuilder/index.js @@ -1,7 +1,7 @@ // /* global window */ import React, { useEffect, useRef, useState } from "react"; -import { Wrapper, Controls, CanvasContainer, OutputBox, StyledSVG } from "./shapeBuilder.styles"; -import { Button, Typography } from "@layer5/sistent"; +import { Wrapper, CanvasContainer, OutputBox, StyledSVG } from "./shapeBuilder.styles"; +import { Button, Typography, Box } from "@layer5/sistent"; // import { useTheme } from "@layer5/sistent/components/ThemeProvider"; // import { useMediaQuery } from "@layer5/sistent/components/MediaQuery"; @@ -182,10 +182,10 @@ const ShapeBuilder = () => { {error && ( -
{ )} - + - + - + diff --git a/site/src/components/utils/instructionsModal.js b/site/src/components/utils/instructionsModal.js new file mode 100644 index 0000000..2b08e39 --- /dev/null +++ b/site/src/components/utils/instructionsModal.js @@ -0,0 +1,50 @@ +import React from "react"; +import { Modal, ModalBody, Typography, List, ListItem, ListItemText, ModalFooter } from "@layer5/sistent"; + +const instructionPoints = [ + { + primary: "Press CTRL + Enter to close the shape", + secondary: "It won’t draw the last position of your cursor, don’t stress!" + }, + { + primary: "Hold CTRL to snap to grid", + secondary: "Snap to Grid is default, CTRL allows you to freely draw with precision" + }, + { + primary: "CTRL + Z to undo", + secondary: "Undo the last point you placed" + }, + { + primary: "Maximize for better visibility", + secondary: "Without maximize, it may appear tiny" + }, +]; + +const InstructionsModal = ({open, onClose}) => { + + return ( + + + + {instructionPoints.map(({ primary, secondary }, idx) => ( + + {primary}} + secondary={{secondary}} + /> + + ))} + + + + + + ); +}; + +export default InstructionsModal; diff --git a/site/src/pages/index.js b/site/src/pages/index.js index dbaa114..a512b3f 100644 --- a/site/src/pages/index.js +++ b/site/src/pages/index.js @@ -1,30 +1,46 @@ -import React from "react"; +import React, { useState } from "react"; import { ThemeProvider } from "styled-components"; import { GlobalStyle, Main, lightTheme, darkTheme } from "../styles/styles"; import { useDarkMode } from "../components/useDarkMode"; import Navigation from "../components/Navigation"; import Footer from "../components/Footer"; import ShapeBuilder from "../components/ShapeBuilder"; +import { Button, SistentThemeProviderWithoutBaseLine, Box } from "@layer5/sistent" +import InstructionsModal from "../components/utils/instructionsModal"; const IndexPage = () => { + // const themesistent = useTheme(); const [theme, toggleTheme] = useDarkMode(); const themeMode = theme === "light" ? lightTheme : darkTheme; + const [open, setOpen] = useState(false); return ( - - - -
-
-

Shape Builder

-

- Click on the grid to start creating a polygon. Each click adds a point. -

-
- -
-