-
Notifications
You must be signed in to change notification settings - Fork 287
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 #233 from tronprotocol/develop
Develop
- Loading branch information
Showing
17 changed files
with
224 additions
and
112 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
name="description" | ||
content="tronweb demo" | ||
/> | ||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||
<!-- | ||
manifest.json provides metadata used when your web app is installed on a | ||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ | ||
--> | ||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | ||
<!-- | ||
Notice the use of %PUBLIC_URL% in the tags above. | ||
It will be replaced with the URL of the `public` folder during the build. | ||
Only files inside the `public` folder can be referenced from the HTML. | ||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | ||
work correctly both with client-side routing and a non-root public URL. | ||
Learn how to configure a non-root public URL by running `npm run build`. | ||
--> | ||
<title>TronWeb Demo</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root" class="root"></div> | ||
<!-- | ||
This HTML file is a template. | ||
If you open it directly in the browser, you will see an empty page. | ||
You can add webfonts, meta tags, or analytics to this file. | ||
The build step will place the bundled scripts into the <body> tag. | ||
To begin the development, run `npm start` or `yarn start`. | ||
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React from 'react'; | ||
import isMobile from 'ismobilejs'; | ||
import intl from 'react-intl-universal'; | ||
import { inject, observer } from 'mobx-react'; | ||
import { Link } from 'react-router-dom'; | ||
import { Layout, Select, Menu, Modal, Drawer, Tooltip, Popover, Button } from 'antd'; | ||
|
||
import { cutMiddle, copyToClipboard } from '../utils/helper'; | ||
import '../assets/css/header.scss'; | ||
import walletSuccess from '../assets/images/walletSuccess.svg'; | ||
import walletFail from '../assets/images/walletFail.svg'; | ||
import logoSingle from '../assets/images/mainLogo.png'; | ||
import tronlink from '../assets/images/tronlinkLogo.svg'; | ||
import tronlinkBlue from '../assets/images/tronlinkBlue.svg'; | ||
import tronlinkRightArrow from '../assets/images/tronlinkRightArrow.svg'; | ||
import { PieChartOutlined, DesktopOutlined, ContainerOutlined } from '@ant-design/icons'; | ||
|
||
const { Option } = Select; | ||
const { SubMenu } = Menu; | ||
|
||
@inject('network') | ||
@observer | ||
class LeftMenu extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = {}; | ||
} | ||
|
||
componentDidMount() { | ||
this.props.instantActions && this.props.instantActions(); // should excute when componentDidMount, we need not check if a user logined or not | ||
if (!this.props.network.isConnected) { | ||
this.props.network.initTronLinkWallet( | ||
() => { | ||
this.props.mountedActions && this.props.mountedActions(); | ||
}, | ||
() => { | ||
// if a user do not login TronLink wallet, we should do something | ||
this.props.unmountedActions && this.props.unmountedActions(); | ||
} | ||
); | ||
} else { | ||
this.props.mountedActions && this.props.mountedActions(); | ||
} | ||
// when a user change a node or change a account or change a chain type, | ||
// we shoule listen TronLink to reload the webpage to get new account info | ||
this.props.network.listenTronLink(); | ||
} | ||
|
||
render() { | ||
return <></>; | ||
} | ||
} | ||
|
||
export default LeftMenu; |
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,30 @@ | ||
import React from 'react'; | ||
import { inject, observer } from 'mobx-react'; | ||
import HeaderPage from './Header'; | ||
import UserList from './UserList'; | ||
|
||
@inject('dapp') | ||
@observer | ||
class Home extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = {}; | ||
} | ||
|
||
componentDidMount = async () => {}; | ||
|
||
mountedActions = async () => { | ||
await this.props.dapp.getUserList(); | ||
}; | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<HeaderPage mountedActions={this.mountedActions} /> | ||
<UserList /> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Home; |
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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import { inject, observer } from 'mobx-react'; | ||
|
||
import HomePage from '../components/Home'; | ||
|
||
@inject('network') | ||
@observer | ||
class Home extends React.Component { | ||
render() { | ||
return <HomePage />; | ||
} | ||
} | ||
|
||
export default Home; |
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
Oops, something went wrong.