diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2018-06-09 18:13:47 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2018-06-09 18:13:47 +0200 |
commit | c2eda5c0f25850d1c64ed238458e2bd696d06cc3 (patch) | |
tree | dc99a21fedfe280a0615694176a7d28951e9c8a9 /frontend/src/components/home | |
parent | Improve game list's style (diff) | |
download | seven-wonders-c2eda5c0f25850d1c64ed238458e2bd696d06cc3.tar.gz seven-wonders-c2eda5c0f25850d1c64ed238458e2bd696d06cc3.tar.bz2 seven-wonders-c2eda5c0f25850d1c64ed238458e2bd696d06cc3.zip |
Fix home screen style
Diffstat (limited to 'frontend/src/components/home')
-rw-r--r-- | frontend/src/components/home/ChooseNameForm.jsx | 42 | ||||
-rw-r--r-- | frontend/src/components/home/Home.css | 13 | ||||
-rw-r--r-- | frontend/src/components/home/Home.jsx | 13 | ||||
-rw-r--r-- | frontend/src/components/home/background-zeus-temple.jpg | bin | 0 -> 571089 bytes | |||
-rw-r--r-- | frontend/src/components/home/logo-7-wonders.png | bin | 0 -> 301442 bytes |
5 files changed, 68 insertions, 0 deletions
diff --git a/frontend/src/components/home/ChooseNameForm.jsx b/frontend/src/components/home/ChooseNameForm.jsx new file mode 100644 index 00000000..119fc851 --- /dev/null +++ b/frontend/src/components/home/ChooseNameForm.jsx @@ -0,0 +1,42 @@ +// @flow +import { Button, Classes, InputGroup, Intent } from '@blueprintjs/core'; +import React, { Component } from 'react'; +import { connect } from 'react-redux'; +import { actions } from '../../redux/players'; + +export type ChooseNameFormPresenterProps = { + chooseUsername: (username: string) => void, +} + +class ChooseNameFormPresenter extends Component<ChooseNameFormPresenterProps> { + _username = ''; + + play = e => { + e.preventDefault(); + if (this._username !== undefined) { + this.props.chooseUsername(this._username); + } + }; + + render() { + return ( + <form onSubmit={this.play}> + <InputGroup + placeholder="Username" + onChange={e => (this._username = e.target.value)} + rightElement={this.renderSubmit()} + /> + </form> + ); + } + + renderSubmit = () => ( + <Button className={Classes.MINIMAL} onClick={this.play} intent={Intent.PRIMARY} rightIcon="arrow-right" /> + ); +} + +const mapDispatchToProps = { + chooseUsername: actions.chooseUsername, +}; + +export const ChooseNameForm = connect(null, mapDispatchToProps)(ChooseNameFormPresenter); diff --git a/frontend/src/components/home/Home.css b/frontend/src/components/home/Home.css new file mode 100644 index 00000000..bb89f058 --- /dev/null +++ b/frontend/src/components/home/Home.css @@ -0,0 +1,13 @@ +.homeRoot { + background: url('background-zeus-temple.jpg') center no-repeat; + background-size: cover; +} + +.fullscreen { + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; + overflow: auto; +} diff --git a/frontend/src/components/home/Home.jsx b/frontend/src/components/home/Home.jsx new file mode 100644 index 00000000..91065ec7 --- /dev/null +++ b/frontend/src/components/home/Home.jsx @@ -0,0 +1,13 @@ +// @flow +import * as React from 'react'; +import { Flex } from 'reflexbox'; +import { ChooseNameForm } from './ChooseNameForm'; +import './Home.css' +import logo from './logo-7-wonders.png'; + +export const Home = () => ( + <Flex className='homeRoot fullscreen' column align='center' justify='center'> + <img src={logo} alt="Seven Wonders"/> + <ChooseNameForm/> + </Flex> +); diff --git a/frontend/src/components/home/background-zeus-temple.jpg b/frontend/src/components/home/background-zeus-temple.jpg Binary files differnew file mode 100644 index 00000000..5a28e933 --- /dev/null +++ b/frontend/src/components/home/background-zeus-temple.jpg diff --git a/frontend/src/components/home/logo-7-wonders.png b/frontend/src/components/home/logo-7-wonders.png Binary files differnew file mode 100644 index 00000000..96974d3e --- /dev/null +++ b/frontend/src/components/home/logo-7-wonders.png |