Skip to content

Commit

Permalink
Migrated WalletSliderEntry component to TypeScript.
Browse files Browse the repository at this point in the history
Removed MnemonicCarousel & MnemonicSliderEntry components.
Updated WalletSliderEntry props in _renderItem in WalletCarousel component.
Updated onCoinPress & createNewWallet in App.js.
Updated README.md.
  • Loading branch information
coreyphillips committed Aug 17, 2019
1 parent 526da3e commit 69bfca1
Show file tree
Hide file tree
Showing 8 changed files with 303 additions and 571 deletions.
12 changes: 6 additions & 6 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ export default class App extends Component {
//}
};

onCoinPress = async ({ coin = "bitcoin", wallet = "wallet0", initialLoadingMessage = "" } = {}) => {
onCoinPress = async ({ coin = "bitcoin", walletId = "wallet0", initialLoadingMessage = "" } = {}) => {
try {
const sameCoin = this.props.wallet.selectedCrypto === coin;
const sameWallet = this.props.wallet.selectedWallet === wallet;
const sameWallet = this.props.wallet.selectedWallet === walletId;
if (sameCoin && sameWallet) {
this.resetView();
return;
Expand All @@ -166,9 +166,9 @@ export default class App extends Component {
this.updateItem({ stateId: "displaySelectCoin", opacityId: "selectCoinOpacity", display: false, duration: 200 });

const network = getNetworkType(coin);
await this.props.updateWallet({ selectedCrypto: coin, network, selectedWallet: wallet });
await this.props.updateWallet({ selectedCrypto: coin, network, selectedWallet: walletId });

if (this.props.wallet.wallets[wallet].addresses[coin].length > 0) {
if (this.props.wallet.wallets[walletId].addresses[coin].length > 0) {
//This condition occurs when the user selects a coin that already has generated addresses from the "SelectCoin" view.
this.updateItem({ stateId: "displayLoading", opacityId: "loadingOpacity", display: false });
this.resetView();
Expand All @@ -177,7 +177,7 @@ export default class App extends Component {
if (initialLoadingMessage) {
this.setState({ loadingMessage: initialLoadingMessage, loadingProgress: 0.3, loadingAnimationName: coin });
} else {
this.setState({ loadingMessage: `Switching to ${capitalize(coin)} for Wallet ${this.props.wallet.wallets[wallet].name || Object.keys(this.props.wallet.wallets).indexOf(wallet)}`, loadingProgress: 0.3, loadingAnimationName: coin });
this.setState({ loadingMessage: `Switching to ${capitalize(coin)} for Wallet ${this.props.wallet.wallets[walletId].name || Object.keys(this.props.wallet.wallets).indexOf(walletId)}`, loadingProgress: 0.3, loadingAnimationName: coin });
}
this.updateItem({ stateId: "displayLoading", opacityId: "loadingOpacity", display: true });
InteractionManager.runAfterInteractions(async () => {
Expand Down Expand Up @@ -1390,7 +1390,7 @@ export default class App extends Component {
//Add wallet name to wallets array;
const walletName = await uuidv4();
//Set Loading Message
await this.setState({loadingMessage: `Creating Wallet ${Object.keys(this.props.wallet.wallets).length + 1} & Generating Addresses`, loadingProgress: 0.5});
await this.setState({loadingMessage: `Creating Wallet ${Object.keys(this.props.wallet.wallets).length} & Generating Addresses`, loadingProgress: 0.5});

//Close Receive State
const items = [
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Bitbip
Bitbip's alpha is available for testing on [iOS](https://testflight.apple.com/join/yTLqj9Xn) & [Android](https://play.google.com/store/apps/details?id=com.kisswallet)

<p style="align-items: center">
<img src="./src/assets/screenshots/send_transaction.png" width="33%" alt="Send Transaction" />
Expand All @@ -19,11 +20,6 @@ As with any hot wallet, please ensure that you keep only a small, responsible am

If you are looking for secure cold storage solutions please consider purchasing a [Trezor](https://wallet.trezor.io) or a [Ledger](https://www.ledger.com/)

Bitbip's Alpha is available for download here:

* [iOS](https://testflight.apple.com/join/yTLqj9Xn)
* [Android](https://play.google.com/store/apps/details?id=com.kisswallet)

## Installation
#### Without LND:
1. LND isn't fully implemented in this app yet so if you do not wish to use Lightning or go through the process of generating any .aar & .framework files you can simply checkout the commit prior to the LND implementation and run the project like so:
Expand Down
14 changes: 9 additions & 5 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ interface HeaderComponent {
const _Header = ({fiatSymbol = "$", selectedCrypto = "bitcoin", selectedWallet = "wallet0", onSelectCoinPress = () => null, isOnline = true, exchangeRate = 0, displayWalletName = false, selectedCryptoStyle = {}, activeOpacity = 0.6, fontSize = 60, fiatValue = 0, cryptoValue = 0, cryptoUnit = "satoshi"}: HeaderComponent) => {
try {
if (isNaN(fiatValue)) fiatValue = 0;
//This prevents the view from displaying 0 BTC
if (cryptoValue < 50000 && cryptoUnit === "BTC") {
if (typeof cryptoValue !== "number") cryptoValue = Number(cryptoValue);
cryptoValue = `${(cryptoValue * 0.00000001).toFixed(8)}`;
if (cryptoValue === 0 && cryptoUnit === "BTC") {
cryptoValue = 0;
} else {
cryptoValue = bitcoinUnits(cryptoValue, "satoshi").to(cryptoUnit).value();
//This prevents the view from displaying 0 for values less than 50000 BTC
if (cryptoValue < 50000 && cryptoUnit === "BTC") {
if (typeof cryptoValue !== "number") cryptoValue = Number(cryptoValue);
cryptoValue = `${(cryptoValue * 0.00000001).toFixed(8)}`;
} else {
cryptoValue = bitcoinUnits(cryptoValue, "satoshi").to(cryptoUnit).value();
}
}
} catch (e) {}

Expand Down
144 changes: 0 additions & 144 deletions src/components/MnemonicCarousel.js

This file was deleted.

116 changes: 0 additions & 116 deletions src/components/MnemonicSliderEntry.js

This file was deleted.

Loading

0 comments on commit 69bfca1

Please sign in to comment.