11---
2- import LinkToHome from ' ./LinkToHome .astro' ;
2+ import AuxiliaryFrame from ' ./AuxiliaryFrame .astro' ;
33const path = Astro .url .pathname .replace (/ \/ $ / , ' ' );
44
55const allToys = await Astro .glob (' ../../pages/toys/*.mdx' );
@@ -14,34 +14,20 @@ const pathMatchesUrl = (url: string) => {
1414};
1515---
1616
17- <!-- -z-10 is important to be not blocking interactivity on the main components as this components expands to full screen -->
18- <aside class =" fixed top-0 left-0 h-full w-full flex lt-lg:hidden -z-10" >
19- <div class =" flex-1 flex" >
20- <div class =" grow" ></div >
21- <!-- main -->
22- <div class =" w-48 xl:w-60 text-gray-500" >
23- <!-- "invisible" to act as a place holder while the real one is coming from ./Header.astro -->
24- <header class =" py-2.5 sticky top-0 w-full invisible" >
25- <LinkToHome />
26- </header >
27- <!-- safe list class="text-gray-800" -->
28- <nav class =" px-3" >
29- <h2 class =" mt-10 my-2 font-bold text-gray-500" >Toys</h2 >
30- <ul class =" text-sm" >
31- {
32- allToys .map ((toy ) => (
33- <li class = " truncate" >
34- <a href = { toy .url } class = { toy .url && pathMatchesUrl (toy .url ) ? ' text-gray-800' : ' ' } >
35- { toy .frontmatter .title }
36- </a >
37- </li >
38- ))
39- }
40- </ul >
41- </nav >
42- </div >
43- </div >
44- <!-- place holder to represent the actual content-->
45- <div class =" w-prose" ></div >
46- <div class =" flex-1" ></div >
47- </aside >
17+ <AuxiliaryFrame >
18+ <nav slot =" left" class =" mt-10 px-3" >
19+ <h2 class =" my-2 font-bold text-gray-500" >Toys</h2 >
20+ <!-- safe list class="text-gray-800" -->
21+ <ul class =" text-sm text-gray-500" >
22+ {
23+ allToys .map ((toy ) => (
24+ <li class = " truncate hover:text-gray-700" >
25+ <a href = { toy .url } class = { toy .url && pathMatchesUrl (toy .url ) ? ' text-gray-800' : ' ' } >
26+ { toy .frontmatter .title }
27+ </a >
28+ </li >
29+ ))
30+ }
31+ </ul >
32+ </nav >
33+ </AuxiliaryFrame >
0 commit comments