22 ComponentProps ,
33 For ,
44 Show ,
5- createMemo ,
65 createSignal ,
76 onCleanup ,
87 onMount ,
@@ -31,7 +30,7 @@ interface NavLinkProps extends ComponentProps<"a"> {
3130function NavLink ( props : NavLinkProps ) {
3231 return (
3332 < a
34- class = "duration-250 relative overflow-hidden border-b-2 px-2 text-slate-900 drop-shadow-[0_35px_35px_rgba(1,1,1,1.75)] transition-all dark:text-slate-200"
33+ class = "relative overflow-hidden border-b-2 px-2 text-slate-900 drop-shadow-[0_35px_35px_rgba(1,1,1,1.75)] transition-all duration-250 dark:text-slate-200"
3534 classList = { {
3635 "border-b-blue-500 dark:bottom-b-blue-500" : props . active ,
3736 "border-transparent" : ! props . active ,
@@ -87,7 +86,7 @@ export function MainHeader(props: MainHeaderProps) {
8786 "dark:bg-transparent bg-transparent" : ! isScrolled ( ) ,
8887 } }
8988 >
90- < div class = "mx-auto grid w-full max-w-8xl grid-cols-2 items-center px-4 py-2 lg:grid-cols-[1fr_2fr_1fr]" >
89+ < div class = "max-w-8xl mx-auto grid w-full grid-cols-2 items-center px-4 py-2 lg:grid-cols-[1fr_2fr_1fr]" >
9190 < div class = "flex justify-start gap-2" >
9291 < div class = "flex lg:hidden" >
9392 < MobileNavigation />
@@ -97,24 +96,22 @@ export function MainHeader(props: MainHeaderProps) {
9796 </ a >
9897 </ div >
9998
100- < Show when = { config ( ) . themeConfig ?. nav } >
101- { ( nav ) => (
102- < For each = { nav ( ) } >
103- { ( item ) => {
99+ < Show when = { config ( ) . themeConfig ?. projects } >
100+ { ( projects ) => (
101+ < For each = { projects ( ) } >
102+ { ( p ) => {
104103 const match = useMatch ( ( ) =>
105- locale . applyPathPrefix (
106- `${ item . activeMatch ?? item . link } /*rest`
107- )
104+ locale . applyPathPrefix ( `${ p . path } /*rest` )
108105 ) ;
109106
110107 return (
111108 < li >
112109 < NavLink
113- href = { locale . applyPathPrefix ( item . link ) }
110+ href = { locale . applyPathPrefix ( p . path ) }
114111 data-matched = { match ( ) !== undefined ? true : undefined }
115112 onClick = { ( ) => setNavOpen ( false ) }
116113 >
117- { item . text }
114+ { p . name }
118115 </ NavLink >
119116 </ li >
120117 ) ;
0 commit comments