Do not use block show for claim and transaction dates

This commit is contained in:
Jessop Breth 2019-05-06 13:22:10 -04:00 committed by Sean Yesmunt
parent c8641a0315
commit 8744b35dcc
10 changed files with 16 additions and 30 deletions

View file

@ -22,6 +22,7 @@ module.name_mapper='^modal\(.*\)$' -> '<PROJECT_ROOT>/src/ui/modal\1'
module.name_mapper='^app\(.*\)$' -> '<PROJECT_ROOT>/src/ui/app\1' module.name_mapper='^app\(.*\)$' -> '<PROJECT_ROOT>/src/ui/app\1'
module.name_mapper='^native\(.*\)$' -> '<PROJECT_ROOT>/src/ui/native\1' module.name_mapper='^native\(.*\)$' -> '<PROJECT_ROOT>/src/ui/native\1'
module.name_mapper='^analytics\(.*\)$' -> '<PROJECT_ROOT>/src/ui/analytics\1' module.name_mapper='^analytics\(.*\)$' -> '<PROJECT_ROOT>/src/ui/analytics\1'
module.name_mapper='^i18n\(.*\)$' -> '<PROJECT_ROOT>/src/ui/i18n\1'
[strict] [strict]

View file

@ -117,8 +117,8 @@
"jsmediatags": "^3.8.1", "jsmediatags": "^3.8.1",
"json-loader": "^0.5.4", "json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git", "lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#459bea2257d61003e591daf169fefe9624522680", "lbry-redux": "lbryio/lbry-redux#5fb6efae24205dfdfa133ca4f26bccce033570e1",
"lbryinc": "lbryio/lbryinc#9665f2d1c818f1a86b2e5daab642f6879746f25f", "lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845",
"lint-staged": "^7.0.2", "lint-staged": "^7.0.2",
"localforage": "^1.7.1", "localforage": "^1.7.1",
"lodash-es": "^4.17.11", "lodash-es": "^4.17.11",
@ -188,7 +188,11 @@
"yarn": "^1.3" "yarn": "^1.3"
}, },
"lbrySettings": { "lbrySettings": {
<<<<<<< HEAD
"lbrynetDaemonVersion": "0.37.0rc4", "lbrynetDaemonVersion": "0.37.0rc4",
=======
"lbrynetDaemonVersion": "0.37.0rc5",
>>>>>>> Do not use block show for claim and transaction dates
"lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip", "lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip",
"lbrynetDaemonDir": "static/daemon", "lbrynetDaemonDir": "static/daemon",
"lbrynetDaemonFileName": "lbrynet" "lbrynetDaemonFileName": "lbrynet"

View file

@ -1,16 +1,8 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { doFetchBlock, makeSelectBlockDate } from 'lbry-redux'; import { makeSelectDateForUri } from 'lbry-redux';
import DateTime from './view'; import DateTime from './view';
const select = (state, props) => ({ const select = (state, props) => ({
date: !props.date && props.block ? makeSelectBlockDate(props.block)(state) : props.date, date: props.date || makeSelectDateForUri(props.uri)(state),
}); });
export default connect(select)(DateTime);
const perform = dispatch => ({
fetchBlock: height => dispatch(doFetchBlock(height)),
});
export default connect(
select,
perform
)(DateTime);

View file

@ -1,9 +1,10 @@
// @flow // @flow
import React from 'react'; import React from 'react';
import moment from 'moment'; import moment from 'moment';
import i18n from 'i18n';
type Props = { type Props = {
date?: number | {}, date?: any,
timeAgo?: boolean, timeAgo?: boolean,
formatOptions: {}, formatOptions: {},
show?: string, show?: string,
@ -30,16 +31,6 @@ class DateTime extends React.PureComponent<Props> {
// this.refreshDate(props); // this.refreshDate(props);
} }
// Removing this for performance reasons. Can be un-commented once block_show is better with large numbers of calls
// Or the date is included in the claim
//
// refreshDate(props: Props) {
// const { block, date, fetchBlock } = props;
// if (block && date === undefined) {
// fetchBlock(block);
// }
// }
render() { render() {
const { date, formatOptions, timeAgo } = this.props; const { date, formatOptions, timeAgo } = this.props;
const show = this.props.show || DateTime.SHOW_BOTH; const show = this.props.show || DateTime.SHOW_BOTH;

View file

@ -138,7 +138,7 @@ class FileCard extends React.PureComponent<Props> {
<div className="media__subtitle"> <div className="media__subtitle">
{pending ? <div>Pending...</div> : <UriIndicator uri={uri} link />} {pending ? <div>Pending...</div> : <UriIndicator uri={uri} link />}
<div> <div>
<DateTime timeAgo block={height} /> <DateTime timeAgo uri={uri} />
</div> </div>
</div> </div>
<div className="media__properties"> <div className="media__properties">

View file

@ -169,7 +169,7 @@ class FileTile extends React.PureComponent<Props> {
{size !== 'small' ? ( {size !== 'small' ? (
<div className="media__subtext"> <div className="media__subtext">
{__('Published to')} <UriIndicator uri={uri} link />{' '} {__('Published to')} <UriIndicator uri={uri} link />{' '}
<DateTime timeAgo block={height} /> <DateTime timeAgo uri={uri} />
</div> </div>
) : ( ) : (
<Fragment> <Fragment>

View file

@ -43,7 +43,6 @@ class TransactionListItem extends React.PureComponent<Props> {
render() { render() {
const { reward, transaction, isRevokeable } = this.props; const { reward, transaction, isRevokeable } = this.props;
const { amount, claim_id: claimId, claim_name: name, date, fee, txid, type } = transaction; const { amount, claim_id: claimId, claim_name: name, date, fee, txid, type } = transaction;
const dateFormat = { const dateFormat = {
month: 'short', month: 'short',
day: 'numeric', day: 'numeric',

View file

@ -95,7 +95,7 @@ class WalletSendTip extends React.PureComponent<Props, State> {
<Button <Button
button="primary" button="primary"
label={__('Send')} label={__('Send')}
disabled={isPending || tipError} disabled={isPending || tipError || !tipAmount}
onClick={this.handleSendButtonClicked} onClick={this.handleSendButtonClicked}
/> />
} }

View file

@ -55,7 +55,6 @@ export const CHECK_ADDRESS_IS_MINE_COMPLETED = 'CHECK_ADDRESS_IS_MINE_COMPLETED'
export const SEND_TRANSACTION_STARTED = 'SEND_TRANSACTION_STARTED'; export const SEND_TRANSACTION_STARTED = 'SEND_TRANSACTION_STARTED';
export const SEND_TRANSACTION_COMPLETED = 'SEND_TRANSACTION_COMPLETED'; export const SEND_TRANSACTION_COMPLETED = 'SEND_TRANSACTION_COMPLETED';
export const SEND_TRANSACTION_FAILED = 'SEND_TRANSACTION_FAILED'; export const SEND_TRANSACTION_FAILED = 'SEND_TRANSACTION_FAILED';
export const FETCH_BLOCK_SUCCESS = 'FETCH_BLOCK_SUCCESS';
export const SUPPORT_TRANSACTION_STARTED = 'SUPPORT_TRANSACTION_STARTED'; export const SUPPORT_TRANSACTION_STARTED = 'SUPPORT_TRANSACTION_STARTED';
export const SUPPORT_TRANSACTION_COMPLETED = 'SUPPORT_TRANSACTION_COMPLETED'; export const SUPPORT_TRANSACTION_COMPLETED = 'SUPPORT_TRANSACTION_COMPLETED';
export const SUPPORT_TRANSACTION_FAILED = 'SUPPORT_TRANSACTION_FAILED'; export const SUPPORT_TRANSACTION_FAILED = 'SUPPORT_TRANSACTION_FAILED';

View file

@ -238,7 +238,7 @@ class FilePage extends React.Component<Props> {
<div className="media__subtitle__channel"> <div className="media__subtitle__channel">
<UriIndicator uri={uri} link /> <UriIndicator uri={uri} link />
</div> </div>
{__('Published on')} <DateTime block={height} show={DateTime.SHOW_DATE} /> {__('Published on')} <DateTime uri={uri} show={DateTime.SHOW_DATE} />
</div> </div>
{claimIsMine && ( {claimIsMine && (