Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit

Permalink
feat: show correct network next to logo (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 authored Feb 22, 2019
1 parent 0144049 commit 7c522b4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ REACT_APP_BITCOIN_LND=027d947995af79c33de8efcbb9ba02a2a425d40c8e7380bbdd5025c006
REACT_APP_LITECOIN_LND=022a73335e9511ee093ab0a741ade3244f7fb98bbf18a4cf17bb7a4f217ab58c48@35.237.24.136:10735

# Network configurations
REACT_APP_BITCOIN_NETWORK=bitcoinSimnet
REACT_APP_LITECOIN_NETWORK=litecoinSimnet
REACT_APP_NETWORK=simnet

REACT_APP_BITCOIN_EXPLORER=https://blockstream.info/testnet/tx
REACT_APP_LITECOIN_EXPLORER=https://chain.so/tx/LTCTEST
Expand Down
4 changes: 3 additions & 1 deletion src/components/taskbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import injectSheet from 'react-jss';
import View from '../view';
import { LinkButton } from '../button';
import { network } from '../../constants';

const boltz_logo = require('../../asset/icons/boltz_logo.png');

Expand Down Expand Up @@ -38,6 +39,7 @@ const styles = theme => ({
color: theme.colors.white,
fontSize: '15px',
fontWeight: '100',
textTransform: 'uppercase',
},
});

Expand All @@ -52,7 +54,7 @@ const TaskBar = ({ classes, goHome, goRefund, goFaq }) => (
alt="logo"
/>
<span className={classes.logoText}>Boltz</span>
<span className={classes.subLogoText}>TESTNET ALPHA</span>
<span className={classes.subLogoText}>{network} alpha</span>
</View>
<View className={classes.buttons}>
<LinkButton text="Swap" onPress={() => goHome()} />
Expand Down
12 changes: 10 additions & 2 deletions src/constants/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Networks } from 'boltz-core';

const capitalizeFirstLetter = input => {
return input.charAt(0).toUpperCase() + input.slice(1);
};

// API endpoint
export const boltzApi = process.env.REACT_APP_BOLTZ_API;

Expand All @@ -8,8 +12,12 @@ export const bitcoinLnd = process.env.REACT_APP_BITCOIN_LND;
export const litecoinLnd = process.env.REACT_APP_LITECOIN_LND;

// Network configurations
export const bitcoinNetwork = Networks[process.env.REACT_APP_BITCOIN_NETWORK];
export const litecoinNetwork = Networks[process.env.REACT_APP_LITECOIN_NETWORK];
export const network = process.env.REACT_APP_NETWORK;

export const bitcoinNetwork =
Networks[`bitcoin${capitalizeFirstLetter(network)}`];
export const litecoinNetwork =
Networks[`litecoin${capitalizeFirstLetter(network)}`];

export const bitcoinExplorer = process.env.REACT_APP_BITCOIN_EXPLORER;
export const litecoinExplorer = process.env.REACT_APP_LITECOIN_EXPLORER;
Expand Down

0 comments on commit 7c522b4

Please sign in to comment.