-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
44 lines (41 loc) · 1.07 KB
/
index.js
File metadata and controls
44 lines (41 loc) · 1.07 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
38
39
40
41
42
43
44
import React from 'react'
import ContentNavMenu from '../../ContentNavMenu'
import { getLocationHash, getLocationPathname } from '../../../utils/window'
import './index.css'
const ScheduleNav = ({ items }) => (
<div className="schedule-nav">
<ContentNavMenu
items={items.map(item => ({
...item,
className: 'schedule-content-nav-item',
activeLinkClassName: 'schedule-content-nav-item-is-active',
isActiveHandler: () =>
(item.id === 'day1' &&
`${getLocationPathname()}${getLocationHash()}` === '/schedule/') ||
item.href === `${getLocationPathname()}${getLocationHash()}`,
}))}
showDivider={true}
dividerClassName="schedule-content-nav-divider"
/>
</div>
)
ScheduleNav.defaultProps = {
items: [
{
id: 'day1',
text: 'May 2',
href: '/schedule/day-1/',
},
{
id: 'day2',
text: 'May 3',
href: '/schedule/day-2/',
},
// {
// id: 'day3',
// text: 'May 4',
// href: '/schedule/day-3',
// },
],
}
export default ScheduleNav