X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/a1589292a5adde7b41c2fc445c78a52e232fa73a..cf83b358f087a87b5ff095d3ed7a8c6920c60ffe:/src/components/text-field/text-field.tsx diff --git a/src/components/text-field/text-field.tsx b/src/components/text-field/text-field.tsx index bda1c761..1cf9a81d 100644 --- a/src/components/text-field/text-field.tsx +++ b/src/components/text-field/text-field.tsx @@ -5,28 +5,56 @@ import * as React from 'react'; import { WrappedFieldProps } from 'redux-form'; import { ArvadosTheme } from '~/common/custom-theme'; -import { TextField as MaterialTextField, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core'; +import { + TextField as MaterialTextField, + StyleRulesCallback, + WithStyles, + withStyles, + PropTypes +} from '@material-ui/core'; import RichTextEditor from 'react-rte'; +import Margin = PropTypes.Margin; -type CssRules = 'textField'; +type CssRules = 'textField' | 'rte'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ textField: { - marginBottom: theme.spacing.unit * 3 + marginBottom: theme.spacing.unit }, + rte: { + fontFamily: 'Arial', + '& a': { + textDecoration: 'none', + color: theme.palette.primary.main, + '&:hover': { + cursor: 'pointer', + textDecoration: 'underline' + } + } + } }); -export const TextField = withStyles(styles)((props: WrappedFieldProps & WithStyles & { label?: string, autoFocus?: boolean, required?: boolean }) => +type TextFieldProps = WrappedFieldProps & WithStyles; + +export const TextField = withStyles(styles)((props: TextFieldProps & { + label?: string, autoFocus?: boolean, required?: boolean, select?: boolean, disabled?: boolean, children: React.ReactNode, margin?: Margin, placeholder?: string, + helperText?: string, type?: string, +}) => ); @@ -35,7 +63,7 @@ interface RichEditorTextFieldData { label?: string; } -type RichEditorTextFieldProps = RichEditorTextFieldData & WrappedFieldProps & WithStyles; +type RichEditorTextFieldProps = RichEditorTextFieldData & TextFieldProps; export const RichEditorTextField = withStyles(styles)( class RichEditorTextField extends React.Component { @@ -49,7 +77,8 @@ export const RichEditorTextField = withStyles(styles)( } render() { - return ; @@ -57,20 +86,19 @@ export const RichEditorTextField = withStyles(styles)( } ); -type DataTextFieldProps = WrappedFieldProps & WithStyles; - export const DateTextField = withStyles(styles) - ((props: DataTextFieldProps) => + ((props: TextFieldProps) => - ); \ No newline at end of file + /> + );