Created
November 30, 2017 15:22
-
-
Save EdwinGuzman/d7466458187b74c39110a2285f30de94 to your computer and use it in GitHub Desktop.
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
// Search.jsx | |
class Search extends React.Component { | |
// Other class functions... | |
render() { | |
// Here we can pass the class that we want this “omni-search” component to have as a React prop. | |
const style = this.props.style; | |
return ( | |
<form onKeyPress={this.triggerSubmit} method="POST"> | |
<div className={`nypl-omnisearch ${style} nypl-spinner-field`}> | |
<!-- more elements here -> | |
</form> | |
); | |
} | |
} | |
// Component that renders Search | |
class Homepage extends React.Component { | |
// Other class functions | |
render() { | |
return ( | |
<div id="main-content"> | |
<Search style="homepage-style" /> | |
<!-- other components and elements --> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment