diff --git a/ui/component/fileDescription/index.js b/ui/component/fileDescription/index.js
index 43afce05b..ce3b53a00 100644
--- a/ui/component/fileDescription/index.js
+++ b/ui/component/fileDescription/index.js
@@ -1,5 +1,10 @@
import { connect } from 'react-redux';
-import { makeSelectClaimForUri, makeSelectMetadataForUri, makeSelectTagsForUri } from 'lbry-redux';
+import {
+ makeSelectClaimForUri,
+ makeSelectMetadataForUri,
+ makeSelectTagsForUri,
+ makeSelectPendingAmountByUri,
+} from 'lbry-redux';
import { selectUser } from 'redux/selectors/user';
import FileDescription from './view';
@@ -8,6 +13,7 @@ const select = (state, props) => ({
metadata: makeSelectMetadataForUri(props.uri)(state),
user: selectUser(state),
tags: makeSelectTagsForUri(props.uri)(state),
+ pendingAmount: makeSelectPendingAmountByUri(props.uri)(state),
});
export default connect(select, null)(FileDescription);
diff --git a/ui/component/fileDescription/view.jsx b/ui/component/fileDescription/view.jsx
index 7bbd53fe8..f4d64a95b 100644
--- a/ui/component/fileDescription/view.jsx
+++ b/ui/component/fileDescription/view.jsx
@@ -1,9 +1,13 @@
// @flow
import React from 'react';
import classnames from 'classnames';
+import { formatCredits } from 'lbry-redux';
import MarkdownPreview from 'component/common/markdown-preview';
import ClaimTags from 'component/claimTags';
import Button from 'component/button';
+import LbcSymbol from 'component/common/lbc-symbol';
+import FileDetails from 'component/fileDetails';
+import FileValues from 'component/fileValues';
type Props = {
uri: string,
@@ -11,23 +15,15 @@ type Props = {
metadata: StreamMetadata,
user: ?any,
tags: any,
+ pendingAmount: number,
};
function FileDescription(props: Props) {
- const { uri, claim, metadata, tags } = props;
+ const { uri, claim, metadata, tags, pendingAmount } = props;
const [expanded, setExpanded] = React.useState(false);
- const [hasOverflow, setHasOverflow] = React.useState(false);
- const [hasCalculatedOverflow, setHasCalculatedOverflow] = React.useState(false);
- const descriptionRef = React.useRef();
-
- React.useEffect(() => {
- if (descriptionRef && descriptionRef.current) {
- const element = descriptionRef.current;
- const isOverflowing = element.scrollHeight > element.clientHeight;
- setHasOverflow(isOverflowing);
- setHasCalculatedOverflow(true);
- }
- }, [descriptionRef]);
+ const [showCreditDetails, setShowCreditDetails] = React.useState(false);
+ const amount = parseFloat(claim.amount) + parseFloat(pendingAmount || claim.meta.support_amount);
+ const formattedAmount = formatCredits(amount, 2, true);
if (!claim || !metadata) {
return {__('Empty claim or metadata info.')};
@@ -40,23 +36,32 @@ function FileDescription(props: Props) {
return (
+
- {hasCalculatedOverflow && hasOverflow && (
-
- {expanded ? (
-
diff --git a/ui/component/fileDetails/view.jsx b/ui/component/fileDetails/view.jsx
index 79765fa16..92a269a65 100644
--- a/ui/component/fileDetails/view.jsx
+++ b/ui/component/fileDetails/view.jsx
@@ -1,8 +1,7 @@
// @flow
-import React, { Fragment, PureComponent } from 'react';
+import React, { PureComponent } from 'react';
import Button from 'component/button';
import path from 'path';
-import Card from 'component/common/card';
import { formatBytes } from 'util/format-bytes';
type Props = {
@@ -39,67 +38,58 @@ class FileDetails extends PureComponent
{
}
return (
-
-
-
-
- {__('Content Type')} |
- {mediaType} |
-
- {fileSize && (
-
- {__('File Size')} |
- {fileSize} |
-
- )}
+
+
+
+ {__('Content Type')} |
+ {mediaType} |
+
+ {fileSize && (
+
+ {__('File Size')} |
+ {fileSize} |
+
+ )}
-
- {__('URL')} |
- {claim.canonical_url} |
-
+
+ {__('URL')} |
+ {claim.canonical_url} |
+
-
- {__('Claim ID')} |
- {claim.claim_id} |
-
+
+ {__('Claim ID')} |
+ {claim.claim_id} |
+
- {languages && (
-
- {__('Languages')} |
- {languages.join(' ')} |
-
- )}
-
- {__('License')} |
- {license} |
-
- {downloadPath && (
-
- {__('Downloaded to')} |
-
- {/* {downloadPath.replace(/(.{10})/g, '$1\u200b')} */}
- {
- if (downloadPath) {
- openFolder(downloadPath);
- }
- }}
- label={downloadNote || downloadPath.replace(/(.{10})/g, '$1\u200b')}
- />
- |
-
- )}
-
-
- }
- />
-
+ {languages && (
+
+ {__('Languages')} |
+ {languages.join(' ')} |
+
+ )}
+
+ {__('License')} |
+ {license} |
+
+ {downloadPath && (
+
+ {__('Downloaded to')} |
+
+ {
+ if (downloadPath) {
+ openFolder(downloadPath);
+ }
+ }}
+ label={downloadNote || downloadPath.replace(/(.{10})/g, '$1\u200b')}
+ />
+ |
+
+ )}
+
+
);
}
}
diff --git a/ui/component/fileSubtitle/index.js b/ui/component/fileSubtitle/index.js
index 5c688c4a9..dec590364 100644
--- a/ui/component/fileSubtitle/index.js
+++ b/ui/component/fileSubtitle/index.js
@@ -1,9 +1,2 @@
-import { connect } from 'react-redux';
-import { makeSelectClaimForUri, makeSelectPendingAmountByUri } from 'lbry-redux';
import FileSubtitle from './view';
-
-const select = (state, props) => ({
- claim: makeSelectClaimForUri(props.uri)(state),
- pendingAmount: makeSelectPendingAmountByUri(props.uri)(state),
-});
-export default connect(select)(FileSubtitle);
+export default FileSubtitle;
diff --git a/ui/component/fileSubtitle/view.jsx b/ui/component/fileSubtitle/view.jsx
index 5478dd27f..2a51b2171 100644
--- a/ui/component/fileSubtitle/view.jsx
+++ b/ui/component/fileSubtitle/view.jsx
@@ -1,36 +1,20 @@
// @flow
-import { SIMPLE_SITE } from 'config';
import React from 'react';
import DateTime from 'component/dateTime';
import FileViewCount from 'component/fileViewCount';
-import CreditAmount from 'component/common/credit-amount';
import FileActions from 'component/fileActions';
type Props = {
uri: string,
- claim: StreamClaim,
- pendingAmount: string,
};
function FileSubtitle(props: Props) {
- const { uri, claim, pendingAmount } = props;
+ const { uri } = props;
return (
-
-
- {!SIMPLE_SITE && (
- <>
- {' • ' /* this is bad, but it's quick! */}
-
- >
- )}
-
-
+
diff --git a/ui/component/fileValues/view.jsx b/ui/component/fileValues/view.jsx
index 0e86bf921..5df1ea343 100644
--- a/ui/component/fileValues/view.jsx
+++ b/ui/component/fileValues/view.jsx
@@ -1,13 +1,12 @@
// @flow
-import React, { Fragment, PureComponent } from 'react';
import * as ICONS from 'constants/icons';
import * as MODALS from 'constants/modal_types';
+import * as PAGES from 'constants/pages';
+import React, { PureComponent } from 'react';
import Button from 'component/button';
import Spinner from 'component/spinner';
-import * as PAGES from 'constants/pages';
import HelpLink from 'component/common/help-link';
import CreditAmount from 'component/common/credit-amount';
-import Card from 'component/common/card';
type Props = {
uri: string,
@@ -32,86 +31,76 @@ class FileValues extends PureComponent
{
const purchaseReceipt = claim && claim.purchase_receipt;
return (
-
-
-
- {purchaseReceipt && (
-
- {__('Purchase Amount')} |
-
- }
- />
- |
-
- )}
-
- {__('Original Publish Amount')} |
-
- {claim && claim.amount ? : ... }
- |
-
-
-
- {__('Supports and Tips')}
-
- |
-
- {claimIsMine && !pendingAmount && Boolean(supportsAmount) && (
- <>
- }
- onClick={() => {
- openModal(MODALS.LIQUIDATE_SUPPORTS, { uri });
- }}
- />{' '}
- >
- )}
- {(!claimIsMine || (claimIsMine && !pendingAmount && supportsAmount === 0)) && (
-
- )}
+
+
+ {purchaseReceipt && (
+
+ {__('Purchase Amount')} |
+
+ }
+ />
+ |
+
+ )}
+
+ {__('Original Publish Amount')} |
+ {claim && claim.amount ? : ... } |
+
+
+
+ {__('Supports and Tips')}
+
+ |
+
+ {claimIsMine && !pendingAmount && Boolean(supportsAmount) && (
+ <>
+ }
+ onClick={() => {
+ openModal(MODALS.LIQUIDATE_SUPPORTS, { uri });
+ }}
+ />{' '}
+ >
+ )}
+ {(!claimIsMine || (claimIsMine && !pendingAmount && supportsAmount === 0)) && (
+
+ )}
- {claimIsMine && pendingAmount && }
- |
-
-
-
-
- {__('Total Staked Amount')}
-
-
- |
-
-
- |
-
-
-
- {__('Community Choice?')}
-
- |
-
-
- |
-
-
-
- }
- />
-
+ {claimIsMine && pendingAmount && }
+ |
+
+
+
+
+ {__('Total Staked Amount')}
+
+
+ |
+
+
+ |
+
+
+
+ {__('Community Choice?')}
+
+ |
+
+
+ |
+
+
+
);
}
}
diff --git a/ui/page/file/view.jsx b/ui/page/file/view.jsx
index 0163fdbb9..5748c5f43 100644
--- a/ui/page/file/view.jsx
+++ b/ui/page/file/view.jsx
@@ -7,8 +7,6 @@ import FileTitle from 'component/fileTitle';
import FileRenderInitiator from 'component/fileRenderInitiator';
import FileRenderInline from 'component/fileRenderInline';
import FileRenderDownload from 'component/fileRenderDownload';
-import FileDetails from 'component/fileDetails';
-import FileValues from 'component/fileValues';
import RecommendedContent from 'component/recommendedContent';
import CommentsList from 'component/commentsList';
@@ -135,8 +133,6 @@ function FilePage(props: Props) {
{renderFilePageLayout()}
-
-
diff --git a/ui/scss/component/_card.scss b/ui/scss/component/_card.scss
index 31a5ca000..5cb0e718a 100644
--- a/ui/scss/component/_card.scss
+++ b/ui/scss/component/_card.scss
@@ -197,6 +197,7 @@
.card__title-actions {
align-self: flex-start;
padding: var(--spacing-m);
+ padding-right: var(--spacing-l);
@media (max-width: $breakpoint-small) {
padding: 0;
diff --git a/ui/scss/component/_media.scss b/ui/scss/component/_media.scss
index 28661634d..008a41504 100644
--- a/ui/scss/component/_media.scss
+++ b/ui/scss/component/_media.scss
@@ -101,7 +101,7 @@
.media__info-text--contracted {
margin-top: var(--spacing-m);
- max-height: 5rem;
+ max-height: 2rem;
overflow: hidden;
}
diff --git a/ui/scss/component/_table.scss b/ui/scss/component/_table.scss
index c1def458b..7ecb87061 100644
--- a/ui/scss/component/_table.scss
+++ b/ui/scss/component/_table.scss
@@ -180,6 +180,7 @@ th {
}
.table--file-details {
@extend .table--details;
+ margin-top: var(--spacing-m);
td:nth-of-type(1) {
width: 25%;