File tree Expand file tree Collapse file tree
packages/astro/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
22import { Icon } from " astro-icon/components" ;
33
4- const icons = {
5- twitter: " twitter" ,
6- facebook: " facebook" ,
7- linkedin: " linkedin" ,
8- github: " github" ,
9- slack: " slack" ,
10- meetup: " meetup" ,
11- };
12-
134const routes = [
145 [
156 " Resources" ,
@@ -44,7 +35,7 @@ const routes = [
4435 [" https://www.meetup.com/sfcivictech/" , " meetup" , true ],
4536 ],
4637 ],
47- ];
38+ ] as const ;
4839// because of annoying differences between dev and build modes, due to this
4940// behavior (https://github.com/withastro/astro/issues/5630), always remove
5041// any trailing slash so currentPage can match the pages above
Original file line number Diff line number Diff line change @@ -29,9 +29,9 @@ const currentPage = fullPath.slice(fullPath.lastIndexOf("/") + 1);
2929 </ul >
3030 <ul >
3131 { routes .map (route => (
32- <li class = { ` nav-item ${route .pages ?.length > 0 ? " dropdown" : " " } ` } >
32+ <li class = { ` nav-item ${!! route .pages ?.length ? " dropdown" : " " } ` } >
3333 <a href = { route .page } aria-current = { currentPage === route .page ? " page" : false } >{ route .label } </a >
34- { route .pages ?.length > 0 &&
34+ { !! route .pages ?.length &&
3535 <div class = " dropdown-content" >
3636 { route .pages .map (page => (
3737 <a href = { page .page } aria-current = { currentPage === page .page ? " page" : false } >{ page .label } </a >
@@ -54,7 +54,7 @@ const currentPage = fullPath.slice(fullPath.lastIndexOf("/") + 1);
5454 position: relative;
5555 display: inline-block;
5656 }
57-
57+
5858 .dropdown-content {
5959 display: none;
6060 position: absolute;
@@ -63,16 +63,16 @@ const currentPage = fullPath.slice(fullPath.lastIndexOf("/") + 1);
6363 box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
6464 z-index: 1;
6565 }
66-
66+
6767 .dropdown-content a {
6868 color: black;
6969 padding: 12px 16px;
7070 text-decoration: none;
7171 display: block;
7272 }
73-
73+
7474 .dropdown:hover .dropdown-content {
7575 display: block;
7676 }
77-
77+
7878</style >
You can’t perform that action at this time.
0 commit comments