File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ import { QuartzComponent , QuartzComponentConstructor , QuartzComponentProps } from "./types"
2+ import style from "./styles/navigationlinks.scss"
3+
4+ // @ts -ignore
5+ import script from "./scripts/navigationlinks.inline"
6+
7+ interface Options {
8+ links : Record < string , string >
9+ }
10+
11+ export default ( ( opts ?: Options ) => {
12+ const NavigationLinks : QuartzComponent = ( props : QuartzComponentProps ) => {
13+ const links = opts ?. links ?? [ ]
14+ return (
15+ < nav class = "nav-links" >
16+ < button className = "menu-btn" > Menu</ button >
17+ < ul class = "links" >
18+ { Object . entries ( links ) . map ( ( [ text , link ] ) => (
19+ < li >
20+ < a href = { link } > { text } </ a >
21+ </ li >
22+ ) ) }
23+ </ ul >
24+ </ nav >
25+ )
26+ }
27+
28+ NavigationLinks . css = style
29+ NavigationLinks . afterDOMLoaded = script
30+
31+ return NavigationLinks
32+ } ) satisfies QuartzComponentConstructor
You can’t perform that action at this time.
0 commit comments