Skip to content

Instantly share code, notes, and snippets.

@guzmonne
Created December 4, 2016 00:23
Show Gist options
  • Save guzmonne/9902465847d0e6ad2289871b6f921c6b to your computer and use it in GitHub Desktop.
Save guzmonne/9902465847d0e6ad2289871b6f921c6b to your computer and use it in GitHub Desktop.
NavBar component example
import React, {PropTypes as T} from 'react'
import {SearchBox} from 'office-ui-fabric-react/lib/SearchBox'
import '../_styles/NavBar.css'
const NavBar = ({onChange, onSearch}) => (
<div className="NavBar">
<div className="logo ms-font-xl">
<strong>Awesome App</strong>
</div>
<div className="searchbox">
<SearchBox labelText="Search"
onChange={(newValue) => console.log('SearchBox onChange fired: ' + newValue)}
onSearch={(newValue) => console.log('SearchBox onSearch fired: ' + newValue)}
/>
</div>
</div>
)
NavBar.propTypes = {
onChange: T.func,
onSearch: T.func,
}
NavBar.defaultProps = {
onChange: (newValue) => console.log('SearchBox onChange fired: ' + newValue),
onSearch: (newValue) => console.log('SearchBox onSearch fired: ' + newValue),
}
export default NavBar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment