Skip to content

Commit 44bd43d

Browse files
author
Kevin
committed
fix: reorder imports for better organization and clarity
1 parent 6b30f8c commit 44bd43d

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

src/components/Agent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import { useAgentPosition } from "client/state";
1414
import { head, last, thru } from "lodash";
1515
import { ComponentProps, Suspense } from "react";
1616
import { useBoolean, useTween } from "react-use";
17-
import { rectangleRounded } from "./rectangleRounded";
1817
import { DoubleSide } from "three";
18+
import { rectangleRounded } from "./rectangleRounded";
1919

2020
const font = `./fonts/geist-medium.ttf`;
2121

src/components/Agents.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Instances, useGLTF, useTexture } from "@react-three/drei";
2+
import { useSolutionContents } from "client/run";
23
import { useModel } from "hooks/useModel";
34
import { range } from "lodash";
45
import { Suspense, useMemo } from "react";
5-
import { MeshPhysicalMaterial, MeshStandardMaterial } from "three";
6+
import { MeshPhysicalMaterial } from "three";
67
import { Agent } from "./Agent";
7-
import { useSolutionContents } from "client/run";
88

99
useGLTF.preload("./robot-final.gltf");
1010
useTexture.preload("./base.png");

src/components/Stage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { GizmoHelper, GizmoViewport, Sky } from "@react-three/drei";
1+
import { GizmoHelper, GizmoViewport } from "@react-three/drei";
22
import { Canvas } from "@react-three/fiber";
3+
import { ACESFilmicToneMapping } from "three";
34
import { CameraControls } from "./CameraControls";
45
import { Contents } from "./Contents";
56
import { Light } from "./Light";
6-
import { ACESFilmicToneMapping } from "three";
77

88
export function Stage() {
99
return (

src/hooks/useExample.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1-
import { basename } from "utils";
2-
import { sizes, useFile } from "./useMap";
3-
import { usePreview } from "./usePreview";
41
import { useMutation } from "@tanstack/react-query";
52
import {
63
useFlip,
74
useMapFile,
85
useScenarioFile,
96
useSolutionFile,
107
} from "client/run";
8+
import { useClear } from "client/state";
9+
import { basename } from "utils";
10+
import { sizes, useFile } from "./useMap";
11+
import { usePreview } from "./usePreview";
1112

1213
export function useExample(path: string) {
1314
const { data: file, isLoading } = useFile(path);
1415
const preview = usePreview(file);
1516
const [, setSolutionFile] = useSolutionFile();
16-
const [mapFile, setMapFile] = useMapFile();
17+
const [, setMapFile] = useMapFile();
1718
const [, setScenarioFile] = useScenarioFile();
19+
const clear = useClear();
1820
const [, setFlip] = useFlip();
1921
const open = useMutation({
2022
mutationKey: ["open-example", path],
2123
mutationFn: async (size: (typeof sizes)[number]) => {
2224
if (!file) return null;
25+
await clear();
2326
const name = basename(path, true);
2427
const solution = `/examples/${name}/path/${size}/scen_1_paths.txt`;
2528
const scen = `/examples/${name}-random-1.scen`;
@@ -35,7 +38,6 @@ export function useExample(path: string) {
3538
new File([await fetch(scen).then((r) => r.blob())], basename(scen), {})
3639
);
3740
setFlip(false);
38-
console.log(file, mapFile);
3941
},
4042
});
4143
return {

src/leva-controls/Inputs.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
import { usePlaying, autoplayAtom } from "client/play";
1+
import { autoplayAtom, usePlaying } from "client/play";
22
import {
3+
useFlip,
34
useMapFile,
4-
useScenarioFile,
5-
useSolutionFile,
65
useRun,
6+
useScenarioFile,
77
useSolutionContents,
8-
useFlip,
8+
useSolutionFile,
99
} from "client/run";
1010
import { useClear, useLength } from "client/state";
11-
import { useControls, button } from "leva";
12-
import { filePicker } from "leva-file-picker";
13-
import { store } from "store";
14-
import { Suspense } from "react";
11+
import { button, useControls } from "leva";
1512
import { file } from "leva-plugins/file";
13+
import { Suspense } from "react";
14+
import { store } from "store";
1615

1716
export function Inputs() {
1817
const [, setPlaying] = usePlaying();

0 commit comments

Comments
 (0)