diff options
Diffstat (limited to 'sw-ui/src/components/home/ChooseNameForm.tsx')
-rw-r--r-- | sw-ui/src/components/home/ChooseNameForm.tsx | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/sw-ui/src/components/home/ChooseNameForm.tsx b/sw-ui/src/components/home/ChooseNameForm.tsx deleted file mode 100644 index 8292150b..00000000 --- a/sw-ui/src/components/home/ChooseNameForm.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { Button, Classes, InputGroup, Intent } from '@blueprintjs/core'; -import React, { ChangeEvent, Component, SyntheticEvent } from 'react'; -import { connect } from 'react-redux'; -import { actions } from '../../redux/actions/user'; - -type ChooseNameFormPresenterProps = { - chooseUsername: (username: string) => void, -} - -class ChooseNameFormPresenter extends Component<ChooseNameFormPresenterProps> { - _username = ''; - - play = (e: SyntheticEvent<any>) => { - e.preventDefault(); - if (this._username !== undefined) { - this.props.chooseUsername(this._username); - } - }; - - render() { - return ( - <form onSubmit={this.play}> - <InputGroup - className={Classes.LARGE} - placeholder="Username" - onChange={(e: ChangeEvent<HTMLInputElement>) => (this._username = e.target.value)} - rightElement={this.renderSubmit()} - /> - </form> - ); - } - - renderSubmit = () => ( - <Button className={Classes.MINIMAL} onClick={this.play} intent={Intent.PRIMARY} icon="arrow-right" /> - ); -} - -const mapDispatchToProps = { - chooseUsername: actions.chooseUsername, -}; - -export const ChooseNameForm = connect(null, mapDispatchToProps)(ChooseNameFormPresenter); |