Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"author": "PhyrexTsai",
"dependencies": {
"@material-ui/core": "^4.12.3",
"autoprefixer": "7.1.6",
"babel-cli": "^6.26.0",
"babel-core": "6.26.0",
Expand Down
7 changes: 4 additions & 3 deletions dapp/src/components/Card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import style from './Card.css';
import { getCryptoHerosTokenAddress } from '../../lib/web3Service';
import axios from 'axios';
import LoadingCoin from '../LoadingCoin';
import Button from 'material-ui/Button';
import Button from '@material-ui/core/Button';

import Dialog, {
import {
Dialog,
DialogActions,
DialogContent,
DialogContentText,
} from 'material-ui/Dialog';
} from '@material-ui/core';

const cx = classnames.bind(style);

Expand Down
2 changes: 1 addition & 1 deletion dapp/src/components/Contract.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import { LinearProgress } from 'material-ui/Progress';
import { LinearProgress } from '@material-ui/core/Progress';
import './Contract.css';
export default class Contract extends Component {
// 將 read contract method 透過 redux 儲存與 saga 非同步呼叫,將 web3 當成 API 使用
Expand Down
9 changes: 5 additions & 4 deletions dapp/src/components/MetaMask/MetaMask.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React, {Component} from 'react';
import Web3 from 'web3';
import Button from 'material-ui/Button';
import Dialog, {
import {Button} from '@material-ui/core';
import {
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
} from 'material-ui/Dialog';
import Slide from 'material-ui/transitions/Slide';
Slide,
} from '@material-ui/core';

const messages = {
'LOAD_MATAMASK_WALLET_ERROR': 'Load metamask wallet error, maybe try Metamask later, or upload a wallet json file.',
Expand Down
7 changes: 4 additions & 3 deletions dapp/src/components/NiftyAlert/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React, { Component } from 'react';
import Button from 'material-ui/Button';
import Dialog, {
import Button from '@material-ui/core/Button';
import {
Dialog,
DialogActions,
DialogContent,
DialogContentText,
} from 'material-ui/Dialog';
} from '@material-ui/core';

export default class extends Component{

Expand Down
2 changes: 1 addition & 1 deletion dapp/src/components/Top/Title.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Typography from 'material-ui/Typography';
import Typography from '@material-ui/core/Typography';

export const Title = (props) => (
<Typography type="title" color="inherit" align="left" className="Title">
Expand Down
4 changes: 2 additions & 2 deletions dapp/src/components/Top/Top.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import AppBar from 'material-ui/AppBar';
import Toolbar from 'material-ui/Toolbar';
import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import {Title} from './Title';

export const Top = (props) => (
Expand Down
2 changes: 1 addition & 1 deletion dapp/src/components/Warning/Warning.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Snackbar from 'material-ui/Snackbar';
import Snackbar from '@material-ui/core/Snackbar';

export const Warning = (props) => (
<Snackbar
Expand Down
22 changes: 7 additions & 15 deletions dapp/src/lib/web3Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const getProvider = (networkId) => {
switch (networkId) {
case '1':
return 'https://mainnet.infura.io/';
//! This currently need a project Id in order to access, please run locally if you can
case '3':
return 'https://ropsten.infura.io/';
case '4':
Expand All @@ -13,21 +14,6 @@ export const getProvider = (networkId) => {
}
}

export const getSimpleTokenAddress = (networkId) => {
switch (networkId) {
case '1':
return '0x0';
case '3':
return '0x131855dda0aaff096f6854854c55a4debf61077a';
case '4':
return '0x0';
case '42':
return '0x0';
default:
return '0x0';
}
}

export const getCryptoHerosTokenAddress = (networkId) => {
switch (networkId) {
case '1':
Expand All @@ -38,6 +24,9 @@ export const getCryptoHerosTokenAddress = (networkId) => {
return '0x0';
case '42':
return '0x0';
case '1337':
//* development at local, please update your local contract's address here
return '0x5FbDB2315678afecb367f032d93F642f64180aa3';
default:
return '0x0';
}
Expand All @@ -53,6 +42,9 @@ export const getCryptoHerosGameAddress = (networkId) => {
return '0x0';
case '42':
return '0x0';
case '1337':
//* development at local, please update your local contract's address here
return '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512';
default:
return '0x0';
}
Expand Down