mirror of
https://github.com/wassname/talk.git
synced 2026-07-15 11:26:58 +08:00
Changes added
This commit is contained in:
@@ -29,10 +29,22 @@ export interface TextFieldProps {
|
||||
* If set renders a full width button
|
||||
*/
|
||||
fullWidth?: boolean;
|
||||
/**
|
||||
* Placeholder
|
||||
*/
|
||||
placeholder?: string;
|
||||
}
|
||||
|
||||
const TextField: StatelessComponent<TextFieldProps> = props => {
|
||||
const { className, classes, color, fullWidth, value, ...rest } = props;
|
||||
const {
|
||||
className,
|
||||
classes,
|
||||
color,
|
||||
fullWidth,
|
||||
value,
|
||||
placeholder,
|
||||
...rest
|
||||
} = props;
|
||||
|
||||
const rootClassName = cn(
|
||||
classes.root,
|
||||
@@ -44,12 +56,20 @@ const TextField: StatelessComponent<TextFieldProps> = props => {
|
||||
className
|
||||
);
|
||||
|
||||
return <input className={rootClassName} value={value} {...rest} />;
|
||||
return (
|
||||
<input
|
||||
className={rootClassName}
|
||||
placeholder={placeholder}
|
||||
value={value}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
TextField.defaultProps = {
|
||||
color: "regular",
|
||||
fullWidth: false,
|
||||
placeholder: "",
|
||||
};
|
||||
|
||||
const enhanced = withStyles(styles)(TextField);
|
||||
|
||||
Reference in New Issue
Block a user