-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
420 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
import * as i from 'types'; | ||
import * as React from 'react'; | ||
import styled from 'styled-components'; | ||
import * as i from 'types' | ||
import * as React from 'react' | ||
import styled from 'styled-components' | ||
|
||
const Button = styled.button<ButtonProps>` | ||
background: ${(props) => props.theme.color.primary}; | ||
background: ${props => props.theme.color.primary}; | ||
padding: 10px 20px; | ||
border: none; | ||
color: ${(props) => props.theme.color.white}; | ||
color: ${props => props.theme.color.white}; | ||
font-size: 16px; | ||
outline: none; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
font-family: ${(props) => props.theme.font.futura}; | ||
`; | ||
font-family: ${props => props.theme.font.futura}; | ||
` | ||
|
||
// Use type for easier and composition | ||
export type ButtonProps = i.BaseStyled & React.ButtonHTMLAttributes<HTMLButtonElement>; | ||
export type ButtonProps = i.BaseStyled & | ||
React.ButtonHTMLAttributes<HTMLButtonElement> | ||
|
||
export default Button; | ||
export default Button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { default as Button } from './Button'; | ||
export { default as Button } from './Button' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import * as React from 'react'; | ||
import * as confettiImg from 'images/confetti.png'; | ||
import * as React from 'react' | ||
import * as confettiImg from 'images/confetti.png' | ||
|
||
import { Message, Confetti } from './styled'; | ||
import { Message, Confetti } from './styled' | ||
|
||
const TestPassed: React.StatelessComponent = () => ( | ||
<div> | ||
<Message> | ||
The boilerplate is successfully installed, you're ready to start. | ||
<Confetti src={confettiImg} alt="confetti"/> | ||
<Confetti src={confettiImg} alt="confetti" /> | ||
</Message> | ||
<Message>Good Luck!</Message> | ||
</div> | ||
); | ||
) | ||
|
||
export default TestPassed; | ||
export default TestPassed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { default as TestPassed } from './TestPassed'; | ||
export { default as TestPassed } from './TestPassed' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import styled from 'styled-components'; | ||
import LogoIcon from 'vectors/logo.svg'; | ||
import styled from 'styled-components' | ||
import LogoIcon from 'vectors/logo.svg' | ||
|
||
export const Section = styled.section` | ||
text-align: center; | ||
`; | ||
text-align: center; | ||
` | ||
|
||
export const LogoIconWrapper = styled(LogoIcon)` | ||
width: 200px; | ||
display: block; | ||
margin: 0 auto; | ||
`; | ||
width: 200px; | ||
display: block; | ||
margin: 0 auto; | ||
` | ||
|
||
export const Message = styled.div` | ||
font-size: 18px; | ||
margin-top: 0; | ||
color: ${(props) => props.theme.color.text}; | ||
font-family: ${(props) => props.theme.font.futura}; | ||
line-height: 30px; | ||
`; | ||
font-size: 18px; | ||
margin-top: 0; | ||
color: ${props => props.theme.color.text}; | ||
font-family: ${props => props.theme.font.futura}; | ||
line-height: 30px; | ||
` | ||
|
||
export const Confetti = styled.img` | ||
width: 22px; | ||
`; | ||
width: 22px; | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
import * as i from 'types'; | ||
import * as React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import * as i from 'types' | ||
import * as React from 'react' | ||
import { connect } from 'react-redux' | ||
|
||
import { install } from 'ducks/test'; | ||
import { install } from 'ducks/test' | ||
|
||
import { Button } from 'common'; | ||
import { TestPassed } from './components'; | ||
import { LogoIconWrapper, Section } from './components/styled'; | ||
import { Button } from 'common' | ||
import { TestPassed } from './components' | ||
import { LogoIconWrapper, Section } from './components/styled' | ||
|
||
const Test: React.FC<HomeProps> = ({ test, ...props }) => ( | ||
<Section> | ||
<LogoIconWrapper/> | ||
<LogoIconWrapper /> | ||
{test.passed ? ( | ||
<TestPassed/> | ||
<TestPassed /> | ||
) : ( | ||
<Button onClick={props.install}> | ||
{test.loading ? 'Installing ...' : 'Test installation'} | ||
</Button> | ||
)} | ||
</Section> | ||
); | ||
) | ||
|
||
const mapStateToProps: i.MapStateToProps = (state) => ({ | ||
test: state.test, | ||
}); | ||
const mapStateToProps: i.MapStateToProps = state => ({ | ||
test: state.test | ||
}) | ||
|
||
export interface HomeProps { | ||
test: i.TestState; | ||
install: i.InstallAction; | ||
test: i.TestState | ||
install: i.InstallAction | ||
} | ||
|
||
export default connect(mapStateToProps, { install })(Test); | ||
export default connect( | ||
mapStateToProps, | ||
{ install } | ||
)(Test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import * as React from 'react'; | ||
import * as React from 'react' | ||
|
||
export const Test = React.lazy(() => import('./Test')); | ||
export const Test = React.lazy(() => import('./Test')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import test from './test'; | ||
import test from './test' | ||
|
||
export const appReducers = { | ||
test, | ||
}; | ||
test | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import * as i from 'types'; | ||
import * as i from 'types' | ||
|
||
export interface TestState { | ||
error: boolean; | ||
loading: boolean; | ||
passed: boolean; | ||
error: boolean | ||
loading: boolean | ||
passed: boolean | ||
} | ||
|
||
export type InstallAction = () => i.ThunkAction<Promise<void>>; | ||
export type InstallAction = () => i.ThunkAction<Promise<void>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
import * as i from 'types'; | ||
import { Dispatch } from 'redux'; | ||
import { ThunkAction as IThunkAction } from 'redux-thunk'; | ||
import { ActionType } from 'typesafe-actions'; | ||
import * as i from 'types' | ||
import { Dispatch } from 'redux' | ||
import { ThunkAction as IThunkAction } from 'redux-thunk' | ||
import { ActionType } from 'typesafe-actions' | ||
|
||
export interface ReduxState { | ||
test: i.TestState; | ||
test: i.TestState | ||
} | ||
|
||
export interface Action<P = any> { | ||
type: string; | ||
payload?: P; | ||
error?: boolean, | ||
meta?: any, | ||
type: string | ||
payload?: P | ||
error?: boolean | ||
meta?: any | ||
} | ||
|
||
export type Actions<A> = ActionType<A>; | ||
export type Actions<A> = ActionType<A> | ||
|
||
export type ThunkAction<ReturnType> = IThunkAction<ReturnType, i.ReduxState, i.ApiHelper, Action>; | ||
export type ThunkAction<ReturnType> = IThunkAction< | ||
ReturnType, | ||
i.ReduxState, | ||
i.ApiHelper, | ||
Action | ||
> | ||
|
||
export type D = Dispatch<i.Action>; | ||
export type GS = () => i.ReduxState; | ||
export type A = i.ApiHelper; | ||
export type D = Dispatch<i.Action> | ||
export type GS = () => i.ReduxState | ||
export type A = i.ApiHelper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import * as React from 'react'; | ||
import * as ReactDOM from 'react-dom'; | ||
import * as React from 'react' | ||
import * as ReactDOM from 'react-dom' | ||
|
||
const render = () => { | ||
const Root = require('components/Root').default; | ||
ReactDOM.render(<Root />, document.getElementById('app')); | ||
}; | ||
const Root = require('components/Root').default | ||
ReactDOM.render(<Root />, document.getElementById('app')) | ||
} | ||
|
||
if (__DEV__ && module.hot) { | ||
module.hot.accept('components/Root', render); | ||
module.hot.accept('components/Root', render) | ||
} | ||
|
||
render(); | ||
render() |
Oops, something went wrong.