File tree Expand file tree Collapse file tree 2 files changed +11
-20
lines changed
src/components/Nav/Mobile Expand file tree Collapse file tree 2 files changed +11
-20
lines changed Original file line number Diff line number Diff line change 1
1
import { SheetClose , SheetTitle } from "@/components/ui/sheet"
2
2
3
+ import { useMobileMenu } from "./MobileMenuContent"
4
+
3
5
import { useTranslation } from "@/hooks/useTranslation"
4
6
5
7
const MenuHeader = ( ) => {
6
8
const { t } = useTranslation ( "common" )
9
+ const { setCurrentView } = useMobileMenu ( )
7
10
8
11
return (
9
12
< div className = "flex items-center justify-between p-6" >
10
13
< SheetTitle className = "p-0 text-md uppercase text-body-medium" >
11
14
{ t ( "site-title" ) }
12
15
</ SheetTitle >
13
- < SheetClose className = "w-fit text-md" > { t ( "close" ) } </ SheetClose >
16
+ < SheetClose
17
+ className = "w-fit text-md"
18
+ onClick = { ( ) => {
19
+ setCurrentView ( "menu" )
20
+ } }
21
+ >
22
+ { t ( "close" ) }
23
+ </ SheetClose >
14
24
</ div >
15
25
)
16
26
}
Original file line number Diff line number Diff line change 1
1
"use client"
2
2
3
3
import { memo } from "react"
4
- import { ChevronLeft } from "lucide-react"
5
4
import { useParams } from "next/navigation"
6
5
import { useLocale } from "next-intl"
7
6
8
7
import type { LocaleDisplayInfo } from "@/lib/types"
9
8
10
9
import { ButtonLink } from "@/components/ui/buttons/Button"
11
- import { Button } from "@/components/ui/buttons/Button"
12
10
13
11
import { DEFAULT_LOCALE } from "@/lib/constants"
14
12
@@ -41,10 +39,6 @@ const MobileLanguagePicker = memo(
41
39
const { languages : sortedLanguages , intlLanguagePreference } =
42
40
useLanguagePicker ( languages )
43
41
44
- const handleBackClick = ( ) => {
45
- setCurrentView ( "menu" )
46
- }
47
-
48
42
const handleMenuItemSelect = ( currentValue : string ) => {
49
43
push (
50
44
// @ts -expect-error -- TypeScript will validate that only known `params`
@@ -69,19 +63,6 @@ const MobileLanguagePicker = memo(
69
63
70
64
return (
71
65
< div className = "flex h-full flex-col" >
72
- { /* Back navigation */ }
73
- < div className = "border-b border-body-light p-4" >
74
- < Button
75
- variant = "ghost"
76
- size = "sm"
77
- onClick = { handleBackClick }
78
- className = "flex items-center gap-2 p-0 text-body"
79
- >
80
- < ChevronLeft className = "h-4 w-4" />
81
- Back
82
- </ Button >
83
- </ div >
84
-
85
66
{ /* Language picker menu */ }
86
67
< div className = "flex-1 overflow-auto" >
87
68
< LanguagePickerMenu
You can’t perform that action at this time.
0 commit comments