Skip to content
This repository has been archived by the owner on Aug 23, 2021. It is now read-only.

Commit

Permalink
Cherry pick Ionut's PR 133
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Goelzer committed Nov 11, 2020
1 parent 5d8bd62 commit 78d06ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/popup/App/Home/Deals/Deal/Deal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react';
import ProgressIndicator from 'src/popup/components/ProgressIndicator';
import TableCell from 'src/popup/components/TableCell';
import TableRow from 'src/popup/components/TableRow';
import {formatCid} from 'src/shared/formatCid';

import dealStatuses from '../../../../../shared/dealStatuses';

Expand Down Expand Up @@ -71,7 +72,7 @@ function Deal({ deal, inbound, ...rest }) {
/>
</svg>
</TableCell>
<TableCell className="font-mono">{deal.cid}</TableCell>
<TableCell className="font-mono">{formatCid(deal.cid)}</TableCell>
<TableCell>{renderStatus(deal)}</TableCell>
<TableCell>
<ProgressIndicator progress={progress} />
Expand Down
7 changes: 7 additions & 0 deletions src/shared/formatCid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const formatCid = (cid) => {
if (!cid) {
return null;
}

return cid.substring(0, 3) + '...' + cid.substring(cid.length - 6, cid.length);
};

0 comments on commit 78d06ea

Please sign in to comment.