-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TextField] Add Solo Field demo (#13945)
* Add Google Maps Inspired Input * small changes :)
- Loading branch information
1 parent
41c2703
commit 7e1eeaa
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { withStyles } from '@material-ui/core/styles'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import InputBase from '@material-ui/core/InputBase'; | ||
import Divider from '@material-ui/core/Divider'; | ||
import IconButton from '@material-ui/core/IconButton'; | ||
import MenuIcon from '@material-ui/icons/Menu'; | ||
import SearchIcon from '@material-ui/icons/Search'; | ||
import DirectionsIcon from '@material-ui/icons/Directions'; | ||
|
||
const styles = { | ||
root: { | ||
padding: '2px 4px', | ||
display: 'flex', | ||
alignItems: 'center', | ||
width: 400, | ||
}, | ||
input: { | ||
marginLeft: 8, | ||
flex: 1, | ||
}, | ||
iconButton: { | ||
padding: 10, | ||
}, | ||
divider: { | ||
width: 1, | ||
height: 28, | ||
margin: 4, | ||
}, | ||
}; | ||
|
||
function CustomizedInputBase(props) { | ||
const { classes } = props; | ||
|
||
return ( | ||
<Paper className={classes.root} elevation={1}> | ||
<IconButton className={classes.iconButton} aria-label="Menu"> | ||
<MenuIcon /> | ||
</IconButton> | ||
<InputBase className={classes.input} placeholder="Search Google Maps" /> | ||
<IconButton className={classes.iconButton} aria-label="Search"> | ||
<SearchIcon /> | ||
</IconButton> | ||
<Divider className={classes.divider} /> | ||
<IconButton color="primary" className={classes.iconButton} aria-label="Directions"> | ||
<DirectionsIcon /> | ||
</IconButton> | ||
</Paper> | ||
); | ||
} | ||
|
||
CustomizedInputBase.propTypes = { | ||
classes: PropTypes.object.isRequired, | ||
}; | ||
|
||
export default withStyles(styles)(CustomizedInputBase); |
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
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