Panayiotis Lipiridis 4 년 전
부모
커밋
49363afac1
2개의 변경된 파일124개의 추가작업 그리고 66개의 파일을 삭제
  1. 6 7
      src/components/Stats.tsx
  2. 118 59
      src/tests/__snapshots__/regressionTests.test.tsx.snap

+ 6 - 7
src/components/Stats.tsx

@@ -46,6 +46,11 @@ export const Stats = (props: {
   const selectedElements = getTargetElements(props.elements, props.appState);
   const selectedBoundingBox = getCommonBounds(selectedElements);
 
+  const onGridSizeChange = () => {
+    //TODO: Update the state properly and rerender the grid
+    props.appState.gridSize = ((props.appState.gridSize - 5) % 50) + 10;
+  };
+
   if (isMobile && props.appState.openMenu) {
     return null;
   }
@@ -162,13 +167,7 @@ export const Stats = (props: {
                 <tr>
                   <th colSpan={2}>{"Misc"}</th>
                 </tr>
-                <tr
-                  onClick={() => {
-                    // TODO: better way to update the gridSize and re-render the scene
-                    props.appState.gridSize =
-                      ((props.appState.gridSize - 5) % 50) + 10;
-                  }}
-                >
+                <tr onClick={onGridSizeChange} style={{ cursor: "pointer" }}>
                   <td>{"Grid size"}</td>
                   <td>{props.appState.gridSize}</td>
                 </tr>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 118 - 59
src/tests/__snapshots__/regressionTests.test.tsx.snap


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.