Skip to content

Commit

Permalink
Show full description in Asset page, use short name for FormattedAsse…
Browse files Browse the repository at this point in the history
…t popover fix #833
  • Loading branch information
svk31 committed Apr 25, 2016
1 parent 6988752 commit ec7a2ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions web/app/components/Account/AccountAssets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ class AccountAssets extends React.Component {
.map(asset => {
let description = assetUtils.parseDescription(asset.options.description);
let desc = description.short_name ? description.short_name : description.main;

if (desc.length > 100) {
desc = desc.substr(0, 100) + "...";
}
Expand Down
5 changes: 4 additions & 1 deletion web/app/components/Blockchain/Asset.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ class Asset extends React.Component {
// Add <a to any links included in the description

let description = assetUtils.parseDescription(asset.options.description);
let desc = description.short_name ? description.short_name : description.main;
let desc = description.main;
let short_name = description.short_name ? description.short_name : null;

let urlTest = /(http?):\/\/(www\.)?[a-z0-9\.:].*?(?=\s)/g;

// Regexp needs a whitespace after a url, so add one to make sure
Expand Down Expand Up @@ -191,6 +193,7 @@ class Asset extends React.Component {
description={desc}
issuer= {issuerName}
/>
{short_name ? <p>{short_name}</p> : null}
<a style={{textTransform: "uppercase"}} href={`#/market/${asset.symbol}_${preferredMarket}`}><Translate content="exchange.market"/></a>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion web/app/components/Utility/FormattedAsset.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class FormattedAsset extends React.Component {
alt_path="assets/Asset"
section="summary"
symbol={asset.symbol}
description={description.main}
description={description.short_name ? description.short_name : description.main}
issuer={issuerName}/>
{this.props.assetInfo}
</div>;
Expand Down

0 comments on commit ec7a2ca

Please sign in to comment.