forked from npm/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsidebar.js
More file actions
33 lines (31 loc) · 844 Bytes
/
sidebar.js
File metadata and controls
33 lines (31 loc) · 844 Bytes
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
import { BorderBox, Flex, Position } from '@primer/components'
import React from 'react'
import navItems from '../nav.yml'
import { HEADER_HEIGHT } from './header'
import NavItems from './nav-items'
function Sidebar ({ location, editOnGitHub }) {
return (
<Position
position="sticky"
top={HEADER_HEIGHT}
height={`calc(100vh - ${HEADER_HEIGHT}px)`}
minWidth={260}
color="gray.8"
bg="gray.0"
role="navigation"
>
<BorderBox
borderWidth={0}
borderRightWidth={1}
borderRadius={0}
height="100%"
style={{ overflow: 'auto' }}
>
<Flex flexDirection="column" role="list">
<NavItems location={location} items={navItems} editOnGitHub={editOnGitHub} />
</Flex>
</BorderBox>
</Position>
)
}
export default Sidebar