diff --git a/.eslintcache b/.eslintcache index 76511ad..a73c4ec 100644 --- a/.eslintcache +++ b/.eslintcache @@ -1 +1 @@ -[{"/Users/user/repos/sort-measurer/src/index.js":"1","/Users/user/repos/sort-measurer/src/App.js":"2","/Users/user/repos/sort-measurer/src/reportWebVitals.js":"3","/Users/user/repos/sort-measurer/src/components/Playground.js":"4","/Users/user/repos/sort-measurer/src/components/Figure.js":"5"},{"size":500,"mtime":1611856800075,"results":"6","hashOfConfig":"7"},{"size":5605,"mtime":1612117286585,"results":"8","hashOfConfig":"7"},{"size":362,"mtime":1611856800076,"results":"9","hashOfConfig":"7"},{"size":2114,"mtime":1611951553195,"results":"10","hashOfConfig":"7"},{"size":307,"mtime":1611951739720,"results":"11","hashOfConfig":"7"},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"14"},"ff9ndh",{"filePath":"15","messages":"16","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"17","messages":"18","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"14"},{"filePath":"19","messages":"20","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"14"},{"filePath":"21","messages":"22","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"14"},"/Users/user/repos/sort-measurer/src/index.js",[],["23","24"],"/Users/user/repos/sort-measurer/src/App.js",[],"/Users/user/repos/sort-measurer/src/reportWebVitals.js",[],"/Users/user/repos/sort-measurer/src/components/Playground.js",[],"/Users/user/repos/sort-measurer/src/components/Figure.js",[],{"ruleId":"25","replacedBy":"26"},{"ruleId":"27","replacedBy":"28"},"no-native-reassign",["29"],"no-negated-in-lhs",["30"],"no-global-assign","no-unsafe-negation"] \ No newline at end of file +[{"/Users/user/repos/sort-measurer/src/index.js":"1","/Users/user/repos/sort-measurer/src/App.js":"2","/Users/user/repos/sort-measurer/src/reportWebVitals.js":"3","/Users/user/repos/sort-measurer/src/components/Playground.js":"4","/Users/user/repos/sort-measurer/src/components/Figure.js":"5"},{"size":500,"mtime":1611856800075,"results":"6","hashOfConfig":"7"},{"size":5290,"mtime":1612117913487,"results":"8","hashOfConfig":"7"},{"size":362,"mtime":1611856800076,"results":"9","hashOfConfig":"7"},{"size":2114,"mtime":1611951553195,"results":"10","hashOfConfig":"7"},{"size":307,"mtime":1611951739720,"results":"11","hashOfConfig":"7"},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"14"},"ff9ndh",{"filePath":"15","messages":"16","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"17","messages":"18","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"14"},{"filePath":"19","messages":"20","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"14"},{"filePath":"21","messages":"22","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"14"},"/Users/user/repos/sort-measurer/src/index.js",[],["23","24"],"/Users/user/repos/sort-measurer/src/App.js",[],"/Users/user/repos/sort-measurer/src/reportWebVitals.js",[],"/Users/user/repos/sort-measurer/src/components/Playground.js",[],"/Users/user/repos/sort-measurer/src/components/Figure.js",[],{"ruleId":"25","replacedBy":"26"},{"ruleId":"27","replacedBy":"28"},"no-native-reassign",["29"],"no-negated-in-lhs",["30"],"no-global-assign","no-unsafe-negation"] \ No newline at end of file diff --git a/src/App.js b/src/App.js index f10def2..670d7e8 100644 --- a/src/App.js +++ b/src/App.js @@ -9,13 +9,17 @@ var randomColor = Math.floor(Math.random() * 16777215).toString(16); var current = "#" + randomColor; function App() { - const theme = { boxWidth: "200px", boxHeight: "300px" }; + const rectangleMeasures = { boxWidth: "200px", boxHeight: "300px" }; const [sheetWidth, setSheetWidth] = useState(""); const [sheetHeight, setSheetHeight] = useState(""); - const [rectangleWidth, setRectangleWidth] = useState(theme.boxWidth); - const [rectangleHeight, setRectangleHeight] = useState(theme.boxHeight); + const [rectangleWidth, setRectangleWidth] = useState( + rectangleMeasures.boxWidth + ); + const [rectangleHeight, setRectangleHeight] = useState( + rectangleMeasures.boxHeight + ); - const { setRef, setVariable } = useTheme(theme); + const { setRef, setVariable } = useTheme(rectangleMeasures); const handleSheetDimensionsSubmit = (e) => { e.preventDefault(); @@ -28,23 +32,6 @@ function App() { alert(`Rectangle dimensons: ${rectangleWidth} x ${rectangleHeight}`); }; - /* - -// Define theme object where key name is CSS value name without `--` prefix. - - -const Demo = () => { - - - // Call useTheme hook with theme object as an argument. - - - // Define click handler. We are useing setVariable function returned from thw hook here - const handleClick = () => { - // Change CSS variable `--boxColor` to the value from the user input. - - }; - */ return ( <>