This repository has been archived by the owner on Oct 3, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from secret-tech/feature/issue-8
Feature/issue 8
- Loading branch information
Showing
19 changed files
with
2,314 additions
and
783 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"extends": "airbnb-base", | ||
"parser": "babel-eslint", | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"es6": true, | ||
"jest/globals": true | ||
}, | ||
"plugins": [ | ||
"react", | ||
"jest" | ||
], | ||
"rules": { | ||
"comma-dangle": 0, | ||
"import/imports-first": 0, | ||
"global-require": 0, | ||
"class-methods-use-this": 0, | ||
"arrow-body-style": [ | ||
2, | ||
"as-needed" | ||
], | ||
"arrow-parens": [ | ||
"error", | ||
"always" | ||
], | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
"devDependencies": true | ||
} | ||
], | ||
"no-debugger": 0, | ||
"no-console": 0, | ||
"new-cap": 0, | ||
"strict": 0, | ||
"no-param-reassign": [ | ||
"error", | ||
{ | ||
"props": false | ||
} | ||
], | ||
"no-underscore-dangle": 0, | ||
"no-use-before-define": 0, | ||
"eol-last": 0, | ||
"no-shadow": 0, | ||
"quotes": [ | ||
2, | ||
"single" | ||
], | ||
"jsx-quotes": [ | ||
0, | ||
"prefer-single" | ||
], | ||
"react/jsx-no-undef": 1, | ||
"react/jsx-uses-react": 1, | ||
"react/jsx-uses-vars": 1 | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"extends": [ | ||
"stylelint-config-standard", | ||
"stylelint-config-css-modules", | ||
"stylelint-scss" | ||
], | ||
"rules": { | ||
"color-named": "never", | ||
"font-family-name-quotes": "always-where-required", | ||
"font-weight-notation": "named-where-possible", | ||
"function-url-no-scheme-relative": true, | ||
"function-url-quotes": "always", | ||
"string-quotes": "single", | ||
"value-keyword-case": "lower", | ||
"unit-blacklist": [], | ||
"max-empty-lines": 2, | ||
"no-descending-specificity": true, | ||
"no-duplicate-selectors": true, | ||
"at-rule-no-unknown": [ | ||
true, | ||
{ | ||
"ignoreAtRules": [ | ||
"use", | ||
"for" | ||
] | ||
} | ||
] | ||
}, | ||
"ignoreFiles": [ | ||
"node_modules/*", | ||
"src/assets/**" | ||
], | ||
"defaultSeverity": "error" | ||
} |
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,11 +1,9 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
import { namedRoutes } from '../../../routes'; | ||
|
||
export default () => ( | ||
<nav> | ||
<Link to={namedRoutes.dashboard}>Dashboard</Link> | ||
<Link to={namedRoutes.settings}>Settings</Link> | ||
<Link to="/">Dashboard</Link> | ||
<Link to="/settings">Settings</Link> | ||
</nav> | ||
); |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import { Iterable } from 'immutable'; | ||
|
||
const ToJS = (WrappedComponent) => (wrappedComponentProps) => { | ||
const key = 0; | ||
const value = 1; | ||
|
||
const propsJS = Object | ||
.entries(wrappedComponentProps) | ||
.reduce((newProps, wrappedComponentProp) => { | ||
newProps[wrappedComponentProp[key]] = Iterable.isIterable(wrappedComponentProp[value]) | ||
? wrappedComponentProp[value].toJS() | ||
: wrappedComponentProp[value]; | ||
return newProps; | ||
}, {}); | ||
|
||
return <WrappedComponent {...propsJS}/>; | ||
}; | ||
|
||
export default ToJS; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { Switch, Route, withRouter } from 'react-router-dom'; | ||
|
||
import { increment, decrement } from '../../../redux/modules/app/counter'; | ||
|
||
import ToJS from '../../../components/common/ToJS'; | ||
import Nav from '../../../components/app/Nav'; | ||
import Dashboard from '../../../components/app/Dashboard'; | ||
import Settings from '../../../components/app/Settings'; | ||
|
||
// import * as routes from '../../../routes'; | ||
import s from './styles.scss'; | ||
|
||
const Main = (props) => { | ||
const { | ||
counter, | ||
increment, | ||
decrement | ||
} = props; | ||
|
||
return ( | ||
<div> | ||
<Nav/> | ||
<Switch> | ||
<Route exact path="/" component={Dashboard}/> | ||
<Route exact path="/settings" component={Settings}/> | ||
</Switch> | ||
<div className={s.counter}> | ||
counter: {counter} | ||
<button onClick={() => increment()}>increment</button> | ||
<button onClick={() => decrement()}>decrement</button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
const mapStateToProps = (state) => ({ counter: state.get('app').get('counter').get('counter') }); | ||
|
||
const ConnectedComponent = connect(mapStateToProps, { increment, decrement })(ToJS(Main)); | ||
const ComponentWithRouter = withRouter(ConnectedComponent); | ||
export default ComponentWithRouter; |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.counter { | ||
color: #f00; | ||
} |
Oops, something went wrong.