forked from mParticle/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathleftHandNavigation.stories.jsx
More file actions
203 lines (199 loc) · 6.43 KB
/
Copy pathleftHandNavigation.stories.jsx
File metadata and controls
203 lines (199 loc) · 6.43 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
import React from 'react';
import {
createMemorySource,
createHistory,
LocationProvider,
} from '@reach/router';
import LeftHandNav from '../src/components/MenuFolderNavigation/LeftHandNav';
import TOCContext from '../src/components/TOCContext';
import TOC from '../src/components/MenuFolderNavigation/Toc';
export default {
title: 'Navigation',
component: LeftHandNav,
};
const toc = {
id: 'home',
label: 'Home',
path: '/',
children: [
{
label: 'Offsite Link',
id: 'offsite-link',
offsiteLink: 'https://mparticle.com/',
},
{
id: 'intro',
label: 'Introduction to mParticle',
children: [
{
label: 'What is mParticle?',
id: 'what-is-mparticle',
path: 'what-is-mparticle',
},
{
label: 'Configure mParticle',
id: 'configure-mparticle',
path: 'configure-mparticle',
},
{
label: 'FAQ',
id: 'faq',
path: 'faq',
},
{
id: 'nested-offsite',
label: 'Nested Offsite',
offsiteLink: 'https://mparticle.com/',
},
],
},
{
id: 'data-infrastructure',
label: 'Data Infrastructure',
children: [
{
label: 'Overview',
id: 'data-infrastructure-overview',
path: 'overview',
},
{
label: 'Get Started',
id: 'data-infrastructure-get-started',
path: 'get-started',
},
{
id: 'integrations',
label: 'Integrations',
children: [
{
id: 'integrations-directory',
path: 'integrations-directory',
label: 'Integrations Directory',
},
{
id: 'integrations-guide',
path: 'integrations-guide',
label: 'Integrations Guide',
children: [
{
id: 'integrations-guide-overview',
path: 'integrations-guide-overview',
label: 'Overview',
},
{
label: 'Setting up Connections',
id: 'setting-up-connections',
path: 'setting-up-connections',
},
{
label: 'Filtering Data',
path: 'filtering-data',
id: 'filtering-data',
},
],
},
],
},
{
label: 'SDK Guides',
id: 'sdk-guides',
path: 'sdk-guides',
},
],
},
{
label: 'Data Quality',
id: 'data-quality',
path: 'data-quality',
},
{
id: 'personalization',
label: 'Personalization',
children: [
{
id: 'profile-api',
label: 'Profile API',
children: [
{
label: 'Overview',
id: 'profile-overview',
path: '/profile',
},
{
label: 'User Activity View',
id: 'user-activity-view',
path: 'user-activity-view',
},
],
},
{
id: 'audiences',
label: 'Audiences',
children: [
{
label: 'Overview',
id: 'audience-overview',
path: 'audience-overview',
},
{
label: 'Use Cases',
id: 'audience-use-cases',
path: 'use-cases',
},
{
label: 'Cross Account Audience Sharing',
id: 'cross-account-audience-sharing',
path: 'cross-account-audience-sharing',
},
],
},
],
},
{
id: 'governance',
label: 'Governance',
children: [
{
id: 'rules',
label: 'Rules',
children: [
{
label: 'Use Cases',
id: 'rules-use-cases',
path: 'use-cases',
},
],
},
],
},
{
label: 'Changelog',
id: 'changelog',
path: 'changelog',
},
{
label: 'Glossary',
id: 'glossary',
path: 'glossary',
},
{
label: 'SDK Guides',
id: 'sdk-guides',
path: 'sdk-guides',
},
],
};
// Create a fake path to show active state
const source = createMemorySource('/profile');
const history = createHistory(source);
export const LeftHandNavigationModule = () => (
<div style={{ width: '300px', border: '1px solid red', padding: '20px' }}>
<LocationProvider history={history}>
<TOCContext.Provider value={toc}>
<LeftHandNav>
<TOC />
</LeftHandNav>
</TOCContext.Provider>
</LocationProvider>
</div>
);