Created
February 21, 2020 15:07
-
-
Save r3dm1ke/e3458660890ac4b4fc508b9872f7da19 to your computer and use it in GitHub Desktop.
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 React from 'react'; | |
| import {TextField, InputAdornment, makeStyles} from "@material-ui/core"; | |
| import SearchIcon from '@material-ui/icons/Search'; | |
| const useStyles = makeStyles({ | |
| input: { | |
| width: '100%' | |
| } | |
| }); | |
| const SearchBar = ({value, onChange}) => { | |
| const classes = useStyles(); | |
| return ( | |
| <TextField | |
| className={classes.input} | |
| label='Search for repos...' | |
| type='search' | |
| variant='outlined' | |
| InputProps={{ | |
| endAdornment: ( | |
| <InputAdornment position='end'> | |
| <SearchIcon /> | |
| </InputAdornment> | |
| ), | |
| }} | |
| value={value} | |
| onChange={e => onChange(e.target.value)} | |
| /> | |
| ); | |
| }; | |
| export default SearchBar; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment