@@ -19,20 +19,14 @@ import { Search } from "../molecules/search";
1919
2020export const menuHeight = "55px" ;
2121
22- interface MobileBlogHeaderContainerProps {
23- hide : boolean ;
24- }
25-
26- const MobileBlogHeaderContainer = styled (
27- ContainerFluid ,
28- ) < MobileBlogHeaderContainerProps > `
22+ const MobileBlogHeaderContainer = styled ( ContainerFluid ) < { $hide : boolean } > `
2923 height: ${ menuHeight } ;
3024 display: flex;
3125 flex-direction: column;
3226 justify-content: center;
3327 align-items: center;
34- transition: opacity 0.2s ease ${ ( props ) => ( props . hide ? "0s" : "0.4s" ) } ;
35- opacity: ${ ( props ) => ( props . hide ? 0 : 1 ) } ;
28+ transition: opacity 0.2s ease ${ ( props ) => ( props . $ hide ? "0s" : "0.4s" ) } ;
29+ opacity: ${ ( props ) => ( props . $ hide ? 0 : 1 ) } ;
3630
3731 ${ mediaQuery . minWidth . sm } {
3832 display: none;
@@ -63,36 +57,30 @@ const MenuButtonContainer = styled.div`
6357 }
6458` ;
6559
66- interface MenuContainerProps {
67- shouldHide : boolean ;
68- shouldOpenMenu : boolean ;
69- delayOpenCloseMenuAnimation : number ;
70- }
71-
72- const MenuContainer = styled . div < MenuContainerProps > `
60+ const MenuContainer = styled . div < {
61+ $shouldHide : boolean ;
62+ $shouldOpenMenu : boolean ;
63+ $delayOpenCloseMenuAnimation : number ;
64+ } > `
7365 background-color: ${ ( props ) => props . theme . light . primaryColorDark } ;
7466 box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
7567 position: fixed;
76- top: ${ ( props ) => ( props . shouldHide ? `-${ menuHeight } ` : 0 ) } ;
68+ top: ${ ( props ) => ( props . $ shouldHide ? `-${ menuHeight } ` : 0 ) } ;
7769 left: 0;
7870 right: 0;
7971 transition:
8072 top 0.3s ease 0s,
81- height 0.3s ease ${ ( props ) => `${ props . delayOpenCloseMenuAnimation } s` } ;
73+ height 0.3s ease ${ ( props ) => `${ props . $ delayOpenCloseMenuAnimation} s` } ;
8274 width: 100%;
8375 z-index: 300;
84- height: ${ ( props ) => ( props . shouldOpenMenu ? "260px" : menuHeight ) } ;
76+ height: ${ ( props ) => ( props . $ shouldOpenMenu ? "260px" : menuHeight ) } ;
8577
8678 ${ mediaQuery . dark } {
8779 background-color: ${ ( props ) => props . theme . dark . primaryColorDark } ;
8880 }
8981` ;
9082
91- interface NavBarProps {
92- shouldOpenMenu : boolean ;
93- }
94-
95- const NavBar = styled ( Container ) < NavBarProps > `
83+ const NavBar = styled ( Container ) `
9684 display: flex;
9785 flex-direction: column;
9886 align-items: center;
@@ -247,12 +235,12 @@ export const BlogMenu: FC<MenuProps> = ({ trackingCategory, pathname }) => {
247235 return (
248236 < >
249237 < MenuContainer
250- shouldOpenMenu = { shouldOpenMenu }
251- shouldHide = { direction === ScrollDirection . down }
252- delayOpenCloseMenuAnimation = { shouldOpenMenu ? 0 : 0.4 }
238+ $ shouldOpenMenu= { shouldOpenMenu }
239+ $ shouldHide= { direction === ScrollDirection . down }
240+ $ delayOpenCloseMenuAnimation= { shouldOpenMenu ? 0 : 0.4 }
253241 >
254- < NavBar shouldOpenMenu = { shouldOpenMenu } >
255- < MobileBlogHeaderContainer hide = { startSearch } >
242+ < NavBar >
243+ < MobileBlogHeaderContainer $ hide= { startSearch } >
256244 < MobileBlogHeader height = { menuHeight } />
257245 { shouldOpenMenu && < Divider /> }
258246 </ MobileBlogHeaderContainer >
0 commit comments