This file contains hidden or 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
| import Time from '../../Filters/time.es6.jsx'; | |
| import Price from '../../Filters/price.es6.jsx'; | |
| import withDropdown from './withDropdown.es6.jsx'; | |
| import SmallerDropdown from './dropdown.es6.jsx'; | |
| const Dropdown = withDropdown(SmallerDropdown); | |
| class ExampleComponent extends React.Component { | |
| constructor(props) { | |
| super(props); |
This file contains hidden or 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
| const Dropdown = (props) => { | |
| const childrenWithProps = React.cloneElement(props.children, { onSelect: props.clickHandler, ...props.children.props }); | |
| return ( | |
| <div className="filter filter--simple"> | |
| <div className="form-control" onClick={props.onToggle}> | |
| <label>{props.label}</label> | |
| <p>{props.value}</p> | |
| </div> | |
| {Optional(props.showDropdown).map((index) => |
This file contains hidden or 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
| const withDropdown = (WrappedComponent) => | |
| class extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { showDropdown: false }; | |
| } | |
| onToggle = () => this.setState({ 'showDropdown': !this.state.showDropdown }); |
This file contains hidden or 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
| const withDropdown = (WrappedComponent) => | |
| class extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| } | |
| render() { | |
| return <WrappedComponent {...this.props} /> | |
| } | |
| }; |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <!-- IF PEN IS PRIVATE --> | |
| <!-- <meta name="robots" content="noindex"> --> | |
| <!-- END --> |