|
1 | 1 | import { ArrowLeftIcon, ChartNoAxesColumnIcon, SettingsIcon } from "lucide-react"; |
2 | 2 | import type { ReactNode } from "react"; |
3 | | -import { memo, useCallback } from "react"; |
| 3 | +import { memo } from "react"; |
4 | 4 | import { Link, useLocation, useNavigate } from "@tanstack/react-router"; |
5 | 5 |
|
6 | 6 | import { useEnvironmentIdentificationMode } from "../../hooks/useSettings"; |
@@ -81,14 +81,11 @@ export function SidebarBrandWidthProbe({ |
81 | 81 | }: { |
82 | 82 | onWidthChange: (width: number) => void; |
83 | 83 | }) { |
84 | | - const observeWidth = useCallback( |
85 | | - (probe: HTMLDivElement) => { |
86 | | - return observeResize(probe, ([entry]) => { |
87 | | - if (entry) onWidthChange(entry.borderBoxSize[0]?.inlineSize ?? probe.offsetWidth); |
88 | | - }); |
89 | | - }, |
90 | | - [onWidthChange], |
91 | | - ); |
| 84 | + const observeWidth = (probe: HTMLDivElement) => { |
| 85 | + return observeResize(probe, ([entry]) => { |
| 86 | + if (entry) onWidthChange(entry.borderBoxSize[0]?.inlineSize ?? probe.offsetWidth); |
| 87 | + }); |
| 88 | + }; |
92 | 89 |
|
93 | 90 | return ( |
94 | 91 | <div |
@@ -167,34 +164,34 @@ export const SidebarUtilityMenu = memo(function SidebarUtilityMenu() { |
167 | 164 | select: (location) => isSidebarUtilityPage(location.pathname), |
168 | 165 | }); |
169 | 166 | const pullRequestsSupported = usePullRequestsSupported(); |
170 | | - const closeMobileSidebar = useCallback(() => { |
| 167 | + const closeMobileSidebar = () => { |
171 | 168 | if (isMobile) { |
172 | 169 | setOpenMobile(false); |
173 | 170 | } |
174 | | - }, [isMobile, setOpenMobile]); |
175 | | - const handlePullRequestsClick = useCallback(() => { |
| 171 | + }; |
| 172 | + const handlePullRequestsClick = () => { |
176 | 173 | closeMobileSidebar(); |
177 | 174 | void navigate({ |
178 | 175 | to: "/pull-requests", |
179 | 176 | search: readPullRequestListPreferences(), |
180 | 177 | }); |
181 | | - }, [closeMobileSidebar, navigate]); |
182 | | - const handleSettingsClick = useCallback(() => { |
| 178 | + }; |
| 179 | + const handleSettingsClick = () => { |
183 | 180 | closeMobileSidebar(); |
184 | 181 | void navigate({ to: "/settings" }); |
185 | | - }, [closeMobileSidebar, navigate]); |
| 182 | + }; |
186 | 183 |
|
187 | | - const handleUsageClick = useCallback(() => { |
| 184 | + const handleUsageClick = () => { |
188 | 185 | if (isMobile) { |
189 | 186 | setOpenMobile(false); |
190 | 187 | } |
191 | 188 | void navigate({ to: "/usage" }); |
192 | | - }, [isMobile, navigate, setOpenMobile]); |
| 189 | + }; |
193 | 190 |
|
194 | | - const handleBackClick = useCallback(() => { |
| 191 | + const handleBackClick = () => { |
195 | 192 | closeMobileSidebar(); |
196 | 193 | void navigateToMainApp(); |
197 | | - }, [closeMobileSidebar, navigateToMainApp]); |
| 194 | + }; |
198 | 195 |
|
199 | 196 | return ( |
200 | 197 | <SidebarMenu className="flex-row items-center"> |
|
0 commit comments