-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathindex.jsx
More file actions
37 lines (33 loc) · 1.12 KB
/
index.jsx
File metadata and controls
37 lines (33 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import ThemeToggle from '@node-core/ui-components/Common/ThemeToggle';
import NavBar from '@node-core/ui-components/Containers/NavBar';
import styles from '@node-core/ui-components/Containers/NavBar/index.module.css';
import GitHubIcon from '@node-core/ui-components/Icons/Social/GitHub';
import SearchBox from '@node-core/doc-kit/src/generators/web/ui/components/SearchBox';
import { useTheme } from '@node-core/doc-kit/src/generators/web/ui/hooks/useTheme.mjs';
import Logo from '#theme/Logo';
import { topNav } from '../config.json' with { type: 'json' };
/**
* NavBar component that displays the headings, search, etc.
*/
export default () => {
const [theme, toggleTheme] = useTheme();
return (
<NavBar
Logo={Logo}
sidebarItemTogglerAriaLabel="Toggle navigation menu"
navItems={topNav}
>
<SearchBox />
<ThemeToggle
onClick={toggleTheme}
aria-label={`Switch to ${theme === 'light' ? 'dark' : 'light'} theme`}
/>
<a
href={`https://github.com/nodejs/learn`}
className={styles.ghIconWrapper}
>
<GitHubIcon />
</a>
</NavBar>
);
};