migrate to embark 3.2
This commit is contained in:
parent
b1e6242972
commit
513058bbff
26
.babelrc
26
.babelrc
|
@ -1,4 +1,24 @@
|
|||
{
|
||||
"plugins": ["transform-object-rest-spread"],
|
||||
"presets": ["stage-2"]
|
||||
}
|
||||
"plugins": [
|
||||
"@babel/plugin-proposal-object-rest-spread",
|
||||
"@babel/plugin-syntax-dynamic-import",
|
||||
"@babel/plugin-syntax-import-meta",
|
||||
"@babel/plugin-proposal-class-properties",
|
||||
"@babel/plugin-proposal-json-strings",
|
||||
[
|
||||
"@babel/plugin-proposal-decorators",
|
||||
{
|
||||
"legacy": true
|
||||
}
|
||||
],
|
||||
"@babel/plugin-proposal-function-sent",
|
||||
"@babel/plugin-proposal-export-namespace-from",
|
||||
"@babel/plugin-proposal-numeric-separator",
|
||||
"@babel/plugin-proposal-throw-expressions"
|
||||
],
|
||||
"presets": [],
|
||||
"ignore": [
|
||||
"config/",
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ const DisplayBox = ({ displayType, pubKey }) => (
|
|||
</div>
|
||||
);
|
||||
|
||||
const formRef = React.createRef();
|
||||
const displayTerms = status => status === 'terms';
|
||||
const InnerForm = ({
|
||||
values,
|
||||
|
@ -51,7 +52,7 @@ const InnerForm = ({
|
|||
SNTAllowance,
|
||||
SNTBalance,
|
||||
}) => (
|
||||
<form onSubmit={handleSubmit} ref={node => (this.form = node)}>
|
||||
<form onSubmit={handleSubmit} ref={formRef}>
|
||||
<div style={{ margin: '10px' }}>
|
||||
{!subDomain &&
|
||||
<FieldGroup
|
||||
|
@ -157,7 +158,7 @@ const InnerForm = ({
|
|||
{/*</Field>*/}
|
||||
<div style={{ position: 'relative', left: 0, right: 0, bottom: 0 }}>
|
||||
{!isSubmitting ? <MobileButton onClick={() => { setStatus('terms') }} text={`${editAccount ? 'Save' : 'Register'} with transaction`} style={{ width: '100%' }} /> : <CircularProgress style={{ marginLeft: '45%' }} />}
|
||||
<Terms open={displayTerms(status)} onSubmit={() => { setStatus(null); this.form.dispatchEvent(new Event('submit')) }} />
|
||||
<Terms open={displayTerms(status)} onSubmit={() => { setStatus(null); formRef.dispatchEvent(new Event('submit')) }} />
|
||||
</div>
|
||||
</Hidden>
|
||||
</div>
|
||||
|
|
|
@ -8,6 +8,6 @@ export const nullAddress = '0x0000000000000000000000000000000000000000';
|
|||
export const getResolver = async node => {
|
||||
const resolverAddress = await resolver(node).call();
|
||||
return resolverAddress !== nullAddress
|
||||
? new EmbarkJS.Contract({ abi: PublicResolver._jsonInterface, address: resolverAddress })
|
||||
? new EmbarkJS.Blockchain.Contract({ abi: PublicResolver._jsonInterface, address: resolverAddress })
|
||||
: PublicResolver
|
||||
}
|
||||
|
|
|
@ -40,9 +40,8 @@ class App extends React.Component {
|
|||
state = { admin: false, searching: false };
|
||||
|
||||
componentDidMount(){
|
||||
__embarkContext.execWhenReady(() => {
|
||||
EmbarkJS.onReady((err) => {
|
||||
getNetworkType().then(network => { this.setState({ network })});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import { fetchAndDispatchSNTAllowance, fetchAndDispatchAccountsWithBalances, che
|
|||
const dispatch = action => store.dispatch(action)
|
||||
|
||||
export default () => {
|
||||
__embarkContext.execWhenReady(async () => {
|
||||
EmbarkJS.onReady(async (err) => {
|
||||
fetchAndDispatchAccountsWithBalances(web3, dispatch)
|
||||
checkAndDispatchStatusContactCode(dispatch)
|
||||
fetchAndDispatchSNTAllowance(dispatch)
|
||||
|
|
17
package.json
17
package.json
|
@ -18,7 +18,6 @@
|
|||
},
|
||||
"homepage": "https://github.com/status-im/contracts#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.0.0-beta.55",
|
||||
"@material-ui/core": "^1.2.1",
|
||||
"@material-ui/icons": "^1.1.0",
|
||||
"bignumber.js": "^5.0.0",
|
||||
|
@ -30,11 +29,11 @@
|
|||
"install": "^0.11.0",
|
||||
"npm": "^6.1.0",
|
||||
"prop-types": "^15.6.1",
|
||||
"react": "^16.3.2",
|
||||
"react": "^16.4.2",
|
||||
"react-blockies": "^1.3.0",
|
||||
"react-bootstrap": "^0.32.1",
|
||||
"react-copy-to-clipboard": "^5.0.1",
|
||||
"react-dom": "^16.3.2",
|
||||
"react-dom": "^16.4.2",
|
||||
"react-redux": "^5.0.7",
|
||||
"react-toggle": "^4.0.2",
|
||||
"redux": "^4.0.0",
|
||||
|
@ -46,8 +45,16 @@
|
|||
"web3-utils": "^1.0.0-beta.34"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-preset-stage-2": "^6.24.1",
|
||||
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
||||
"@babel/plugin-proposal-decorators": "^7.0.0",
|
||||
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
|
||||
"@babel/plugin-proposal-function-sent": "^7.0.0",
|
||||
"@babel/plugin-proposal-json-strings": "^7.0.0",
|
||||
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
|
||||
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
||||
"@babel/plugin-syntax-import-meta": "^7.0.0",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-config-airbnb": "^16.1.0",
|
||||
"eslint-plugin-import": "^2.12.0",
|
||||
|
|
Loading…
Reference in New Issue