Skip to content

Instantly share code, notes, and snippets.

@fede-rodes
Created August 23, 2018 09:36
Show Gist options
  • Save fede-rodes/e73e5a1dacaa3621a26c551bae03e15f to your computer and use it in GitHub Desktop.
Save fede-rodes/e73e5a1dacaa3621a26c551bae03e15f to your computer and use it in GitHub Desktop.
// TOP LEVEL IMPORTS
import React from 'react';
import PropTypes from 'prop-types';
// ANTD
import Input from 'antd/lib/input';
import 'antd/lib/input/style/css';
import Icon from 'antd/lib/icon';
import 'antd/lib/icon/style/css';
// EXPORTED COMPONENT
// ===================================
export class UsernameInput extends React.Component {
render() {
return (
<Input
{...this.props}
prefix={<Icon type="user" />}
placeholder="Username"
/>
);
}
}
// PROPS
// ===================================
UsernameInput.propTypes = {
// accepts same props as the orginal antd component
};
// Specifies the default values for props:
UsernameInput.defaultProps = {
size: 'large',
style: {},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment