Skip to content

Commit 39c063e

Browse files
committed
Use menu/li structure for upper menu
[DISCO-196]
1 parent c85756c commit 39c063e

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

src/app/components/shell/header/menus/upper-menu/upper-menu.scss

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
.container {
2929
align-items: center;
3030
display: grid;
31+
margin: 0;
3132

3233
@include width-up-to($tablet-max) {
3334
justify-items: left;
@@ -91,8 +92,9 @@
9192
overflow: hidden;
9293
width: 0;
9394

94-
> img {
95+
img {
9596
max-height: 3rem;
97+
vertical-align: middle;
9698
}
9799

98100
@media (max-height: #{39em * $scale-factor}) {

src/app/components/shell/header/menus/upper-menu/upper-menu.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ function MenuItem({label, url, showButton}: {
2525
if (label === 'Give') {
2626
return showButton ?
2727
null :
28-
<a className="nav-menu" target="_blank" rel="noreferrer" href={url}>
28+
<li className="nav-menu"><a target="_blank" rel="noreferrer" href={url}>
2929
{label}
30-
</a>
30+
</a></li>
3131
;
3232
}
3333

3434
return (
35-
<a className="nav-menu" href={url}>{label}</a>
35+
<li className="nav-menu"><a href={url}>{label}</a></li>
3636
);
3737
}
3838

@@ -43,16 +43,16 @@ export default function UpperMenu() {
4343
const riceLogo = useOptimizedImage('https://openstax.org/dist/images/rice.webp', 80);
4444

4545
return (
46-
<div className="container" data-analytics-nav="Upper Menu">
46+
<menu className="container" data-analytics-nav="Upper Menu">
4747
{
4848
menuData.map(
4949
({label, url}) => <MenuItem key={label} label={label} url={url} showButton={showButton} />
5050
)
5151
}
52-
<a className="logo rice-logo logo-wrapper" href="http://www.rice.edu">
52+
<li className="logo rice-logo logo-wrapper"><a href="http://www.rice.edu">
5353
<img src={riceLogo} alt="Rice University logo" height="30" width="79" />
54-
</a>
54+
</a></li>
5555
{showButton ? <JITLoad importFn={importGiveButton} /> : null}
56-
</div>
56+
</menu>
5757
);
5858
}

src/styles/main.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ strong {
4545
font-weight: bold;
4646
}
4747

48-
.no-bullets {
48+
.no-bullets,
49+
menu {
4950
// Hide bullets in IE
5051
list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
5152
list-style-type: none;

0 commit comments

Comments
 (0)