Merge pull request #2465 from lbryio/issue2431-noBlockShow

tips and timestamps
This commit is contained in:
Sean Yesmunt 2019-05-07 15:39:35 -04:00 committed by GitHub
commit 62935a15cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 17 additions and 35 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='^native\(.*\)$' -> '<PROJECT_ROOT>/src/ui/native\1'
module.name_mapper='^analytics\(.*\)$' -> '<PROJECT_ROOT>/src/ui/analytics\1'
module.name_mapper='^i18n\(.*\)$' -> '<PROJECT_ROOT>/src/ui/i18n\1'
[strict]

View file

@ -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#32916b04e4888c06a9bb2b07c57ce6821a4acf1a",
"lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",
"lodash-es": "^4.17.11",
@ -188,7 +188,7 @@
"yarn": "^1.3"
},
"lbrySettings": {
"lbrynetDaemonVersion": "0.37.0rc4",
"lbrynetDaemonVersion": "0.37.0rc5",
"lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip",
"lbrynetDaemonDir": "static/daemon",
"lbrynetDaemonFileName": "lbrynet"

View file

@ -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);

View file

@ -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<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() {
const { date, formatOptions, timeAgo } = this.props;
const show = this.props.show || DateTime.SHOW_BOTH;

View file

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

View file

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

View file

@ -43,7 +43,6 @@ class TransactionListItem extends React.PureComponent<Props> {
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',

View file

@ -95,7 +95,7 @@ class WalletSendTip extends React.PureComponent<Props, State> {
<Button
button="primary"
label={__('Send')}
disabled={isPending || tipError}
disabled={isPending || tipError || !tipAmount}
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_COMPLETED = 'SEND_TRANSACTION_COMPLETED';
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_COMPLETED = 'SUPPORT_TRANSACTION_COMPLETED';
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">
<UriIndicator uri={uri} link />
</div>
{__('Published on')} <DateTime block={height} show={DateTime.SHOW_DATE} />
{__('Published on')} <DateTime uri={uri} show={DateTime.SHOW_DATE} />
</div>
{claimIsMine && (

View file

@ -6498,17 +6498,17 @@ lazy-val@^1.0.3, lazy-val@^1.0.4:
yargs "^13.2.2"
zstd-codec "^0.1.1"
lbry-redux@lbryio/lbry-redux#459bea2257d61003e591daf169fefe9624522680:
lbry-redux@lbryio/lbry-redux#32916b04e4888c06a9bb2b07c57ce6821a4acf1a:
version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/459bea2257d61003e591daf169fefe9624522680"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/32916b04e4888c06a9bb2b07c57ce6821a4acf1a"
dependencies:
proxy-polyfill "0.1.6"
reselect "^3.0.0"
uuid "^3.3.2"
lbryinc@lbryio/lbryinc#9665f2d1c818f1a86b2e5daab642f6879746f25f:
lbryinc@lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845:
version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/9665f2d1c818f1a86b2e5daab642f6879746f25f"
resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/43d382d9b74d396a581a74d87e4c53105e04f845"
dependencies:
reselect "^3.0.0"