Skip to content

Instantly share code, notes, and snippets.

@edjafarov
Created September 5, 2016 11:10
Show Gist options
  • Save edjafarov/a23c6c22cacb75e6035130c841b6273a to your computer and use it in GitHub Desktop.
Save edjafarov/a23c6c22cacb75e6035130c841b6273a to your computer and use it in GitHub Desktop.
import React, {PropTypes} from 'react';
import {connect} from 'react-redux';
import './calendar.scss';
export class CalendarComponent extends React.Component {
render() {
const {
condition,
list
} = this.props;
if (condition) {
return <///>
}
return (
<div className="calendar-component">
{list.map(()=><///>)}
</div>
);
}
function mapStateToProps(state) {
return {
list: state.calendar,
condition: state.calendar.length > 100
};
}
CalendarComponent.propTypes = {
};
CalendarComponent.defaultProps = {
};
export default connect(mapStateToProps, null)(CalendarComponent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment