File tree Expand file tree Collapse file tree 1 file changed +59
-0
lines changed
docs/src/pages/demos/text-fields Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
3
+ import { createStyles , WithStyles , withStyles } from '@material-ui/core/styles' ;
4
+ import Paper from '@material-ui/core/Paper' ;
5
+ import InputBase from '@material-ui/core/InputBase' ;
6
+ import Divider from '@material-ui/core/Divider' ;
7
+ import IconButton from '@material-ui/core/IconButton' ;
8
+ import MenuIcon from '@material-ui/icons/Menu' ;
9
+ import SearchIcon from '@material-ui/icons/Search' ;
10
+ import DirectionsIcon from '@material-ui/icons/Directions' ;
11
+
12
+ const styles = createStyles ( {
13
+ root : {
14
+ padding : '2px 4px' ,
15
+ display : 'flex' ,
16
+ alignItems : 'center' ,
17
+ width : 400 ,
18
+ } ,
19
+ input : {
20
+ marginLeft : 8 ,
21
+ flex : 1 ,
22
+ } ,
23
+ iconButton : {
24
+ padding : 10 ,
25
+ } ,
26
+ divider : {
27
+ width : 1 ,
28
+ height : 28 ,
29
+ margin : 4 ,
30
+ } ,
31
+ } ) ;
32
+
33
+ export interface Props extends WithStyles < typeof styles > { }
34
+
35
+ function CustomizedInputBase ( props : Props ) {
36
+ const { classes } = props ;
37
+
38
+ return (
39
+ < Paper className = { classes . root } elevation = { 1 } >
40
+ < IconButton className = { classes . iconButton } aria-label = "Menu" >
41
+ < MenuIcon />
42
+ </ IconButton >
43
+ < InputBase className = { classes . input } placeholder = "Search Google Maps" />
44
+ < IconButton className = { classes . iconButton } aria-label = "Search" >
45
+ < SearchIcon />
46
+ </ IconButton >
47
+ < Divider className = { classes . divider } />
48
+ < IconButton color = "primary" className = { classes . iconButton } aria-label = "Directions" >
49
+ < DirectionsIcon />
50
+ </ IconButton >
51
+ </ Paper >
52
+ ) ;
53
+ }
54
+
55
+ CustomizedInputBase . propTypes = {
56
+ classes : PropTypes . object . isRequired ,
57
+ } as any ;
58
+
59
+ export default withStyles ( styles ) ( CustomizedInputBase ) ;
You can’t perform that action at this time.
0 commit comments