11import useCustomSearchParams from '@/hooks/useCustomSearchParams' ;
2+ import { Locale } from '@/navigation' ;
23import { SearchOutlined } from '@mui/icons-material' ;
3- import { Box , Typography } from '@mui/material' ;
4+ import { Box , Stack , Typography } from '@mui/material' ;
45import { grey } from '@mui/material/colors' ;
6+ import { useLocale , useTranslations } from 'next-intl' ;
57import { useState } from 'react' ;
68import SearchDialog from './SearchDialog' ;
79import SearchSection from './SearchSection' ;
8- import { useTranslations } from 'next-intl' ;
910
1011const MobileHeader = ( ) => {
1112 const { navigate, q } = useCustomSearchParams ( ) ;
@@ -22,44 +23,55 @@ const MobileHeader = () => {
2223 } ;
2324
2425 const t = useTranslations ( ) ;
26+
27+ const locale = useLocale ( ) as Locale ;
28+
29+ // const backIcons: Record<Direction, ReactNode> = {
30+ // rtl: <ArrowForward />,
31+ // ltr: <ArrowBack />,
32+ // };
33+ // {backIcons[languages[locale].direction]}
34+
2535 return (
2636 < >
27- < Box
28- onClick = { handleToggleDialog }
29- sx = { {
30- my : 1 ,
31- backgroundColor : grey [ 200 ] ,
32- width : '100%' ,
33- borderRadius : ( theme ) => theme . shape . borderRadius / 8 ,
34- height : 44 ,
35- display : 'flex' ,
36- alignItems : 'center' ,
37- cursor : 'pointer' ,
38- } }
39- >
40- < SearchOutlined
41- htmlColor = { grey [ 500 ] }
42- sx = { {
43- height : 24 ,
44- ml : 2 ,
45- } }
46- />
47- < Typography
48- variant = "body2"
49- sx = { {
50- color : grey [ 500 ] ,
51- pl : 1 ,
52- } }
53- >
54- { q ? q : t ( 'header.search.placeholder' ) }
55- </ Typography >
56- </ Box >
5737 < SearchDialog open = { open } onClose = { handleToggleDialog } >
5838 < SearchSection
5939 onClickOnBack = { handleToggleDialog }
6040 onClickOnSearch = { onClickOnSearch }
6141 />
6242 </ SearchDialog >
43+ < Stack direction = "row" spacing = { 1 } alignItems = "center" height = { 56 } >
44+ < Box
45+ onClick = { handleToggleDialog }
46+ sx = { {
47+ my : 1 ,
48+ backgroundColor : grey [ 200 ] ,
49+ width : '100%' ,
50+ borderRadius : ( theme ) => theme . shape . borderRadius / 8 ,
51+ display : 'flex' ,
52+ alignItems : 'center' ,
53+ cursor : 'pointer' ,
54+ height : '80%' ,
55+ } }
56+ >
57+ < SearchOutlined
58+ htmlColor = { grey [ 500 ] }
59+ sx = { {
60+ height : 24 ,
61+ ml : 2 ,
62+ } }
63+ />
64+ < Typography
65+ variant = "body2"
66+ sx = { {
67+ color : grey [ 500 ] ,
68+ pl : 1 ,
69+ } }
70+ >
71+ { q ? q : t ( 'header.search.placeholder' ) }
72+ </ Typography >
73+ </ Box >
74+ </ Stack >
6375 </ >
6476 ) ;
6577} ;
0 commit comments