diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2019-05-05 20:38:14 +0200 |
---|---|---|
committer | jbion <joffrey.bion@amadeus.com> | 2019-05-06 18:33:15 +0200 |
commit | f6f39544b29d91c08282faf8d70a739a3042a1a3 (patch) | |
tree | 1b1a9f01dbf8bed99f019ae2fa084d486e42e972 /frontend/src/components | |
parent | Fix booleans in model.ts (diff) | |
download | seven-wonders-f6f39544b29d91c08282faf8d70a739a3042a1a3.tar.gz seven-wonders-f6f39544b29d91c08282faf8d70a739a3042a1a3.tar.bz2 seven-wonders-f6f39544b29d91c08282faf8d70a739a3042a1a3.zip |
Migrate home components to TypeScript
Diffstat (limited to 'frontend/src/components')
-rw-r--r-- | frontend/src/components/home/ChooseNameForm.tsx (renamed from frontend/src/components/home/ChooseNameForm.jsx) | 7 | ||||
-rw-r--r-- | frontend/src/components/home/Home.tsx (renamed from frontend/src/components/home/Home.jsx) | 1 |
2 files changed, 3 insertions, 5 deletions
diff --git a/frontend/src/components/home/ChooseNameForm.jsx b/frontend/src/components/home/ChooseNameForm.tsx index 71279e35..8292150b 100644 --- a/frontend/src/components/home/ChooseNameForm.jsx +++ b/frontend/src/components/home/ChooseNameForm.tsx @@ -1,6 +1,5 @@ -// @flow import { Button, Classes, InputGroup, Intent } from '@blueprintjs/core'; -import React, { Component } from 'react'; +import React, { ChangeEvent, Component, SyntheticEvent } from 'react'; import { connect } from 'react-redux'; import { actions } from '../../redux/actions/user'; @@ -11,7 +10,7 @@ type ChooseNameFormPresenterProps = { class ChooseNameFormPresenter extends Component<ChooseNameFormPresenterProps> { _username = ''; - play = e => { + play = (e: SyntheticEvent<any>) => { e.preventDefault(); if (this._username !== undefined) { this.props.chooseUsername(this._username); @@ -24,7 +23,7 @@ class ChooseNameFormPresenter extends Component<ChooseNameFormPresenterProps> { <InputGroup className={Classes.LARGE} placeholder="Username" - onChange={e => (this._username = e.target.value)} + onChange={(e: ChangeEvent<HTMLInputElement>) => (this._username = e.target.value)} rightElement={this.renderSubmit()} /> </form> diff --git a/frontend/src/components/home/Home.jsx b/frontend/src/components/home/Home.tsx index 91065ec7..094db658 100644 --- a/frontend/src/components/home/Home.jsx +++ b/frontend/src/components/home/Home.tsx @@ -1,4 +1,3 @@ -// @flow import * as React from 'react'; import { Flex } from 'reflexbox'; import { ChooseNameForm } from './ChooseNameForm'; |