move prototypes outside of class definition

This commit is contained in:
casperlamboo 2017-11-02 17:35:29 +01:00
parent 401f847dfc
commit 4eb19157b6

View File

@ -6,17 +6,6 @@ import PouchDB from 'pouchdb';
// const debug = createDebug('d3d:FileThumb'); // const debug = createDebug('d3d:FileThumb');
class AuthImage extends React.Component { class AuthImage extends React.Component {
static propTypes = {
dispatch: PropTypes.func,
src: PropTypes.string.isRequired,
token: PropTypes.string,
password: PropTypes.string
};
state = {
src: null
}
componentWillMount() { componentWillMount() {
const { src, token, password } = this.props; const { src, token, password } = this.props;
@ -57,6 +46,16 @@ class AuthImage extends React.Component {
return (<img { ...props } src={this.state.src} />); return (<img { ...props } src={this.state.src} />);
} }
} }
AuthImage.propTypes = {
dispatch: PropTypes.func,
src: PropTypes.string.isRequired,
token: PropTypes.string,
password: PropTypes.string
};
AuthImage.state = {
src: null
};
export default connect(state => ({ export default connect(state => ({
token: state.user.session.token, token: state.user.session.token,