Skip to content

Commit 84448df

Browse files
committed
Merge branch 'allen/refactorForEdgeProvider'
# Conflicts: # src/BuyScene.js # target/index.html
2 parents 0f2d54f + 29163e3 commit 84448df

37 files changed

Lines changed: 3686 additions & 1246 deletions

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.eslintrc.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"extends": ["standard", "plugin:flowtype/recommended", "plugin:react/recommended"],
2+
"extends": ["standard", "plugin:flowtype/recommended", "plugin:react/recommended", "standard"],
33
"parser": "babel-eslint",
4-
"plugins": ["flowtype", "standard"],
4+
"plugins": ["flowtype", "standard", "react"],
55
"rules": {
66
"camelcase": "warn",
77
"flowtype/generic-spacing": "off",
88
"no-throw-literal": "error",
99
"no-var": "error",
10-
"prefer-const": "error"
10+
"prefer-const": "error",
11+
"prefer-promise-reject-errors": "warn"
1112
}
1213
}

.flowconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[ignore]
2+
3+
.*/node_modules/react-native/.*
4+
.*/node_modules/react-native-keyboard-aware-scroll-view/.*
5+
[include]
6+
7+
[libs]
8+
9+
[lints]
10+
11+
[options]
12+
13+
[strict]

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"javascript.validate.enable": false,
3+
"flow.useNPMPackagedFlow": true,
4+
"cSpell.words": [
5+
"animatable",
6+
"changelly",
7+
"cryptocurrency",
8+
"shapeshift",
9+
"sprintf"
10+
]
11+
}

env.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#!/usr/bin/env bash
12
PUBLIC_URL="./"

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"pluginId": "co.edgesecure.simplex",
33
"name": "Simplex",
4-
"subtitle": "Buy crypto with your credit card.",
4+
"subtitle": "Buy or sell crypto with a credit card\nBTC, ETH, BCH, LTC, XRP\nFee: 6% / Settlement: 1-48 hours",
55
"provider": "Edge Wallet",
66
"iconUrl": "https://edge.app/wp-content/uploads/2019/03/simplex-logo-sm-square.png",
77
"environment": {

package.json

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,26 @@
33
"version": "0.0.3",
44
"private": true,
55
"devDependencies": {
6-
"babel-eslint": "^7.1.1",
6+
"babel-eslint": "^8.1.0",
77
"babel-jest": "^20.0.3",
88
"edge-libplugin": "https://github.com/EdgeApp/edge-libplugin.git#9048d04",
9-
"eslint": "^4.12.1",
9+
"eslint": "^4.17.1",
1010
"eslint-config-standard": "^11.0.0-beta.0",
1111
"eslint-plugin-flowtype": "^2.35.0",
1212
"eslint-plugin-import": "^2.7.0",
1313
"eslint-plugin-node": "^5.2.1",
1414
"eslint-plugin-promise": "^3.6.0",
1515
"eslint-plugin-react": "^7.3.0",
1616
"eslint-plugin-standard": "^3.0.1",
17-
"flow-bin": "^0.66.0",
18-
"husky": "^0.14.3",
19-
"material-ui": "^1.0.0-beta.39",
17+
"flow-bin": "^0.65.0",
18+
"husky": "^1.3.1",
19+
"import-sort-cli": "^5.0.0",
20+
"lint-staged": "^6.1.1",
21+
"material-ui": "1.0.0-beta.39",
22+
"prettier-eslint-cli": "^4.7.0",
2023
"react": "^16.2.0",
2124
"react-dom": "^16.2.0",
22-
"react-router-dom": "^4.2.2",
25+
"react-router-dom": "^5.0.0",
2326
"react-scripts": "1.1.1",
2427
"rimraf": "^2.6.2",
2528
"uuid": "^3.2.1"
@@ -34,7 +37,28 @@
3437
"lint": "eslint --parser babel-eslint ./src",
3538
"lint:fix": "npm run lint -- --fix",
3639
"flow:0": "flow; exit 0",
37-
"flow": "flow"
40+
"flow": "flow",
41+
"precommit": "flow",
42+
"format": "import-sort -l --write '*.js' 'src/**/*.js' 'test/**/*.js'; prettier-eslint --write '*.js' 'src/**/*.js' 'test/**/*.js'"
43+
},
44+
"husky": {
45+
"hooks": {
46+
"pre-commit": "npm run precommit"
47+
}
48+
},
49+
"lint-staged": {
50+
"ignore": [
51+
"**/flow-typed/npm/*.js"
52+
],
53+
"linters": {
54+
"*.js": [
55+
"eslint",
56+
"prettier-eslint --list-different"
57+
]
58+
}
59+
},
60+
"prettier": {
61+
"printWidth": 160
3862
},
3963
"files": [
4064
"target/index.html",

src/App.js

Lines changed: 53 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import React from 'react'
2-
import PropTypes from 'prop-types'
3-
import { HashRouter as Router, Route } from 'react-router-dom'
4-
import { withStyles, createMuiTheme } from 'material-ui/styles'
5-
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'
1+
// @flow
2+
import React, { Component } from 'react'
3+
import { Route, HashRouter as Router } from 'react-router-dom'
4+
import { createMuiTheme, withStyles } from 'material-ui/styles'
65

7-
import StartScene from './StartScene'
86
import BuyScene from './BuyScene'
9-
import PaymentsScene from './PaymentsScene'
107
import EventsScene from './EventsScene'
8+
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'
9+
import { PendingSellFromURL } from './components'
10+
import SellScene from './SellScene'
11+
import StartScene from './StartScene'
12+
import TransactionsScene from './TransactionsScene'
1113

1214
const theme = createMuiTheme({
1315
palette: {
@@ -21,46 +23,63 @@ const theme = createMuiTheme({
2123
typography: {
2224
fontFamily: "'Source Sans Pro', sans-serif !important"
2325
},
24-
shadows: ['none']
26+
shadows: Array(25).fill('none')
2527
})
2628

27-
export const routes = [{
28-
path: '/',
29-
main: StartScene,
30-
exact: true
31-
}, {
32-
path: '/buy/',
33-
main: BuyScene,
34-
exact: true
35-
}, {
36-
path: '/payments/',
37-
main: PaymentsScene,
38-
exact: true
39-
}, {
40-
path: '/events/:paymentId/',
41-
main: EventsScene,
42-
exact: true
43-
}]
29+
export const routes = [
30+
{
31+
path: '/',
32+
main: StartScene,
33+
exact: true
34+
},
35+
{
36+
path: '/buy/',
37+
main: BuyScene,
38+
exact: true
39+
},
40+
{
41+
path: '/sell/',
42+
main: SellScene,
43+
exact: true
44+
},
45+
{
46+
path: '/sell/execution-orders/:executionOrderId',
47+
main: PendingSellFromURL,
48+
exact: true
49+
},
50+
{
51+
path: '/transactions/',
52+
main: TransactionsScene,
53+
exact: true
54+
},
55+
{
56+
path: '/:type/events/:transactionId/',
57+
main: EventsScene,
58+
exact: true
59+
}
60+
]
4461

45-
const appStyles = (theme) => ({
62+
const appStyles = theme => ({
4663
content: {
47-
height: '100%'
64+
height: '100%',
65+
display: 'flex',
66+
flexDirection: 'column'
4867
}
4968
})
5069

51-
class App extends React.Component {
70+
type Props = {
71+
classes: Object
72+
}
73+
type State = {}
74+
75+
class App extends Component<Props, State> {
5276
render () {
5377
return (
5478
<MuiThemeProvider theme={theme}>
5579
<Router>
5680
<div className={this.props.classes.content}>
5781
{routes.map((route, index) => (
58-
<Route
59-
key={index}
60-
path={route.path}
61-
exact={route.exact}
62-
component={route.main}
63-
/>
82+
<Route key={index} path={route.path} exact={route.exact} component={route.main} />
6483
))}
6584
</div>
6685
</Router>
@@ -69,8 +88,4 @@ class App extends React.Component {
6988
}
7089
}
7190

72-
App.propTypes = {
73-
classes: PropTypes.object
74-
}
75-
7691
export default withStyles(appStyles)(App)

0 commit comments

Comments
 (0)