24 changed files with 347 additions and 256 deletions
@ -1,41 +0,0 @@ |
|||||
// @flow
|
|
||||
import type { counterStateType } from '../reducers/counter'; |
|
||||
|
|
||||
type actionType = { |
|
||||
+type: string |
|
||||
}; |
|
||||
|
|
||||
export const INCREMENT_COUNTER = 'INCREMENT_COUNTER'; |
|
||||
export const DECREMENT_COUNTER = 'DECREMENT_COUNTER'; |
|
||||
|
|
||||
export function increment() { |
|
||||
return { |
|
||||
type: INCREMENT_COUNTER |
|
||||
}; |
|
||||
} |
|
||||
|
|
||||
export function decrement() { |
|
||||
return { |
|
||||
type: DECREMENT_COUNTER |
|
||||
}; |
|
||||
} |
|
||||
|
|
||||
export function incrementIfOdd() { |
|
||||
return (dispatch: (action: actionType) => void, getState: () => counterStateType) => { |
|
||||
const { counter } = getState(); |
|
||||
|
|
||||
if (counter % 2 === 0) { |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
dispatch(increment()); |
|
||||
}; |
|
||||
} |
|
||||
|
|
||||
export function incrementAsync(delay: number = 1000) { |
|
||||
return (dispatch: (action: actionType) => void) => { |
|
||||
setTimeout(() => { |
|
||||
dispatch(increment()); |
|
||||
}, delay); |
|
||||
}; |
|
||||
} |
|
@ -1,39 +0,0 @@ |
|||||
@import "~font-awesome/css/font-awesome.css"; |
|
||||
|
|
||||
body { |
|
||||
position: relative; |
|
||||
color: white; |
|
||||
height: 100vh; |
|
||||
background-color: #000; |
|
||||
background-image: linear-gradient(45deg, rgba(29, 29, 29, 0.5) 10%, rgba(235, 184, 100, 0.7)); |
|
||||
font-family: Arial, Helvetica, Helvetica Neue, serif; |
|
||||
overflow-y: hidden; |
|
||||
} |
|
||||
|
|
||||
h2 { |
|
||||
margin: 0; |
|
||||
font-size: 2.25rem; |
|
||||
font-weight: bold; |
|
||||
letter-spacing: -0.025em; |
|
||||
color: #fff; |
|
||||
} |
|
||||
|
|
||||
p { |
|
||||
font-size: 24px; |
|
||||
} |
|
||||
|
|
||||
li { |
|
||||
list-style: none; |
|
||||
} |
|
||||
|
|
||||
a { |
|
||||
color: white; |
|
||||
opacity: 0.75; |
|
||||
text-decoration: none; |
|
||||
} |
|
||||
|
|
||||
a:hover { |
|
||||
opacity: 1; |
|
||||
text-decoration: none; |
|
||||
cursor: pointer; |
|
||||
} |
|
@ -0,0 +1,24 @@ |
|||||
|
@import "~font-awesome/css/font-awesome.css"; |
||||
|
@import 'reset.scss'; |
||||
|
@import 'variables.scss'; |
||||
|
|
||||
|
@font-face { |
||||
|
font-family: 'Roboto'; |
||||
|
font-style: normal; |
||||
|
font-weight: 300; |
||||
|
src: local('Roboto Light'), local('Roboto-Light'), url(http://fonts.gstatic.com/s/roboto/v15/Fl4y0QdOxyyTHEGMXX8kcaCWcynf_cDxXwCLxiixG1c.ttf) format('truetype'); |
||||
|
} |
||||
|
|
||||
|
body { |
||||
|
position: relative; |
||||
|
overflow-y: hidden; |
||||
|
margin: 0; |
||||
|
padding: 0; |
||||
|
// background: linear-gradient(to bottom, $grey 0%, $black 100%); |
||||
|
color: $white; |
||||
|
height: 100vh; |
||||
|
box-sizing: border-box; |
||||
|
-webkit-font-smoothing: antialiased; |
||||
|
-webkit-tap-highlight-color: rgba(255,255,255,0); |
||||
|
font-family: 'Roboto'; |
||||
|
} |
@ -1,37 +0,0 @@ |
|||||
.backButton { |
|
||||
position: absolute; |
|
||||
} |
|
||||
|
|
||||
.counter { |
|
||||
position: absolute; |
|
||||
top: 30%; |
|
||||
left: 45%; |
|
||||
font-size: 10rem; |
|
||||
font-weight: bold; |
|
||||
letter-spacing: -0.025em; |
|
||||
} |
|
||||
|
|
||||
.btnGroup { |
|
||||
position: relative; |
|
||||
top: 500px; |
|
||||
width: 480px; |
|
||||
margin: 0 auto; |
|
||||
} |
|
||||
|
|
||||
.btn { |
|
||||
font-size: 1.6rem; |
|
||||
font-weight: bold; |
|
||||
background-color: #fff; |
|
||||
border-radius: 50%; |
|
||||
margin: 10px; |
|
||||
width: 100px; |
|
||||
height: 100px; |
|
||||
opacity: 0.7; |
|
||||
cursor: pointer; |
|
||||
font-family: Arial, Helvetica, Helvetica Neue; |
|
||||
} |
|
||||
|
|
||||
.btn:hover { |
|
||||
color: white; |
|
||||
background-color: rgba(0, 0, 0, 0.5); |
|
||||
} |
|
@ -1,42 +0,0 @@ |
|||||
// @flow
|
|
||||
import React, { Component } from 'react'; |
|
||||
import { Link } from 'react-router-dom'; |
|
||||
import styles from './Counter.css'; |
|
||||
|
|
||||
class Counter extends Component { |
|
||||
props: { |
|
||||
increment: () => void, |
|
||||
incrementIfOdd: () => void, |
|
||||
incrementAsync: () => void, |
|
||||
decrement: () => void, |
|
||||
counter: number |
|
||||
}; |
|
||||
|
|
||||
render() { |
|
||||
const { increment, incrementIfOdd, incrementAsync, decrement, counter } = this.props; |
|
||||
return ( |
|
||||
<div> |
|
||||
<div className={styles.backButton} data-tid="backButton"> |
|
||||
<Link to="/"> |
|
||||
<i className="fa fa-arrow-left fa-3x" /> |
|
||||
</Link> |
|
||||
</div> |
|
||||
<div className={`counter ${styles.counter}`} data-tid="counter"> |
|
||||
{counter} |
|
||||
</div> |
|
||||
<div className={styles.btnGroup}> |
|
||||
<button className={styles.btn} onClick={increment} data-tclass="btn"> |
|
||||
<i className="fa fa-plus" /> |
|
||||
</button> |
|
||||
<button className={styles.btn} onClick={decrement} data-tclass="btn"> |
|
||||
<i className="fa fa-minus" /> |
|
||||
</button> |
|
||||
<button className={styles.btn} onClick={incrementIfOdd} data-tclass="btn">odd</button> |
|
||||
<button className={styles.btn} onClick={() => incrementAsync()} data-tclass="btn">async</button> |
|
||||
</div> |
|
||||
</div> |
|
||||
); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
export default Counter; |
|
@ -1,14 +0,0 @@ |
|||||
.container { |
|
||||
position: absolute; |
|
||||
top: 30%; |
|
||||
left: 10px; |
|
||||
text-align: center; |
|
||||
} |
|
||||
|
|
||||
.container h2 { |
|
||||
font-size: 5rem; |
|
||||
} |
|
||||
|
|
||||
.container a { |
|
||||
font-size: 1.4rem; |
|
||||
} |
|
@ -1,16 +0,0 @@ |
|||||
// @flow
|
|
||||
import React, { Component } from 'react' |
|
||||
import { Link } from 'react-router-dom' |
|
||||
import styles from './Home.css' |
|
||||
|
|
||||
export default class Home extends Component { |
|
||||
render() { |
|
||||
return ( |
|
||||
<div> |
|
||||
<div className={styles.container} data-tid="container"> |
|
||||
|
|
||||
</div> |
|
||||
</div> |
|
||||
); |
|
||||
} |
|
||||
} |
|
@ -1,16 +0,0 @@ |
|||||
import { bindActionCreators } from 'redux'; |
|
||||
import { connect } from 'react-redux'; |
|
||||
import Counter from '../components/Counter'; |
|
||||
import * as CounterActions from '../actions/counter'; |
|
||||
|
|
||||
function mapStateToProps(state) { |
|
||||
return { |
|
||||
counter: state.counter |
|
||||
}; |
|
||||
} |
|
||||
|
|
||||
function mapDispatchToProps(dispatch) { |
|
||||
return bindActionCreators(CounterActions, dispatch); |
|
||||
} |
|
||||
|
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Counter); |
|
@ -1,11 +0,0 @@ |
|||||
// @flow
|
|
||||
import React, { Component } from 'react'; |
|
||||
import Home from '../components/Home'; |
|
||||
|
|
||||
export default class HomePage extends Component { |
|
||||
render() { |
|
||||
return ( |
|
||||
<Home /> |
|
||||
); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,33 @@ |
|||||
|
@import 'variables'; |
||||
|
|
||||
|
@keyframes fadeinOutD6 { |
||||
|
0% { |
||||
|
transform: rotate(0deg); |
||||
|
} |
||||
|
50% { |
||||
|
transform: rotate(6deg); |
||||
|
} |
||||
|
100% { |
||||
|
transform: rotate(0deg); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@keyframes fadeinOutD13 { |
||||
|
0% { |
||||
|
transform: rotate(0deg); |
||||
|
} |
||||
|
50% { |
||||
|
transform: rotate(13deg); |
||||
|
} |
||||
|
100% { |
||||
|
transform: rotate(0deg); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@keyframes colorchange { |
||||
|
0% { color: $white; } |
||||
|
25% { color: $gold; } |
||||
|
50% { color: $white; } |
||||
|
75% { color: $gold; } |
||||
|
100% { color: $white; } |
||||
|
} |
@ -1,21 +0,0 @@ |
|||||
// @flow
|
|
||||
import { INCREMENT_COUNTER, DECREMENT_COUNTER } from '../actions/counter'; |
|
||||
|
|
||||
export type counterStateType = { |
|
||||
+counter: number |
|
||||
}; |
|
||||
|
|
||||
type actionType = { |
|
||||
+type: string |
|
||||
}; |
|
||||
|
|
||||
export default function counter(state: number = 0, action: actionType) { |
|
||||
switch (action.type) { |
|
||||
case INCREMENT_COUNTER: |
|
||||
return state + 1; |
|
||||
case DECREMENT_COUNTER: |
|
||||
return state - 1; |
|
||||
default: |
|
||||
return state; |
|
||||
} |
|
||||
} |
|
@ -1,11 +1,9 @@ |
|||||
// @flow
|
// @flow
|
||||
import { combineReducers } from 'redux'; |
import { combineReducers } from 'redux' |
||||
import { routerReducer as router } from 'react-router-redux'; |
import { routerReducer as router } from 'react-router-redux' |
||||
import counter from './counter'; |
|
||||
|
|
||||
const rootReducer = combineReducers({ |
const rootReducer = combineReducers({ |
||||
counter, |
router |
||||
router, |
}) |
||||
}); |
|
||||
|
|
||||
export default rootReducer; |
export default rootReducer |
||||
|
@ -0,0 +1,48 @@ |
|||||
|
/* http://meyerweb.com/eric/tools/css/reset/ |
||||
|
v2.0 | 20110126 |
||||
|
License: none (public domain) |
||||
|
*/ |
||||
|
|
||||
|
html, body, div, span, applet, object, iframe, |
||||
|
h1, h2, h3, h4, h5, h6, p, blockquote, pre, |
||||
|
a, abbr, acronym, address, big, cite, code, |
||||
|
del, dfn, em, img, ins, kbd, q, s, samp, |
||||
|
small, strike, strong, sub, sup, tt, var, |
||||
|
b, u, i, center, |
||||
|
dl, dt, dd, ol, ul, li, |
||||
|
fieldset, form, label, legend, |
||||
|
table, caption, tbody, tfoot, thead, tr, th, td, |
||||
|
article, aside, canvas, details, embed, |
||||
|
figure, figcaption, footer, header, hgroup, |
||||
|
menu, nav, output, ruby, section, summary, |
||||
|
time, mark, audio, video { |
||||
|
margin: 0; |
||||
|
padding: 0; |
||||
|
border: 0; |
||||
|
font-size: 100%; |
||||
|
font: inherit; |
||||
|
vertical-align: baseline; |
||||
|
} |
||||
|
/* HTML5 display-role reset for older browsers */ |
||||
|
article, aside, details, figcaption, figure, |
||||
|
footer, header, hgroup, menu, nav, section { |
||||
|
display: block; |
||||
|
} |
||||
|
body { |
||||
|
line-height: 1; |
||||
|
} |
||||
|
ol, ul { |
||||
|
list-style: none; |
||||
|
} |
||||
|
blockquote, q { |
||||
|
quotes: none; |
||||
|
} |
||||
|
blockquote:before, blockquote:after, |
||||
|
q:before, q:after { |
||||
|
content: ''; |
||||
|
content: none; |
||||
|
} |
||||
|
table { |
||||
|
border-collapse: collapse; |
||||
|
border-spacing: 0; |
||||
|
} |
@ -1,15 +1,13 @@ |
|||||
/* eslint flowtype-errors/show-errors: 0 */ |
/* eslint flowtype-errors/show-errors: 0 */ |
||||
import React from 'react'; |
import React from 'react' |
||||
import { Switch, Route } from 'react-router'; |
import { Switch, Route } from 'react-router' |
||||
import App from './containers/App'; |
import App from './containers/App' |
||||
import HomePage from './containers/HomePage'; |
import Home from './routes/home' |
||||
import CounterPage from './containers/CounterPage'; |
|
||||
|
|
||||
export default () => ( |
export default () => ( |
||||
<App> |
<App> |
||||
<Switch> |
<Switch> |
||||
<Route path="/counter" component={CounterPage} /> |
<Route path='/' component={Home} /> |
||||
<Route path="/" component={HomePage} /> |
|
||||
</Switch> |
</Switch> |
||||
</App> |
</App> |
||||
); |
); |
||||
|
@ -0,0 +1,66 @@ |
|||||
|
// @flow
|
||||
|
import React, { Component } from 'react' |
||||
|
import { Link } from 'react-router-dom' |
||||
|
import ReactSVG from 'react-svg' |
||||
|
import { MdAccountBalanceWallet, MdSettings } from 'react-icons/lib/md' |
||||
|
import { FaClockO, FaBitcoin, FaDollar } from 'react-icons/lib/fa' |
||||
|
import styles from './Home.scss' |
||||
|
|
||||
|
class Home extends Component { |
||||
|
render() { |
||||
|
return ( |
||||
|
<div className={styles.container} data-tid='container'> |
||||
|
<nav className={styles.nav}> |
||||
|
<ul className={styles.info}> |
||||
|
<li className={`${styles.currencies} ${styles.link}`}> |
||||
|
<span className={`${styles.currency} ${styles.btc}`}> |
||||
|
<FaBitcoin /> |
||||
|
</span> |
||||
|
<span className={`${styles.currency} ${styles.usd}`}> |
||||
|
<FaDollar /> |
||||
|
</span> |
||||
|
</li> |
||||
|
<li className={`${styles.logo} ${styles.link}`}> |
||||
|
<ReactSVG path='../resources/zap_2.svg' /> |
||||
|
</li> |
||||
|
<li className={`${styles.wallet} ${styles.link}`}> |
||||
|
<span> |
||||
|
$56.13 |
||||
|
</span> |
||||
|
</li> |
||||
|
</ul> |
||||
|
|
||||
|
<ul className={styles.links}> |
||||
|
<li className={styles.link}> |
||||
|
<FaClockO /> |
||||
|
<span>Activity</span> |
||||
|
</li> |
||||
|
<li className={styles.link}> |
||||
|
<MdAccountBalanceWallet /> |
||||
|
<span>Wallet</span> |
||||
|
</li> |
||||
|
<li className={styles.link}> |
||||
|
<MdSettings /> |
||||
|
<span>Settings</span> |
||||
|
</li> |
||||
|
</ul> |
||||
|
<div className={styles.buttons}> |
||||
|
<div className={styles.button}> |
||||
|
<span>Pay</span> |
||||
|
</div> |
||||
|
<div className={styles.button}> |
||||
|
<span>Request</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</nav> |
||||
|
|
||||
|
<div className={styles.content}> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
export default Home |
@ -0,0 +1,104 @@ |
|||||
|
.nav { |
||||
|
display: inline-block; |
||||
|
width: 15%; |
||||
|
padding: 10px; |
||||
|
font-size: 32px; |
||||
|
background: #1d1d1d; |
||||
|
height: 100vh; |
||||
|
position: relative; |
||||
|
} |
||||
|
|
||||
|
.info { |
||||
|
margin-bottom: 50%; |
||||
|
|
||||
|
.link { |
||||
|
display: inline-block; |
||||
|
vertical-align: top; |
||||
|
list-style-type: none; |
||||
|
width: 33.3%; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.currency { |
||||
|
margin: 0 5px; |
||||
|
|
||||
|
&.usd { |
||||
|
color: #ebb864; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.logo { |
||||
|
text-align: center; |
||||
|
margin-top: 50px; |
||||
|
|
||||
|
svg { |
||||
|
width: 100px; |
||||
|
height: 100px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.wallet { |
||||
|
text-align: right; |
||||
|
color: #ebb864; |
||||
|
} |
||||
|
|
||||
|
.links { |
||||
|
width: 50%; |
||||
|
margin: 0 auto; |
||||
|
|
||||
|
.link { |
||||
|
margin-bottom: 20px; |
||||
|
padding: 0 10px; |
||||
|
opacity: 0.5; |
||||
|
cursor: pointer; |
||||
|
|
||||
|
&:first-child { |
||||
|
color: #ebb864; |
||||
|
opacity: 1.0; |
||||
|
} |
||||
|
|
||||
|
svg { |
||||
|
width: 22px; |
||||
|
height: 22px; |
||||
|
} |
||||
|
|
||||
|
span { |
||||
|
margin-left: 15px; |
||||
|
line-height: 22px; |
||||
|
font-size: 18px; |
||||
|
font-weight: 500; |
||||
|
letter-spacing: .2px; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.buttons { |
||||
|
width: 75%; |
||||
|
font-size: 18px; |
||||
|
position: absolute; |
||||
|
bottom: 10px; |
||||
|
right: 12.5%; |
||||
|
} |
||||
|
|
||||
|
.button { |
||||
|
text-align: center; |
||||
|
border-radius: 8px; |
||||
|
background: #ebb864; |
||||
|
margin-bottom: 20px; |
||||
|
padding: 20px 10px; |
||||
|
font-weight: bold; |
||||
|
cursor: pointer; |
||||
|
text-transform: uppercase; |
||||
|
letter-spacing: .2px; |
||||
|
|
||||
|
&:hover { |
||||
|
background: lighten(#ebb864, 5%); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.content { |
||||
|
width: 80%; |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
import { connect } from 'react-redux' |
||||
|
import Home from '../components/Home' |
||||
|
|
||||
|
const mapDispatchToProps = {} |
||||
|
|
||||
|
const mapStateToProps = (state) => ({}) |
||||
|
|
||||
|
export default connect(mapStateToProps, mapDispatchToProps)(Home) |
@ -0,0 +1,3 @@ |
|||||
|
import HomeContainer from './containers/HomeContainer' |
||||
|
|
||||
|
export default HomeContainer |
@ -0,0 +1,4 @@ |
|||||
|
$white: #fff; |
||||
|
$black: #000; |
||||
|
$grey: #1d1d1d; |
||||
|
$gold: #ebb864; |
Loading…
Reference in new issue