Skip to content

Commit b3caf24

Browse files
committed
Fix: unused warnings
1 parent 7fc2570 commit b3caf24

File tree

3 files changed

+43
-41
lines changed

3 files changed

+43
-41
lines changed

src/commons/sidebar/collections/collection_item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function CollectionItem(props: any) {
3333
const deleteItem = useRequestStore((state) => state.deleteItem);
3434

3535
const [_isHoveredFolder, setIsHoveredFolder] = useState<boolean>(false);
36-
const [_isHoveredOther, setIsHoveredOther] = useState<boolean>(false);
36+
// const [_isHoveredOther, setIsHoveredOther] = useState<boolean>(false);
3737

3838
const [renaming, setRenaming] = useState<boolean>(false);
3939

src/commons/sidebar/collections/folder_item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function FolderItem(props: any) {
3333
const deleteItem = useRequestStore((state) => state.deleteItem);
3434

3535
const [_isHoveredFolder, setIsHoveredFolder] = useState<boolean>(false);
36-
const [_isHoveredOther, setIsHoveredOther] = useState<boolean>(false);
36+
// const [_isHoveredOther, setIsHoveredOther] = useState<boolean>(false);
3737

3838
const [renaming, setRenaming] = useState<boolean>(false);
3939

src/commons/sidebar/collections/recursive_tree.tsx

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as stylex from "@stylexjs/stylex";
22

3-
import ArrowRightSVG from "../../../assets/arrow-right.svg?react";
4-
import ArrowDownSVG from "../../../assets/arrow-down.svg?react";
3+
// import ArrowRightSVG from "../../../assets/arrow-right.svg?react";
4+
// import ArrowDownSVG from "../../../assets/arrow-down.svg?react";
55
import MoreHorSVG from "../../../assets/more-hor.svg?react";
6-
import FolderSVG from "../../../assets/folder.svg?react";
6+
// import FolderSVG from "../../../assets/folder.svg?react";
77
// import FavoriteInactiveSVG from "../../../assets/favorite-inactive.svg?react";
88
// import FavoriteSVG from "../../../assets/favorite.svg?react";
99
import { autoHeaders, methods } from "@src/stores/request_store/request_slice";
@@ -12,13 +12,13 @@ import { useState } from "react";
1212
import { useNavigate } from "react-router";
1313

1414
import {
15-
Button,
16-
ButtonVariants,
15+
// Button,
16+
// ButtonVariants,
1717
DropdownMenu,
1818
DropdownMenuContent,
1919
DropdownMenuItem,
2020
DropdownMenuTrigger,
21-
Label,
21+
// Label,
2222
} from "@controlkit/ui";
2323

2424
import {
@@ -102,10 +102,12 @@ function ColoredMethod(props: any) {
102102
export default function RecursiveTree(props: any) {
103103
const navigate = useNavigate();
104104

105-
const collection = useRequestStore((state) => state.collection);
106-
const setCollection = useRequestStore((state) => state.setCollection);
107-
const addFolder = useRequestStore((state) => state.addFolder);
108-
const addRequest = useRequestStore((state) => state.addRequest);
105+
// const collection = useRequestStore((state) => state.collection);
106+
// const setCollection = useRequestStore((state) => state.setCollection);
107+
108+
// const addFolder = useRequestStore((state) => state.addFolder);
109+
// const addRequest = useRequestStore((state) => state.addRequest);
110+
109111
const deleteItem = useRequestStore((state) => state.deleteItem);
110112
const setRequestParameters = useRequestStore(
111113
(state) => state.setRequestParameters,
@@ -124,37 +126,37 @@ export default function RecursiveTree(props: any) {
124126
// const setTabState = useRequestStore((state) => state.setTabState);
125127

126128
// TODO: remove this when moving the sub comps into their own files
127-
const [_isHoveredFolder, setIsHoveredFolder] = useState<boolean>(false);
129+
// const [_isHoveredFolder, setIsHoveredFolder] = useState<boolean>(false);
128130
const [_isHoveredOther, setIsHoveredOther] = useState<boolean>(false);
129131

130-
function updateTargetIfExists(
131-
nc: any,
132-
id: string,
133-
field: string,
134-
value: any,
135-
) {
136-
for (let i = 0; i < nc.length; ++i) {
137-
// console.log("NC", nc[i].id);
138-
139-
if (nc[i].id === id) {
140-
nc[i][field] = value;
141-
// console.log("FOUND", nc[i]);
142-
return;
143-
}
144-
145-
if (nc[i].items) {
146-
updateTargetIfExists(nc[i].items, id, field, value);
147-
}
148-
}
149-
}
150-
151-
function toggleField(id: string, field: string, value: any) {
152-
const nc = structuredClone(collection);
153-
// console.log("START", id, nc);
154-
updateTargetIfExists(nc, id, field, value);
155-
// console.log("END", nc);
156-
setCollection(nc);
157-
}
132+
// function updateTargetIfExists(
133+
// nc: any,
134+
// id: string,
135+
// field: string,
136+
// value: any,
137+
// ) {
138+
// for (let i = 0; i < nc.length; ++i) {
139+
// // console.log("NC", nc[i].id);
140+
141+
// if (nc[i].id === id) {
142+
// nc[i][field] = value;
143+
// // console.log("FOUND", nc[i]);
144+
// return;
145+
// }
146+
147+
// if (nc[i].items) {
148+
// updateTargetIfExists(nc[i].items, id, field, value);
149+
// }
150+
// }
151+
// }
152+
153+
// function toggleField(id: string, field: string, value: any) {
154+
// const nc = structuredClone(collection);
155+
// // console.log("START", id, nc);
156+
// updateTargetIfExists(nc, id, field, value);
157+
// // console.log("END", nc);
158+
// setCollection(nc);
159+
// }
158160

159161
return (
160162
<div>

0 commit comments

Comments
 (0)