From 8744b35dcc97ea8609fc7a0dac6138846be95729 Mon Sep 17 00:00:00 2001 From: Jessop Breth Date: Mon, 6 May 2019 13:22:10 -0400 Subject: [PATCH] Do not use block show for claim and transaction dates --- .flowconfig | 1 + package.json | 8 ++++++-- src/ui/component/dateTime/index.js | 14 +++----------- src/ui/component/dateTime/view.jsx | 13 ++----------- src/ui/component/fileCard/view.jsx | 2 +- src/ui/component/fileTile/view.jsx | 2 +- .../internal/transaction-list-item.jsx | 1 - src/ui/component/walletSendTip/view.jsx | 2 +- src/ui/constants/action_types.js | 1 - src/ui/page/file/view.jsx | 2 +- 10 files changed, 16 insertions(+), 30 deletions(-) diff --git a/.flowconfig b/.flowconfig index e7c44c7e9..af70e279f 100644 --- a/.flowconfig +++ b/.flowconfig @@ -22,6 +22,7 @@ module.name_mapper='^modal\(.*\)$' -> '/src/ui/modal\1' module.name_mapper='^app\(.*\)$' -> '/src/ui/app\1' module.name_mapper='^native\(.*\)$' -> '/src/ui/native\1' module.name_mapper='^analytics\(.*\)$' -> '/src/ui/analytics\1' +module.name_mapper='^i18n\(.*\)$' -> '/src/ui/i18n\1' [strict] diff --git a/package.json b/package.json index e749c6154..59df81a1b 100644 --- a/package.json +++ b/package.json @@ -117,8 +117,8 @@ "jsmediatags": "^3.8.1", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", - "lbry-redux": "lbryio/lbry-redux#459bea2257d61003e591daf169fefe9624522680", - "lbryinc": "lbryio/lbryinc#9665f2d1c818f1a86b2e5daab642f6879746f25f", + "lbry-redux": "lbryio/lbry-redux#5fb6efae24205dfdfa133ca4f26bccce033570e1", + "lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845", "lint-staged": "^7.0.2", "localforage": "^1.7.1", "lodash-es": "^4.17.11", @@ -188,7 +188,11 @@ "yarn": "^1.3" }, "lbrySettings": { +<<<<<<< HEAD "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", "lbrynetDaemonDir": "static/daemon", "lbrynetDaemonFileName": "lbrynet" diff --git a/src/ui/component/dateTime/index.js b/src/ui/component/dateTime/index.js index 3e1ad14a1..b6dcae093 100644 --- a/src/ui/component/dateTime/index.js +++ b/src/ui/component/dateTime/index.js @@ -1,16 +1,8 @@ import { connect } from 'react-redux'; -import { doFetchBlock, makeSelectBlockDate } from 'lbry-redux'; +import { makeSelectDateForUri } from 'lbry-redux'; import DateTime from './view'; const select = (state, props) => ({ - date: !props.date && props.block ? makeSelectBlockDate(props.block)(state) : props.date, + date: props.date || makeSelectDateForUri(props.uri)(state), }); - -const perform = dispatch => ({ - fetchBlock: height => dispatch(doFetchBlock(height)), -}); - -export default connect( - select, - perform -)(DateTime); +export default connect(select)(DateTime); diff --git a/src/ui/component/dateTime/view.jsx b/src/ui/component/dateTime/view.jsx index 9457302d3..3211c86cb 100644 --- a/src/ui/component/dateTime/view.jsx +++ b/src/ui/component/dateTime/view.jsx @@ -1,9 +1,10 @@ // @flow import React from 'react'; import moment from 'moment'; +import i18n from 'i18n'; type Props = { - date?: number | {}, + date?: any, timeAgo?: boolean, formatOptions: {}, show?: string, @@ -30,16 +31,6 @@ class DateTime extends React.PureComponent { // 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() { const { date, formatOptions, timeAgo } = this.props; const show = this.props.show || DateTime.SHOW_BOTH; diff --git a/src/ui/component/fileCard/view.jsx b/src/ui/component/fileCard/view.jsx index 2d1237855..351d5585e 100644 --- a/src/ui/component/fileCard/view.jsx +++ b/src/ui/component/fileCard/view.jsx @@ -138,7 +138,7 @@ class FileCard extends React.PureComponent {
{pending ?
Pending...
: }
- +
diff --git a/src/ui/component/fileTile/view.jsx b/src/ui/component/fileTile/view.jsx index 976ca9d91..35fc57782 100644 --- a/src/ui/component/fileTile/view.jsx +++ b/src/ui/component/fileTile/view.jsx @@ -169,7 +169,7 @@ class FileTile extends React.PureComponent { {size !== 'small' ? (
{__('Published to')} {' '} - +
) : ( diff --git a/src/ui/component/transactionList/internal/transaction-list-item.jsx b/src/ui/component/transactionList/internal/transaction-list-item.jsx index 8f38a08e8..beb2338dd 100644 --- a/src/ui/component/transactionList/internal/transaction-list-item.jsx +++ b/src/ui/component/transactionList/internal/transaction-list-item.jsx @@ -43,7 +43,6 @@ class TransactionListItem extends React.PureComponent { render() { const { reward, transaction, isRevokeable } = this.props; const { amount, claim_id: claimId, claim_name: name, date, fee, txid, type } = transaction; - const dateFormat = { month: 'short', day: 'numeric', diff --git a/src/ui/component/walletSendTip/view.jsx b/src/ui/component/walletSendTip/view.jsx index cf5b35c5c..1c54538f0 100644 --- a/src/ui/component/walletSendTip/view.jsx +++ b/src/ui/component/walletSendTip/view.jsx @@ -95,7 +95,7 @@ class WalletSendTip extends React.PureComponent {
{claimIsMine && (