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' key='delete'
label='Delete' label='Delete'
warning warning
disabled={ !this.dappsStore.currentApp.isOwner && !this.dappsStore.isContractOwner } disabled={ !this.dappsStore.currentApp || (!this.dappsStore.currentApp.isOwner && !this.dappsStore.isContractOwner) }
onClick={ this.onDeleteClick } />, onClick={ this.onDeleteClick } />,
<Button <Button
key='edit' key='edit'
label='Edit' label='Edit'
disabled={ !this.dappsStore.currentApp.isOwner } disabled={ !this.dappsStore.currentApp || !this.dappsStore.currentApp.isOwner }
onClick={ this.onEditClick } />, onClick={ this.onEditClick } />,
<Button <Button
key='new' key='new'

View File

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

View File

@ -136,7 +136,10 @@ export default class DappsStore {
.sort((a, b) => a.name.localeCompare(b.name)); .sort((a, b) => a.name.localeCompare(b.name));
this.apps = ownApps.concat(otherApps); 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(() => { .then(() => {
this.sortApps(); this.sortApps();
this.setLoading(this.count === 0); this.setLoading(false);
}) })
.catch((error) => { .catch((error) => {
console.error('Store:loadDapps', error); console.error('Store:loadDapps', error);

View File

@ -54,5 +54,15 @@
"version": "1.0.0", "version": "1.0.0",
"visible": true, "visible": true,
"secure": 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
} }
] ]