ToolJet/frontend/src/Editor/Components/Timeline.jsx
Kiran Ashok 4267027465
Bugfix :: Box shadow is getting applied to the surrounding box (#6802)
* feat :: temp commit added box shadow for freq used components

* fix :: box shadow for all components

* cleanup

* review :: changes , sending boz shadow with styles

* fix :: apply box shadow to the item instead of container

* fix :: daterange picker shadows
2023-06-29 15:14:05 +05:30

32 lines
1.2 KiB
JavaScript

import React from 'react';
import { isArray } from 'lodash';
export const Timeline = function Timeline({ height, darkMode, properties, styles, dataCy }) {
const { visibility, boxShadow } = styles;
const { data, hideDate } = properties;
const darkModeStyle = darkMode && 'text-white-50';
return (
<div
className="card"
style={{ display: visibility ? '' : 'none', height, overflow: 'auto', overflowWrap: 'normal', boxShadow }}
data-cy={dataCy}
>
<div className="card-body">
<ul className={`list list-timeline ${hideDate && 'list-timeline-simple'}`}>
{(isArray(data) ? data : []).map((item, index) => (
<li key={index}>
<div className="list-timeline-icon" style={{ backgroundColor: item.iconBackgroundColor }}></div>
<div className="list-timeline-content">
{!hideDate && <div className={`list-timeline-time ${darkModeStyle}`}>{item.date}</div>}
<p className="list-timeline-title">{item.title}</p>
<p className={`${darkModeStyle || 'text-muted'}`}>{item.subTitle}</p>
</div>
</li>
))}
</ul>
</div>
</div>
);
};