Skip to content

Commit

Permalink
Removed default props
Browse files Browse the repository at this point in the history
  • Loading branch information
Patryk Bukowski committed Dec 6, 2022
1 parent a4685ca commit bc2d59c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 51 deletions.
15 changes: 4 additions & 11 deletions src/VerticalTimeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';

const VerticalTimeline = ({
animate,
className,
layout,
lineColor,
animate = true,
className = '',
layout = '2-columns',
lineColor = '#FFF',
children,
}) => {
if (typeof window === 'object') {
Expand Down Expand Up @@ -43,11 +43,4 @@ VerticalTimeline.propTypes = {
lineColor: PropTypes.string,
};

VerticalTimeline.defaultProps = {
animate: true,
className: '',
layout: '2-columns',
lineColor: '#FFF',
};

export default VerticalTimeline;
60 changes: 20 additions & 40 deletions src/VerticalTimelineElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,26 @@ import classNames from 'classnames';
import { InView } from 'react-intersection-observer';

const VerticalTimelineElement = ({
children,
className,
contentArrowStyle,
contentStyle,
date,
dateClassName,
icon,
iconClassName,
iconOnClick,
onTimelineElementClick,
iconStyle,
id,
position,
style,
textClassName,
intersectionObserverProps,
visible,
children = '',
className = '',
contentArrowStyle = null,
contentStyle = null,
date = '',
dateClassName = '',
icon = null,
iconClassName = '',
iconOnClick = null,
onTimelineElementClick = null,
iconStyle = null,
id = '',
position = '',
style = null,
textClassName = '',
intersectionObserverProps = {
rootMargin: '0px 0px -40px 0px',
triggerOnce: true,
},
visible = false,
}) => (
<InView {...intersectionObserverProps}>
{({ inView, ref }) => (
Expand Down Expand Up @@ -109,27 +112,4 @@ VerticalTimelineElement.propTypes = {
}),
};

VerticalTimelineElement.defaultProps = {
children: '',
className: '',
contentArrowStyle: null,
contentStyle: null,
icon: null,
iconClassName: '',
iconOnClick: null,
onTimelineElementClick: null,
iconStyle: null,
id: '',
style: null,
date: '',
dateClassName: '',
position: '',
textClassName: '',
visible: false,
intersectionObserverProps: {
rootMargin: '0px 0px -40px 0px',
triggerOnce: true,
},
};

export default VerticalTimelineElement;

0 comments on commit bc2d59c

Please sign in to comment.