2019-02-03 17:23:33 +07:00
|
|
|
import React from 'react';
|
|
|
|
import styled, { css } from 'react-emotion';
|
2019-05-11 13:59:39 +07:00
|
|
|
import Paper from '@material-ui/core/Paper';
|
2019-02-03 17:23:33 +07:00
|
|
|
|
|
|
|
import TextField from '../TextField';
|
|
|
|
|
2019-06-20 19:37:28 +07:00
|
|
|
export interface InputFieldProps {
|
|
|
|
color: string;
|
|
|
|
}
|
|
|
|
|
2019-07-15 16:57:32 +07:00
|
|
|
export const Wrapper = styled('div')({
|
|
|
|
'&&': {
|
|
|
|
width: '100%',
|
|
|
|
height: '32px',
|
|
|
|
position: 'relative',
|
|
|
|
zIndex: 1,
|
|
|
|
},
|
|
|
|
});
|
2019-02-03 17:23:33 +07:00
|
|
|
|
2019-06-20 19:37:28 +07:00
|
|
|
export const InputField: React.FC<InputFieldProps> = ({ color, ...others }) => (
|
2019-02-03 17:23:33 +07:00
|
|
|
<TextField
|
|
|
|
{...others}
|
|
|
|
classes={{
|
2019-06-20 19:37:28 +07:00
|
|
|
// @ts-ignore
|
2019-02-03 17:23:33 +07:00
|
|
|
input: css`
|
|
|
|
&& {
|
|
|
|
${color &&
|
|
|
|
css`
|
|
|
|
color: ${color};
|
|
|
|
`};
|
|
|
|
}
|
|
|
|
`,
|
|
|
|
root: css`
|
|
|
|
&& {
|
|
|
|
&:before {
|
|
|
|
content: '';
|
|
|
|
border: none;
|
|
|
|
}
|
|
|
|
&:after {
|
|
|
|
${color &&
|
|
|
|
css`
|
|
|
|
border-color: ${color};
|
|
|
|
`};
|
|
|
|
}
|
|
|
|
&:hover:before {
|
|
|
|
content: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
2019-05-11 13:59:39 +07:00
|
|
|
|
2019-07-15 16:57:32 +07:00
|
|
|
export const SuggestionContainer = styled(Paper)({
|
|
|
|
'&&': {
|
|
|
|
maxHeight: '500px',
|
|
|
|
overflowY: 'auto',
|
|
|
|
},
|
|
|
|
});
|