-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearch.js
More file actions
49 lines (45 loc) · 1.09 KB
/
Search.js
File metadata and controls
49 lines (45 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { withStyles, Paper } from '@material-ui/core';
import { SearchInput } from '@vidispine/vdt-materialui';
const styles = ({ spacing, palette, transitions }) => ({
input: {
overflow: 'hidden',
borderWidth: 0,
borderRadius: spacing(0.5),
paddingLeft: spacing(2),
height: spacing(6),
backgroundColor: palette.background.paper,
borderColor: palette.primary.main,
transition: transitions.create(['box-shadow']),
},
button: {
color: palette.getContrastText(palette.primary.main),
borderWidth: 0,
backgroundColor: palette.primary.main,
'&:hover': {
backgroundColor: palette.primary.dark,
},
},
focused: {
boxShadow: `inset 0 0 0 2px ${palette.primary.main}`,
},
});
function Search({
value,
onSubmit,
onChange,
classes: { root, ...rest },
placeholder = 'Search files...',
}) {
return (
<Paper>
<SearchInput
value={value}
classes={rest}
onChange={onChange}
onSubmit={onSubmit}
searchPlaceholder={placeholder}
/>
</Paper>
);
}
export default withStyles(styles)(Search);