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

render contract deployment address #2397

Merged
merged 1 commit into from
Sep 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion js/src/ui/IdentityIcon/identityIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

import React, { Component, PropTypes } from 'react';
import ContractIcon from 'material-ui/svg-icons/action/code';

import styles from './identityIcon.css';

Expand Down Expand Up @@ -82,7 +83,7 @@ export default class IdentityIcon extends Component {
}

render () {
const { button, className, center, inline, padded, tiny } = this.props;
const { address, button, className, center, inline, padded, tiny } = this.props;
const { iconsrc } = this.state;
const classes = [
styles.icon,
Expand All @@ -103,6 +104,14 @@ export default class IdentityIcon extends Component {
size = '32px';
}

if (!address) {
return (
<ContractIcon
className={ classes }
style={ { width: size, height: size, background: '#eee' } } />
);
}

return (
<img
className={ classes }
Expand Down
6 changes: 2 additions & 4 deletions js/src/ui/MethodDecoding/methodDecoding.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
padding-top: 1em;
font-size: 0.75em;
line-height: 2em;
opacity: 0.75;
opacity: 0.5;
}

.description {
Expand All @@ -37,10 +37,8 @@

.name,
.highlight {
background: rgba(255, 255, 255, 0.1);
color: white;
border-radius: 4px;
padding: 0.25em 0.4em;
padding: 0.25em;
}

.name,
Expand Down
22 changes: 9 additions & 13 deletions js/src/views/Account/Transactions/Transaction/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,18 @@ export default class Transaction extends Component {
renderAddress (prefix, address) {
const { accounts, contacts, contracts, tokens } = this.props;

if (!address && !address.length) {
return (
<td className={ styles.left } />
);
}

const link = `${prefix}address/${address}`;
const account = (accounts || {})[address] || (contacts || {})[address] || (tokens || {})[address] || (contracts || {})[address];
const name = account
? account.name.toUpperCase()
: this.formatHash(address);
const eslink = address ? (
<a
href={ `${prefix}address/${address}` }
target='_blank'
className={ styles.link }>
{ name }
</a>
) : 'DEPLOY';

return (
<td className={ styles.address }>
Expand All @@ -135,12 +136,7 @@ export default class Transaction extends Component {
address={ address } />
</div>
<div className={ styles.center }>
<a
href={ link }
target='_blank'
className={ styles.link }>
{ name }
</a>
{ eslink }
</div>
</td>
);
Expand Down
1 change: 1 addition & 0 deletions js/src/views/Account/Transactions/transactions.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,5 @@
padding-top: 1.5em;
text-align: right;
line-height: 1.5em;
opacity: 0.5;
}