Skip to content

Commit

Permalink
transaction unit url added
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielLaanpere committed Jul 13, 2020
1 parent 971b03c commit d48a9e1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/screens/TransactionInfoScreen/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from 'react';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { View, Text } from 'react-native';
import { Container, Content } from 'native-base';
import { View, Text, Linking } from 'react-native';
import { Content } from 'native-base';
import _ from 'lodash';
import Moment from 'react-moment';
import SafeAreaView from 'react-native-safe-area-view';

import { common } from '../../constants';
import Header from '../../components/Header';
import { selectExchangeRates } from './../../selectors/exchangeRates';
import { bytesToUnit } from './../../lib/utils';
Expand All @@ -25,6 +26,10 @@ class TransactionInfoScreen extends React.Component {
bytesToUnit(transaction.amount, 'GB') * this.props.exchangeRates.GBYTE_USD
).toFixed(2);

var explorerUrl = `https://${
common.network === 'testnet' ? 'testnet' : ''
}explorer.obyte.org/#${transaction.unitId}`;

return (
<SafeAreaView style={styles.container}>
<Header
Expand Down Expand Up @@ -84,6 +89,7 @@ class TransactionInfoScreen extends React.Component {
<Text style={styles.infoRowLabel}>ID:</Text>
<Text
style={{ ...styles.infoRowValue, ...styles.infoRowValueHL }}
onPress={() => Linking.openURL(explorerUrl)}
>
{transaction.unitId}
</Text>
Expand Down

0 comments on commit d48a9e1

Please sign in to comment.