-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #402 from andresgutgon/feature/custom-date-header
Adding optional custom DateHeader component for month view
- Loading branch information
Showing
7 changed files
with
63 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,6 @@ node_modules | |
|
||
# Webstorm ide files | ||
.idea | ||
|
||
# Mac OS X | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
class BackgroundWrapper extends React.Component { | ||
render() { | ||
return this.props.children; | ||
} | ||
} | ||
|
||
BackgroundWrapper.propTypes = { | ||
children: PropTypes.element, | ||
value: PropTypes.instanceOf(Date), | ||
range: PropTypes.arrayOf(PropTypes.instanceOf(Date)) | ||
} | ||
|
||
export default BackgroundWrapper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react' | ||
|
||
const DateHeader = ({ label, drillDownView, onDrillDown }) => { | ||
if (!drillDownView) { | ||
return (<span>{label}</span>) | ||
} | ||
|
||
return ( | ||
<a href="#" onClick={onDrillDown}> | ||
{label} | ||
</a> | ||
) | ||
} | ||
|
||
DateHeader.propTypes = { | ||
label: PropTypes.node, | ||
date: PropTypes.instanceOf(Date), | ||
drillDownView: PropTypes.string, | ||
onDrillDown: PropTypes.func, | ||
isOffRange: PropTypes.bool | ||
} | ||
|
||
export default DateHeader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters