Skip to content

Commit

Permalink
Avoid passing unnecesary props
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgutgon committed May 24, 2017
1 parent cc71cd2 commit 1d33fcf
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ node_modules

# Webstorm ide files
.idea

# Mac OS X
.DS_Store
3 changes: 1 addition & 2 deletions src/BackgroundCells.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ class BackgroundCells extends React.Component {
<Wrapper
key={index}
value={date}
isFirstInRange={index === 0}
isLastInRange={index === range.length - 1}
range={range}
>
<div
style={segStyle(1, range.length)}
Expand Down
4 changes: 2 additions & 2 deletions src/BackgroundWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class BackgroundWrapper extends React.Component {

BackgroundWrapper.propTypes = {
children: PropTypes.element,
isFirstInRange: PropTypes.bool,
isLastInRange: PropTypes.bool,
value: PropTypes.instanceOf(Date),
range: PropTypes.arrayOf(PropTypes.instanceOf(Date))
}

export default BackgroundWrapper;
2 changes: 0 additions & 2 deletions src/DateContentRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ class DateContentRow extends React.Component {
date,
key: `header_${index}`,
style: segStyle(1, range.length),
isFirstInRange: index === 0,
isLastInRange: index === range.length - 1,
className: cn(
'rbc-date-cell',
dates.eq(date, this.props.now, 'day') && 'rbc-now', // FIXME use props.now
Expand Down
5 changes: 1 addition & 4 deletions src/DateHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ DateHeader.propTypes = {
date: PropTypes.instanceOf(Date),
drillDownView: PropTypes.string,
onDrillDown: PropTypes.func,
isFirstInRange: PropTypes.bool,
isLastInRange: PropTypes.bool,
isOffRange: PropTypes.bool,
isCurrent: PropTypes.bool
isOffRange: PropTypes.bool
}

export default DateHeader
5 changes: 1 addition & 4 deletions src/Month.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class MonthView extends React.Component {
)
}

readerDateHeading = ({ date, className, isFirstInRange, isLastInRange, ...props }) => {
readerDateHeading = ({ date, className, ...props }) => {
let {
date: currentDate,
getDrilldownView,
Expand All @@ -221,10 +221,7 @@ class MonthView extends React.Component {
label={label}
date={date}
drilldownView={drilldownView}
isFirstInRange={isFirstInRange}
isLastInRange={isLastInRange}
isOffRange={isOffRange}
isCurrent={isCurrent}
onDrillDown={e => this.handleHeadingClick(date, drilldownView, e)} />
</div>
)
Expand Down

0 comments on commit 1d33fcf

Please sign in to comment.