Skip to content

Commit c99830b

Browse files
Add new demo
1 parent 913a500 commit c99830b

File tree

3 files changed

+441
-115
lines changed

3 files changed

+441
-115
lines changed

docs/index.js

+28-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import '../style.css';
1616
// Add your documentation imports here. These are available to
1717
// React specimen. Do NOT pass React here as Catalog does that.
1818
const documentationImports = {};
19-
const timelineElements = [
19+
const timelineElements = params => [
2020
<VerticalTimelineElement
2121
onTimelineElementClick={() => {
2222
// eslint-disable-next-line no-alert
@@ -28,6 +28,7 @@ const timelineElements = [
2828
date="2011 - present"
2929
iconStyle={{ background: 'rgb(33, 150, 243)', color: '#fff' }}
3030
icon={<WorkIcon />}
31+
{...params}
3132
>
3233
<h3 className="vertical-timeline-element-title">Creative Director</h3>
3334
<h4 className="vertical-timeline-element-subtitle">Miami, FL</h4>
@@ -41,6 +42,7 @@ const timelineElements = [
4142
date="2010 - 2011"
4243
iconStyle={{ background: 'rgb(33, 150, 243)', color: '#fff' }}
4344
icon={<WorkIcon />}
45+
{...params}
4446
>
4547
<h3 className="vertical-timeline-element-title">Art Director</h3>
4648
<h4 className="vertical-timeline-element-subtitle">San Francisco, CA</h4>
@@ -53,6 +55,7 @@ const timelineElements = [
5355
date="2008 - 2010"
5456
iconStyle={{ background: 'rgb(33, 150, 243)', color: '#fff' }}
5557
icon={<WorkIcon />}
58+
{...params}
5659
>
5760
<h3 className="vertical-timeline-element-title">Web Designer</h3>
5861
<h4 className="vertical-timeline-element-subtitle">Los Angeles, CA</h4>
@@ -63,6 +66,7 @@ const timelineElements = [
6366
date="2006 - 2008"
6467
iconStyle={{ background: 'rgb(33, 150, 243)', color: '#fff' }}
6568
icon={<WorkIcon />}
69+
{...params}
6670
>
6771
<h3 className="vertical-timeline-element-title">Web Designer</h3>
6872
<h4 className="vertical-timeline-element-subtitle">San Francisco, CA</h4>
@@ -75,6 +79,7 @@ const timelineElements = [
7579
date="April 2013"
7680
iconStyle={{ background: 'rgb(233, 30, 99)', color: '#fff' }}
7781
icon={<SchoolIcon />}
82+
{...params}
7883
>
7984
<h3 className="vertical-timeline-element-title">
8085
Content Marketing for Web, Mobile and Social Media
@@ -87,6 +92,7 @@ const timelineElements = [
8792
date="November 2012"
8893
iconStyle={{ background: 'rgb(233, 30, 99)', color: '#fff' }}
8994
icon={<SchoolIcon />}
95+
{...params}
9096
>
9197
<h3 className="vertical-timeline-element-title">
9298
Agile Development Scrum Master
@@ -99,6 +105,7 @@ const timelineElements = [
99105
date="2002 - 2006"
100106
iconStyle={{ background: 'rgb(233, 30, 99)', color: '#fff' }}
101107
icon={<SchoolIcon />}
108+
{...params}
102109
>
103110
<h3 className="vertical-timeline-element-title">
104111
Bachelor of Science in Interactive Digital Media Visual Imaging
@@ -109,6 +116,7 @@ const timelineElements = [
109116
<VerticalTimelineElement
110117
iconStyle={{ background: 'rgb(16, 204, 82)', color: '#fff' }}
111118
icon={<StarIcon />}
119+
{...params}
112120
/>,
113121
];
114122

@@ -333,13 +341,15 @@ const pages = [
333341
{
334342
path: '/demo',
335343
title: 'Demo',
336-
content: () => <VerticalTimeline>{timelineElements}</VerticalTimeline>,
344+
content: () => <VerticalTimeline>{timelineElements()}</VerticalTimeline>,
337345
},
338346
{
339347
path: '/demo-single-column-left',
340348
title: 'Demo single column left',
341349
content: () => (
342-
<VerticalTimeline layout="1-column">{timelineElements}</VerticalTimeline>
350+
<VerticalTimeline layout="1-column">
351+
{timelineElements()}
352+
</VerticalTimeline>
343353
),
344354
},
345355
{
@@ -368,7 +378,21 @@ const pages = [
368378
title: 'Demo custom line color',
369379
content: () => (
370380
<VerticalTimeline className="vertical-timeline-custom-line">
371-
{timelineElements}
381+
{timelineElements()}
382+
</VerticalTimeline>
383+
),
384+
},
385+
{
386+
path: '/demo-effect',
387+
title: 'Demo effect trigger multiple times',
388+
content: () => (
389+
<VerticalTimeline className="vertical-timeline-custom-line">
390+
{timelineElements({
391+
intersectionObserverProps: {
392+
rootMargin: '0px 0px -40px 0px',
393+
triggerOnce: false,
394+
},
395+
})}
372396
</VerticalTimeline>
373397
),
374398
},

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
"module": "dist-es6",
2626
"jsnext:main": "dist-es6",
2727
"devDependencies": {
28-
"@babel/cli": "^7.12.10",
29-
"@babel/core": "^7.12.10",
28+
"@babel/cli": "^7.26.4",
29+
"@babel/core": "^7.26.0",
3030
"@babel/eslint-parser": "^7.5.4",
3131
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
3232
"@babel/preset-env": "^7.10.1",
33-
"@babel/preset-react": "^7.12.10",
33+
"@babel/preset-react": "^7.26.3",
3434
"@material-ui/core": "^4.10.0",
3535
"@material-ui/icons": "^4.9.1",
3636
"babel-jest": "^27.3.1",
@@ -103,8 +103,8 @@
103103
"test:lint"
104104
],
105105
"dependencies": {
106+
"@babel/preset-es2015": "^7.0.0-beta.53",
106107
"classnames": "^2.2.6",
107-
"prop-types": "^15.7.2",
108108
"react-intersection-observer": "^8.26.2"
109109
},
110110
"browserslist": [

0 commit comments

Comments
 (0)