99} from "react" ;
1010import {
1111 ArchiveIcon ,
12- ArrowLeftIcon ,
1312 BlocksIcon ,
1413 BotIcon ,
1514 GitBranchIcon ,
@@ -20,7 +19,7 @@ import {
2019 Settings2Icon ,
2120 XIcon ,
2221} from "lucide-react" ;
23- import { useCanGoBack , useLocation , useNavigate } from "@tanstack/react-router" ;
22+ import { useLocation , useNavigate } from "@tanstack/react-router" ;
2423
2524import { Button } from "../ui/button" ;
2625import { Input } from "../ui/input" ;
@@ -35,6 +34,7 @@ import {
3534 useSidebar ,
3635} from "../ui/sidebar" ;
3736import { T3ConnectSidebarAvatar , T3ConnectSidebarSignIn } from "../clerk/T3ConnectSidebarSignIn" ;
37+ import { SidebarUtilityMenu } from "../sidebar/SidebarChrome" ;
3838import { scrollToSettingsTarget } from "./settingsLayout" ;
3939import {
4040 searchSettings ,
@@ -74,7 +74,6 @@ function SettingsSectionIcon({ to }: { to: SettingsPath }) {
7474export function SettingsSidebarNav ( { pathname } : { pathname : string } ) {
7575 const navigate = useNavigate ( ) ;
7676 const currentHash = useLocation ( { select : ( location ) => location . hash } ) ;
77- const canGoBack = useCanGoBack ( ) ;
7877 const { isMobile, setOpenMobile, open, setOpen } = useSidebar ( ) ;
7978 const searchInputRef = useRef < HTMLInputElement > ( null ) ;
8079 const [ query , setQuery ] = useState ( "" ) ;
@@ -178,17 +177,6 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
178177 } ,
179178 [ activeResultIndex , clearSearch , handleSearchResultClick , isSearching , results ] ,
180179 ) ;
181- const handleBackClick = useCallback ( ( ) => {
182- if ( isMobile ) {
183- setOpenMobile ( false ) ;
184- }
185- if ( canGoBack ) {
186- window . history . back ( ) ;
187- return ;
188- }
189- void navigate ( { to : "/" } ) ;
190- } , [ canGoBack , isMobile , navigate , setOpenMobile ] ) ;
191-
192180 return (
193181 < >
194182 < SidebarContent className = "overflow-x-hidden" >
@@ -298,14 +286,9 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
298286 < SidebarFooter className = "p-[var(--sidebar-content-inset)]" >
299287 < T3ConnectSidebarSignIn />
300288 < div className = "flex items-center gap-1" >
301- < SidebarMenu className = "min-w-0 flex-1" >
302- < SidebarMenuItem >
303- < SidebarMenuButton onClick = { handleBackClick } >
304- < ArrowLeftIcon />
305- < span > Back</ span >
306- </ SidebarMenuButton >
307- </ SidebarMenuItem >
308- </ SidebarMenu >
289+ < div className = "min-w-0 flex-1" >
290+ < SidebarUtilityMenu />
291+ </ div >
309292 < T3ConnectSidebarAvatar />
310293 </ div >
311294 </ SidebarFooter >
0 commit comments