Shell updates (bonds, updated Dapps) (#6897)

* Remove stage-0

* Re-add stage-0 for `export default from './xyz';`

* Add background loading image

* Add window.isParity for parity-specific actions

* inject bonds (temporary)

* Remove loading text overlay

* Remove background around logo

* Remove debug log

* Fix account selection (correct component used)

* Update with changed dapp dependencies

* Add oo7 to list of babel node_module targets

* injectObjects -> onDappLoad
This commit is contained in:
Jaco Greeff 2017-10-25 16:54:41 +02:00 committed by GitHub
parent 542cee9ace
commit f282823e78
12 changed files with 1438 additions and 778 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
js/assets/parity-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

2156
js/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -180,6 +180,7 @@
"lodash.omitby": "4.6.0",
"lodash.throttle": "4.1.1",
"lodash.uniq": "4.5.0",
"oo7": "paritytech/oo7#34fdb5991f4e59b2cf84260cab48cec9a57d88c0",
"prop-types": "15.5.10",
"react": "15.6.1",
"react-dom": "15.6.1",

View File

@ -18,6 +18,23 @@
.application {
box-sizing: border-box;
margin-top: 2.75em;
.logo {
top: 0;
right: 0;
left: 0;
bottom: 0;
opacity: 0.2;
position: fixed;
padding: 7em;
text-align: center;
z-index: 0;
img {
display: inline-block;
margin: 0 auto;
}
}
}
.container {

View File

@ -35,6 +35,7 @@ import Snackbar from '../Snackbar';
import Status from '../Status';
import UpgradeParity from '../UpgradeParity';
import parityLogo from '../../assets/parity-logo-black.png';
import Store from './store';
import styles from './application.css';
@ -132,6 +133,9 @@ class Application extends Component {
return (
<div className={ styles.container }>
<div className={ styles.logo }>
<img src={ parityLogo } />
</div>
<Errors />
{ children }
</div>

View File

@ -18,9 +18,11 @@
.frame {
background: white;
border: 0;
opacity: 0;
position: absolute;
height: 100%;
width: 100%;
z-index: 1;
}
.full {
@ -32,13 +34,4 @@
font-family: 'Roboto', sans-serif;
font-size: 16px;
font-weight: 300;
.text {
text-align: center;
padding: 5em;
font-size: 2em;
color: #999;
overflow: hidden;
text-overflow: ellipsis;
}
}

View File

@ -24,6 +24,7 @@ import builtinDapps from '@parity/shared/config/dappsBuiltin.json';
import viewsDapps from '@parity/shared/config/dappsViews.json';
import DappsStore from '@parity/shared/mobx/dappsStore';
import HistoryStore from '@parity/shared/mobx/historyStore';
// import { Bond } from 'oo7';
import styles from './dapp.css';
@ -90,16 +91,7 @@ export default class Dapp extends Component {
const { app, loading } = this.state;
if (loading) {
return (
<div className={ styles.full }>
<div className={ styles.text }>
<FormattedMessage
id='dapp.loading'
defaultMessage='Loading'
/>
</div>
</div>
);
return null;
}
if (!app) {
@ -157,11 +149,20 @@ export default class Dapp extends Component {
<iframe
className={ styles.frame }
frameBorder={ 0 }
id='dappFrame'
name={ name }
onLoad={ this.onDappLoad }
sandbox='allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation'
scrolling='auto'
src={ `${src}${hash}` }
/>
);
}
onDappLoad = () => {
const frame = document.getElementById('dappFrame');
frame.style.opacity = 1;
// frame.contentWindow.injectedBondCache = Bond.cache;
}
}

View File

@ -94,7 +94,6 @@ class Dapps extends Component {
}
renderList (items, overlay) {
console.log(items);
return (
<SectionList
items={ items }

View File

@ -29,7 +29,7 @@ import Button from '@parity/ui/Button';
import ContainerTitle from '@parity/ui/Container/Title';
import IdentityIcon from '@parity/ui/IdentityIcon';
import GradientBg from '@parity/ui/GradientBg';
import SelectionList from '@parity/ui/SectionList';
import SelectionList from '@parity/ui/SelectionList';
import SignerPending from '@parity/ui/SignerPending';
import { CancelIcon } from '@parity/ui/Icons';

View File

@ -45,6 +45,7 @@ function initProvider () {
});
window.ethereum = ethereum;
window.isParity = true;
return ethereum;
}

View File

@ -16,7 +16,7 @@
module.exports = {
test: /\.js$/,
include: /node_modules\/@parity\//,
include: /node_modules\/(@parity|oo7)\//,
use: [ {
loader: 'happypack/loader',
options: {