1- import React , { useState } from "react" ;
1+ import React from "react" ;
2+ import styled from "styled-components" ; // Ensure you have styled imported
23import { ThemeProvider } from "styled-components" ;
34import { GlobalStyle , Main , lightTheme , darkTheme } from "../styles/styles" ;
45import { useDarkMode } from "../components/useDarkMode" ;
56import Navigation from "../components/Navigation" ;
67import Footer from "../components/Footer" ;
78import ShapeBuilder from "../components/ShapeBuilder" ;
8- import { Button , SistentThemeProviderWithoutBaseLine , Box } from "@sistent/sistent" ;
9- import InstructionsModal from "../components/utils/instructionsModal" ;
9+ import { SistentThemeProviderWithoutBaseLine , Box } from "@sistent/sistent" ;
10+
11+ const Kbd = styled . kbd `
12+ background-color: ${ ( { theme } ) =>
13+ theme === lightTheme ? "#f4f4f4" : "#2b2b2b" } ;
14+ border: 1px solid
15+ ${ ( { theme } ) => ( theme === lightTheme ? "#d1d5da" : "#444" ) } ;
16+ border-bottom-color: ${ ( { theme } ) =>
17+ theme === lightTheme ? "#c6cbd1" : "#444" } ;
18+ border-radius: 3px;
19+ box-shadow: inset 0 -1px 0
20+ ${ ( { theme } ) => ( theme === lightTheme ? "#c6cbd1" : "#444" ) } ;
21+ color: ${ ( { theme } ) => ( theme === lightTheme ? "#444" : "#e6e6e6" ) } ;
22+ display: inline-block;
23+ font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
24+ font-size: 11px;
25+ font-weight: 600;
26+ line-height: 1;
27+ padding: 3px 6px;
28+ margin-right: 6px;
29+ vertical-align: middle;
30+ ` ;
31+
32+ const InstructionsContainer = styled . div `
33+ display: flex;
34+ justify-content: center;
35+ align-items: center;
36+ flex-wrap: wrap;
37+ gap: 24px;
38+ margin-top: 16px;
39+ font-size: 0.9rem;
40+ color: ${ ( { theme } ) => ( theme === lightTheme ? "#666" : "#aaa" ) } ;
41+
42+ span {
43+ display: flex;
44+ align-items: center;
45+ }
46+ ` ;
1047
1148const IndexPage = ( ) => {
12- // const themesistent = useTheme();
1349 const [ theme , toggleTheme ] = useDarkMode ( ) ;
1450 const themeMode = theme === "light" ? lightTheme : darkTheme ;
15- const [ open , setOpen ] = useState ( false ) ;
1651
1752 return (
1853 < SistentThemeProviderWithoutBaseLine >
@@ -21,21 +56,45 @@ const IndexPage = () => {
2156 < Navigation theme = { theme } toggleTheme = { toggleTheme } />
2257 < Main >
2358 < section className = "hero" >
24- < h1 > Shape Builder</ h1 >
25- < p className = "desc-text" >
26- Click on the grid to start creating a polygon. Each click adds a point.
27- </ p >
28- </ section >
29- < Box sx = { { display : "flex" , justifyContent : "center" , mt : 2 } } >
30- < Button
31- variant = "contained"
32- sx = { { minWidth : "fit-content" } }
33- onClick = { ( ) => setOpen ( true ) }
59+ < Box
60+ sx = { {
61+ display : "flex" ,
62+ flexDirection : "column" , // Changed to column to stack title and text
63+ alignItems : "center" ,
64+ justifyContent : "center" ,
65+ gap : 2 ,
66+ mb : 4 ,
67+ } }
3468 >
35- Show Instructions
36- </ Button >
37- </ Box >
38- < InstructionsModal open = { open } onClose = { ( ) => setOpen ( false ) } />
69+ < h1 > Shape Builder</ h1 >
70+
71+ < p className = "desc-text" style = { { margin : 0 } } >
72+ Click on the grid to start creating a polygon. Each click adds a
73+ point.
74+ </ p >
75+
76+ < InstructionsContainer theme = { themeMode } >
77+ < span >
78+ < Kbd theme = { themeMode } > ENTER</ Kbd >
79+ Close shape
80+ </ span >
81+
82+ < span >
83+ < Kbd theme = { themeMode } > CTRL</ Kbd > Snap to grid
84+ </ span >
85+
86+ < span >
87+ < Kbd theme = { themeMode } > CTRL</ Kbd > +{ " " }
88+ < Kbd theme = { themeMode } > Z</ Kbd > Undo
89+ </ span >
90+
91+ < span >
92+ < Kbd theme = { themeMode } > Maximize</ Kbd > Visibility
93+ </ span >
94+ </ InstructionsContainer >
95+ </ Box >
96+ </ section >
97+
3998 < ShapeBuilder />
4099 </ Main >
41100 < Footer />
0 commit comments