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

Commit

Permalink
Add Code to process css classes passed to Timebar elements
Browse files Browse the repository at this point in the history
css classes are processed and handled in the same way that they are when passed to timeline elements.
  • Loading branch information
Lucien Brillant committed Jul 16, 2020
1 parent 68cdaf1 commit e278aa0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/components/Timeline/Grid/index.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React from 'react'
import PropTypes from 'prop-types'

const Grid = ({ time, grid }) => (
import createClasses from "../../../utils/classes"

const Grid = ({ time, grid}) => (
<div className="rt-grid">
{grid.map(({ id, start, end }) => (
<div key={id} className="rt-grid__cell" style={time.toStyleLeftAndWidth(start, end)} />
{grid.map(({ id, start, end, classes }) => (
<div key={id} className={createClasses("rt-grid__cell", classes)} style={time.toStyleLeftAndWidth(start, end)} />
))}
</div>
)
Expand Down
7 changes: 5 additions & 2 deletions src/components/Timeline/Timebar/Cell.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from 'react'
import PropTypes from 'prop-types'

const Cell = ({ time, title, start, end }) => (
<div className="rt-timebar__cell" style={time.toStyleLeftAndWidth(start, end)}>
import createClasses from "../../../utils/classes"

const Cell = ({ time, title, start, end, classes }) => (
<div className={createClasses("rt-timebar__cell", classes)} style={time.toStyleLeftAndWidth(start, end)}>
{title}
</div>
)
Expand All @@ -14,6 +16,7 @@ Cell.propTypes = {
title: PropTypes.string.isRequired,
start: PropTypes.instanceOf(Date).isRequired,
end: PropTypes.instanceOf(Date).isRequired,
classes: PropTypes.arrayOf(PropTypes.string.isRequired),
}

export default Cell

0 comments on commit e278aa0

Please sign in to comment.