fix wrong amount showing for effective_amount visual

This commit is contained in:
Sean Yesmunt 2020-02-12 10:10:17 -05:00
parent 83ebe9a18f
commit 87baaf960e
7 changed files with 49 additions and 10 deletions

View file

@ -130,7 +130,7 @@
"imagesloaded": "^4.1.4",
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#74e291c4ad351743fdebd53b3714cb1d9d3f0fad",
"lbry-redux": "lbryio/lbry-redux#916ef0f6474f8666d491df75516621b6ffcfbfce",
"lbryinc": "lbryio/lbryinc#6a59102c52673502569d2c43bd4ee58c315fb2e4",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",

View file

@ -0,0 +1,9 @@
import { connect } from 'react-redux';
import { makeSelectClaimForUri } from 'lbry-redux';
import ClaimRepostAuthor from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri, false)(state),
});
export default connect(select)(ClaimRepostAuthor);

View file

@ -0,0 +1,19 @@
// @flow
import React from 'react';
type Props = {
uri: string,
claim: ?Claim,
};
function ClaimRepostAuthor(props: Props) {
const { claim } = props;
if (!claim) {
return null;
}
return <span>{claim.meta.effective_amount}</span>;
}
export default ClaimRepostAuthor;

View file

@ -54,6 +54,12 @@ class FileDetails extends PureComponent<Props> {
<td> {__('Content Type')}</td>
<td>{mediaType}</td>
</tr>
{fileSize && (
<tr>
<td> {__('File Size')}</td>
<td>{fileSize}</td>
</tr>
)}
<tr>
<td> {__('Bid Amount')}</td>
<td>{claim.amount} LBC</td>
@ -62,16 +68,15 @@ class FileDetails extends PureComponent<Props> {
<td> {__('Effective Amount')}</td>
<td>{claim.meta.effective_amount} LBC</td>
</tr>
<tr>
<td> {__('Is Controlling')}</td>
<td>{claim.meta.is_controlling ? __('Yes') : __('No')}</td>
</tr>
<tr>
<td> {__('Claim ID')}</td>
<td>{claim.claim_id}</td>
</tr>
{fileSize && (
<tr>
<td> {__('File Size')}</td>
<td>{fileSize}</td>
</tr>
)}
{languages && (
<tr>
<td>{__('Languages')}</td>

View file

@ -2,6 +2,7 @@
import React from 'react';
import Page from 'component/page';
import ClaimListDiscover from 'component/claimListDiscover';
import ClaimEffectiveAmount from 'component/claimEffectiveAmount';
import { TYPE_TOP, TIME_ALL } from 'component/claimListDiscover/view';
type Props = {
@ -18,7 +19,11 @@ function TopPage(props: Props) {
defaultTypeSort={TYPE_TOP}
defaultTimeSort={TIME_ALL}
defaultOrderBy={['effective_amount']}
renderProperties={claim => <span className="media__subtitle">{claim.meta.effective_amount} LBC</span>}
renderProperties={claim => (
<span className="media__subtitle">
<ClaimEffectiveAmount uri={claim.repost_url || claim.canonical_url} />
</span>
)}
header={<span>{__('Top claims at lbry://%name%', { name })}</span>}
/>
</Page>

View file

@ -76,6 +76,7 @@
}
.table--file-details {
margin-top: var(--spacing-large);
font-size: var(--font-small);
td:nth-of-type(1) {

View file

@ -7174,9 +7174,9 @@ lazy-val@^1.0.4:
yargs "^13.2.2"
zstd-codec "^0.1.1"
lbry-redux@lbryio/lbry-redux#74e291c4ad351743fdebd53b3714cb1d9d3f0fad:
lbry-redux@lbryio/lbry-redux#916ef0f6474f8666d491df75516621b6ffcfbfce:
version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/74e291c4ad351743fdebd53b3714cb1d9d3f0fad"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/916ef0f6474f8666d491df75516621b6ffcfbfce"
dependencies:
proxy-polyfill "0.1.6"
reselect "^3.0.0"