Created
August 23, 2018 09:36
-
-
Save fede-rodes/e73e5a1dacaa3621a26c551bae03e15f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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