Skip to content

Commit 192b6e9

Browse files
committed
better menu items
1 parent df1feaf commit 192b6e9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Diff for: src/components/Menu.module.scss

+8
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,12 @@
7373
&.selected::after {
7474
transform: none;
7575
}
76+
77+
&.hide_underline::after {
78+
transform: scaleY(0);
79+
}
80+
81+
&.hide_underline.selected::after {
82+
transform: none;
83+
}
7684
}

Diff for: src/components/Menu.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import {Link, useLocation} from 'react-router-dom';
22
import React from 'react';
33
import styles from './Menu.module.scss';
4+
import {useFormFactor} from '../hooks';
45

56
export const MenuItem:React.FC<{label: string, pathname: string}> = (props) => {
67
const location = useLocation();
8+
const formFactor = useFormFactor();
79
const classList = [styles.MenuItem];
810
if (location.pathname === props.pathname) classList.push(styles.selected);
11+
if (formFactor === 'mobile') classList.push(styles.hide_underline);
912
return (
1013
<div className={classList.join(' ')}>
1114
<Link to={props.pathname}>

0 commit comments

Comments
 (0)