Add dappreg link to apps list (#3568)

* Fix rendering when contract is empty

* Add registration dapp to app list
This commit is contained in:
Jaco Greeff 2016-11-25 16:46:57 +01:00 committed by GitHub
parent 08c507daaa
commit 6d6e942d9d
5 changed files with 25 additions and 4 deletions

View File

@ -50,12 +50,12 @@ export default class ButtonBar extends Component {
key='delete'
label='Delete'
warning
disabled={ !this.dappsStore.currentApp.isOwner && !this.dappsStore.isContractOwner }
disabled={ !this.dappsStore.currentApp || (!this.dappsStore.currentApp.isOwner && !this.dappsStore.isContractOwner) }
onClick={ this.onDeleteClick } />,
<Button
key='edit'
label='Edit'
disabled={ !this.dappsStore.currentApp.isOwner }
disabled={ !this.dappsStore.currentApp || !this.dappsStore.currentApp.isOwner }
onClick={ this.onEditClick } />,
<Button
key='new'

View File

@ -33,6 +33,10 @@ export default class Dapp extends Component {
? this.dappsStore.wipApp
: this.dappsStore.currentApp;
if (!app) {
return null;
}
return (
<div className={ styles.app }>
{ this.dappsStore.isNew ? this.renderOwnerSelect(app) : this.renderOwnerStatic(app) }

View File

@ -36,6 +36,10 @@ export default class SelectDapp extends Component {
);
}
if (!this.dappsStore.currentApp) {
return null;
}
let overlayImg = null;
if (this.dappsStore.currentApp.imageHash) {
overlayImg = (

View File

@ -136,7 +136,10 @@ export default class DappsStore {
.sort((a, b) => a.name.localeCompare(b.name));
this.apps = ownApps.concat(otherApps);
this.currentApp = this.apps[0];
if (this.apps.length) {
this.currentApp = this.apps[0];
}
});
}
@ -328,7 +331,7 @@ export default class DappsStore {
})
.then(() => {
this.sortApps();
this.setLoading(this.count === 0);
this.setLoading(false);
})
.catch((error) => {
console.error('Store:loadDapps', error);

View File

@ -54,5 +54,15 @@
"version": "1.0.0",
"visible": true,
"secure": true
},
{
"id": "0x7bbc4f1a27628781b96213e781a1b8eec6982c1db8fac739af6e4c5a55862c03",
"url": "dappreg",
"name": "Dapp Registration",
"description": "Enables the registration and content management of dapps on the network",
"author": "Parity Team <admin@ethcore.io>",
"version": "1.0.0",
"visible": false,
"secure": true
}
]