Skip to content

Commit 35a177c

Browse files
committed
chore: format files
1 parent 406ad50 commit 35a177c

File tree

10 files changed

+68
-173
lines changed

10 files changed

+68
-173
lines changed

Diff for: apps/web/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "tsc && vite build",
9+
"format": "prettier --write src",
910
"lint": "eslint .",
1011
"lint:fix": "eslint --fix .",
1112
"preview": "vite preview",

Diff for: apps/web/src/components/floor-display/EdgesDisplay.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { Graph } from "@cmumaps/common";
2+
13
import { useMemo } from "react";
24
import { Line } from "react-konva";
35

4-
import { Graph } from "@cmumaps/common";
56
import useValidatedFloorParams from "../../hooks/useValidatedFloorParams";
67
import { selectEditPolygon } from "../../store/features/modeSlice";
78
import { useAppSelector } from "../../store/hooks";

Diff for: apps/web/src/components/ui-layout/HelpInfo.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { ReactNode, useState } from "react";
22
import { IconType } from "react-icons";
33
import { AiOutlineMacCommand } from "react-icons/ai";
44
import { MdOutlinePalette } from "react-icons/md";
5-
import QuestionCircle from "../shared/QuestionCircle";
65

6+
import QuestionCircle from "../shared/QuestionCircle";
77

88
const HelpInfo = () => {
99
const IconHelper = (IconComponent: IconType, renderText: () => ReactNode) => {

Diff for: apps/web/src/components/ui-layout/MainDisplay.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import {
1010
useGetFloorRoomsQuery,
1111
} from "../../store/api/floorDataApiSlice";
1212
import InfoDisplay from "../info-display/InfoDisplay";
13-
import SidePanel from "../side-panel/SidePanel";
14-
import ZoomPanWrapper from "../zoom-pan/ZoomPanWrapper";
1513
import ErrorDisplay from "../shared/ErrorDisplay";
1614
import Loader from "../shared/Loader";
15+
import SidePanel from "../side-panel/SidePanel";
16+
import ZoomPanWrapper from "../zoom-pan/ZoomPanWrapper";
1717

1818
interface Props {
1919
floorCode: string;

Diff for: apps/web/src/hooks/useFloorInfo.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import {
2-
extractBuildingCode,
3-
extractFloorLevel,
4-
} from "@cmumaps/common";
1+
import { extractBuildingCode, extractFloorLevel } from "@cmumaps/common";
52

63
const useFloorInfo = (floorCode: string) => {
74
const buildingCode = extractBuildingCode(floorCode);

Diff for: apps/web/src/hooks/useValidatedFloorParams.ts

+30-30
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useMemo } from "react";
1+
import { useEffect, useMemo } from "react";
22
import { useDispatch } from "react-redux";
33
import { useNavigate, useSearchParams } from "react-router";
44

@@ -50,47 +50,47 @@ const useValidatedFloorParams = (floorCode: string): FloorParamsResult => {
5050
return {};
5151
}
5252

53-
if (roomId && !rooms[roomId]) {
54-
return { error: "Invalid Room ID" };
55-
}
53+
if (roomId && !rooms[roomId]) {
54+
return { error: "Invalid Room ID" };
55+
}
5656

57-
if (poiId && !pois[poiId]) {
58-
return { error: "Invalid POI ID" };
59-
}
57+
if (poiId && !pois[poiId]) {
58+
return { error: "Invalid POI ID" };
59+
}
6060

61-
if (nodeId && !graph[nodeId]) {
62-
return { error: "Invalid Node ID" };
63-
}
61+
if (nodeId && !graph[nodeId]) {
62+
return { error: "Invalid Node ID" };
63+
}
6464

65-
if (roomId) {
66-
// no way to get the nodeId from the roomId since a room can have multiple nodes
67-
return { roomId };
68-
}
65+
if (roomId) {
66+
// no way to get the nodeId from the roomId since a room can have multiple nodes
67+
return { roomId };
68+
}
6969

70-
if (poiId) {
71-
// nodeId can be the nodeId of the poi
72-
const nodeId = pois[poiId].nodeId;
70+
if (poiId) {
71+
// nodeId can be the nodeId of the poi
72+
const nodeId = pois[poiId].nodeId;
7373

74-
// roomId can be the roomId of the node
75-
const roomId = graph[nodeId].roomId;
74+
// roomId can be the roomId of the node
75+
const roomId = graph[nodeId].roomId;
7676

77-
return { poiId, nodeId, roomId };
78-
}
77+
return { poiId, nodeId, roomId };
78+
}
7979

80-
if (nodeId) {
81-
// poiId can be the poiId of the node
82-
const poiId = Object.entries(pois).find(
83-
(poi) => poi[1].nodeId === nodeId,
84-
)?.[0];
80+
if (nodeId) {
81+
// poiId can be the poiId of the node
82+
const poiId = Object.entries(pois).find(
83+
(poi) => poi[1].nodeId === nodeId,
84+
)?.[0];
8585

86-
// roomId can be the roomId of the node
87-
const roomId = graph[nodeId].roomId;
86+
// roomId can be the roomId of the node
87+
const roomId = graph[nodeId].roomId;
8888

89-
return { nodeId, poiId, roomId };
89+
return { nodeId, poiId, roomId };
9090
}
9191

9292
return {};
93-
// eslint-disable-next-line react-hooks/exhaustive-deps
93+
// eslint-disable-next-line react-hooks/exhaustive-deps
9494
}, [nodeId, roomId, poiId]);
9595

9696
return result;

Diff for: apps/web/src/store/api/nodeApiSlice.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const deleteNode =
5252
return;
5353
}
5454

55-
// delete edges connected to the node
55+
// delete edges connected to the node
5656
for (const neighborId in draft[nodeId].neighbors) {
5757
delete draft[neighborId].neighbors[nodeId];
5858
}

Diff for: package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
"scripts": {
1212
"start": "turbo run start",
1313
"build": "turbo build --parallel",
14-
"dev": "turbo dev --parallel"
14+
"dev": "turbo dev --parallel",
15+
"format": "turbo format --parallel"
1516
},
1617
"devDependencies": {
1718
"eslint": "^9.21.0",
19+
"prettier": "^3.5.3",
1820
"turbo": "^2.4.4",
1921
"typescript": "^5.8.2"
2022
}

0 commit comments

Comments
 (0)