Skip to content
This repository was archived by the owner on Oct 20, 2020. It is now read-only.

Commit c4f821c

Browse files
author
Lucien Brillant
committed
Add Code to process css classes passed to Timebar elements
css classes are processed and handled in the same way that they are when passed to timeline elements.
1 parent 68cdaf1 commit c4f821c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/components/Timeline/Grid/index.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33

4+
import createClasses from '../../../utils/classes'
5+
46
const Grid = ({ time, grid }) => (
57
<div className="rt-grid">
6-
{grid.map(({ id, start, end }) => (
7-
<div key={id} className="rt-grid__cell" style={time.toStyleLeftAndWidth(start, end)} />
8+
{grid.map(({ id, start, end, classes }) => (
9+
<div key={id} className={createClasses('rt-grid__cell', classes)} style={time.toStyleLeftAndWidth(start, end)} />
810
))}
911
</div>
1012
)

src/components/Timeline/Timebar/Cell.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33

4-
const Cell = ({ time, title, start, end }) => (
5-
<div className="rt-timebar__cell" style={time.toStyleLeftAndWidth(start, end)}>
4+
import createClasses from '../../../utils/classes'
5+
6+
const Cell = ({ time, title, start, end, classes }) => (
7+
<div className={createClasses('rt-timebar__cell', classes)} style={time.toStyleLeftAndWidth(start, end)}>
68
{title}
79
</div>
810
)
@@ -14,6 +16,7 @@ Cell.propTypes = {
1416
title: PropTypes.string.isRequired,
1517
start: PropTypes.instanceOf(Date).isRequired,
1618
end: PropTypes.instanceOf(Date).isRequired,
19+
classes: PropTypes.arrayOf(PropTypes.string.isRequired),
1720
}
1821

1922
export default Cell

0 commit comments

Comments
 (0)