File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 73
73
& .selected ::after {
74
74
transform : none ;
75
75
}
76
+
77
+ & .hide_underline ::after {
78
+ transform : scaleY (0 );
79
+ }
80
+
81
+ & .hide_underline.selected ::after {
82
+ transform : none ;
83
+ }
76
84
}
Original file line number Diff line number Diff line change 1
1
import { Link , useLocation } from 'react-router-dom' ;
2
2
import React from 'react' ;
3
3
import styles from './Menu.module.scss' ;
4
+ import { useFormFactor } from '../hooks' ;
4
5
5
6
export const MenuItem :React . FC < { label : string , pathname : string } > = ( props ) => {
6
7
const location = useLocation ( ) ;
8
+ const formFactor = useFormFactor ( ) ;
7
9
const classList = [ styles . MenuItem ] ;
8
10
if ( location . pathname === props . pathname ) classList . push ( styles . selected ) ;
11
+ if ( formFactor === 'mobile' ) classList . push ( styles . hide_underline ) ;
9
12
return (
10
13
< div className = { classList . join ( ' ' ) } >
11
14
< Link to = { props . pathname } >
You can’t perform that action at this time.
0 commit comments