Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Adding WebBrowser dapp to the list
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Drwięga committed Dec 23, 2016
1 parent 2ef58fb commit 9a58a77
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 11 deletions.
43 changes: 32 additions & 11 deletions js/src/views/Dapps/Summary/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@ export default class Summary extends Component {
return null;
}

let image = <div className={ styles.image }>&nbsp;</div>;
if (app.type === 'local') {
image = <img src={ `${dappsUrl}/${app.id}/${app.iconUrl}` } className={ styles.image } />;
} else {
image = <img src={ `${dappsUrl}${app.image}` } className={ styles.image } />;
}
const image = this.renderImage(dappsUrl, app);
const link = this.renderLink(app);

return (
<Container className={ styles.container }>
Expand All @@ -53,11 +49,7 @@ export default class Summary extends Component {
<div className={ styles.description }>
<ContainerTitle
className={ styles.title }
title={
<Link to={ `/app/${app.id}` }>
{ app.name }
</Link>
}
title={ link }
byline={ app.description }
/>
<div className={ styles.author }>
Expand All @@ -68,4 +60,33 @@ export default class Summary extends Component {
</Container>
);
}

renderImage (dappsUrl, app) {
if (app.type === 'local') {
return (
<img src={ `${dappsUrl}/${app.id}/${app.iconUrl}` } className={ styles.image } />
);
}

return (
<img src={ `${dappsUrl}${app.image}` } className={ styles.image } />
);
}

renderLink (app) {
// Special case for web dapp
if (app.url === 'web') {
return (
<Link to={ `/web` }>
{ app.name }
</Link>
);
}

return (
<Link to={ `/app/${app.id}` }>
{ app.name }
</Link>
);
}
}
9 changes: 9 additions & 0 deletions js/src/views/Dapps/builtin.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,14 @@
"version": "1.0.0",
"visible": false,
"secure": true
},
{
"id": "0x9042323cd85c6576992d211de34b3ecc183f15e4f639aa87859882f839c374e5",
"url": "web",
"name": "Browser",
"description": "A Web 2.0 hosted pseudo-dapps browser.",
"author": "Parity Team <admin@ethcore.io>",
"version": "1.0.0",
"visible": true
}
]

0 comments on commit 9a58a77

Please sign in to comment.