External app overlay

This commit is contained in:
Jaco Greeff 2016-11-16 12:27:16 +01:00
parent 9bd6378e42
commit 501c7369b0
3 changed files with 35 additions and 4 deletions

View File

@ -18,6 +18,7 @@
display: flex;
flex-wrap: wrap;
margin: -0.125em;
position: relative;
}
.list+.list {
@ -29,3 +30,14 @@
flex: 0 1 50%;
box-sizing: border-box;
}
.overlay {
background: rgba(255, 255, 255, 0.75);
bottom: 0;
left: -0.25em;
position: absolute;
right: -0.25em;
top: 0;
z-index: 100;
padding: 1em;
}

View File

@ -37,6 +37,12 @@ export default class Dapps extends Component {
store = new DappsStore(this.context.api);
render () {
const externalOverlay = (
<div className={ styles.overlay }>
dismiss me
</div>
);
return (
<div>
<AddDapps store={ this.store } />
@ -53,14 +59,27 @@ export default class Dapps extends Component {
] }
/>
<Page>
<div className={ styles.list }>
{ this.store.visibleApps.map(this.renderApp) }
</div>
{ this.renderList(this.store.sortedLocal) }
{ this.renderList(this.store.sortedBuiltin) }
{ this.renderList(this.store.sortedNetwork, externalOverlay) }
</Page>
</div>
);
}
renderList (items, overlay) {
if (!items || !items.length) {
return null;
}
return (
<div className={ styles.list }>
{ overlay }
{ items.map(this.renderApp) }
</div>
);
}
renderApp = (app) => {
return (
<div

View File

@ -186,7 +186,7 @@ export default class DappsStore {
contentHash: this._api.util.bytesToHex(contentIds[index]).substr(2),
manifestHash: this._api.util.bytesToHex(manifestIds[index]).substr(2),
type: 'network',
visible: false
visible: true
};
return app;