Skip to content

Commit

Permalink
redirect on time column and change stellar to pi
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-king21 committed Oct 7, 2021
1 parent 74b19b2 commit eb839a0
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/components/Effect.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class Effect extends React.Component {
<td>
<TimeSynchronisedFormattedRelative
initialNow={this.props.parentRenderTimestamp}
value={effect.createdAt}
time={effect.createdAt}
/>
</td>
<td>
Expand Down
3 changes: 2 additions & 1 deletion src/components/LedgerTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const LedgerRow = props => (
<span title={props.time}>
<TimeSynchronisedFormattedRelative
initialNow={props.parentRenderTimestamp}
value={props.time}
time={props.time}
hash={props.hash}
/>
</span>
</td>
Expand Down
2 changes: 1 addition & 1 deletion src/components/TradeTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const Trade = ({account, singleAccountView, trade, parentRenderTimestamp}) => {
<span title={trade.time}>
<TimeSynchronisedFormattedRelative
initialNow={parentRenderTimestamp}
value={trade.time}
time={trade.time}
/>
</span>
</td>
Expand Down
7 changes: 4 additions & 3 deletions src/components/TransactionTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TransactionRow extends React.Component {
hash,
sourceAccount,
ledger,
parentRenderTimestamp,
// parentRenderTimestamp,
opCount,
showLedger,
showSource,
Expand All @@ -43,8 +43,9 @@ class TransactionRow extends React.Component {
<td>
<span title={time}>
<TimeSynchronisedFormattedRelative
initialNow={parentRenderTimestamp}
value={time}
// initialNow={parentRenderTimestamp}
time={time}
hash={hash}
/>
</span>
</td>
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/SearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const HelpModal = props => (
<hr />
<h4>OpenSearch:</h4>
<div>
Stellar Explorer supports{' '}
Pi Blockexplorer supports{' '}
<a
target="_blank"
rel="noopener noreferrer"
Expand All @@ -115,7 +115,7 @@ const HelpModal = props => (
</a>
. This allows you to search directly from your browser search box or
search bar. You should see something like the following when you
navigate to Stellar Explorer then open the search box. Install it from
navigate to Pi Blockexplorer then open the search box. Install it from
there:
<br />
<img
Expand Down
8 changes: 5 additions & 3 deletions src/components/operations/Operation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'
import {shortAddress} from '../../lib/utils'

import AccountLink from '../shared/AccountLink'
import JSONButton from '../shared/JSONButton'
// import JSONButton from '../shared/JSONButton'
import TimeSynchronisedFormattedRelative from '../shared/TimeSynchronizedFormattedRelative'
import TransactionHash from '../shared/TransactionHash'
import OperationType from '../shared/OperationType'
Expand Down Expand Up @@ -79,6 +79,7 @@ const Operation = ({compact, op, opURLFn, parentRenderTimestamp}) => {
<td className="account-badge">{acc}</td>
<td>
<SubOperation op={op} />

</td>
{compact === false && (
<td class = "block-column">
Expand All @@ -96,8 +97,9 @@ const Operation = ({compact, op, opURLFn, parentRenderTimestamp}) => {
<td >
<span title={op.time}>
<TimeSynchronisedFormattedRelative
initialNow={parentRenderTimestamp}
value={op.time}
// initialNow={parentRenderTimestamp}
time={op.time}
hash={op.transactionHash}
/>
</span>
</td>
Expand Down
26 changes: 22 additions & 4 deletions src/components/shared/TimeSynchronizedFormattedRelative.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,26 @@ import {FormattedRelative} from 'react-intl'
* This version allows synchronisation of multiple FormattedRelative time
* components that were created at various times to a single baseline now value.
*/
export default class extends FormattedRelative {
componentWillReceiveProps({initialNow: nextNow}) {
this.setState({now: nextNow})
}
// export default class extends FormattedRelative {
// componentWillReceiveProps({initialNow: nextNow}) {
// this.setState({now: nextNow})
// }
// }
import React from 'react'
import PropTypes from 'prop-types'
import {Link} from 'react-router-dom'

const TimeSynchronizedFormattedRelative = ({hash,time}) => {
return (
<span title={hash}>
{ hash ? <Link to={`/tx/${hash}`} ><FormattedRelative value={time} /></Link>
: <FormattedRelative value={time} />}
</span>
)
}

TimeSynchronizedFormattedRelative.propTypes = {
hash: PropTypes.string,
time: PropTypes.string,
}
export default TimeSynchronizedFormattedRelative

0 comments on commit eb839a0

Please sign in to comment.