BlueWallet/class/wallet-gradient.js

147 lines
5.2 KiB
JavaScript
Raw Normal View History

import { LegacyWallet } from './wallets/legacy-wallet';
import { HDSegwitP2SHWallet } from './wallets/hd-segwit-p2sh-wallet';
import { LightningCustodianWallet } from './wallets/lightning-custodian-wallet';
import { HDLegacyBreadwalletWallet } from './wallets/hd-legacy-breadwallet-wallet';
import { HDLegacyP2PKHWallet } from './wallets/hd-legacy-p2pkh-wallet';
import { WatchOnlyWallet } from './wallets/watch-only-wallet';
import { HDSegwitBech32Wallet } from './wallets/hd-segwit-bech32-wallet';
import { SegwitBech32Wallet } from './wallets/segwit-bech32-wallet';
import { HDLegacyElectrumSeedP2PKHWallet } from './wallets/hd-legacy-electrum-seed-p2pkh-wallet';
import { HDSegwitElectrumSeedP2WPKHWallet } from './wallets/hd-segwit-electrum-seed-p2wpkh-wallet';
2020-10-05 23:25:14 +02:00
import { MultisigHDWallet } from './wallets/multisig-hd-wallet';
import { HDAezeedWallet } from './wallets/hd-aezeed-wallet';
2021-09-09 13:00:11 +02:00
import { LightningLdkWallet } from './wallets/lightning-ldk-wallet';
import { SLIP39LegacyP2PKHWallet, SLIP39SegwitP2SHWallet, SLIP39SegwitBech32Wallet } from './wallets/slip39-wallets';
import { useTheme } from '@react-navigation/native';
2019-01-25 05:46:03 +01:00
export default class WalletGradient {
2021-03-12 15:39:40 +01:00
static hdSegwitP2SHWallet = ['#007AFF', '#0040FF'];
2021-03-15 11:56:35 +01:00
static hdSegwitBech32Wallet = ['#6CD9FC', '#44BEE5'];
static segwitBech32Wallet = ['#6CD9FC', '#44BEE5'];
2021-03-12 15:39:40 +01:00
static watchOnlyWallet = ['#474646', '#282828'];
static legacyWallet = ['#37E8C0', '#15BE98'];
static hdLegacyP2PKHWallet = ['#FD7478', '#E73B40'];
2019-01-25 05:46:03 +01:00
static hdLegacyBreadWallet = ['#fe6381', '#f99c42'];
2020-10-05 23:25:14 +02:00
static multisigHdWallet = ['#1ce6eb', '#296fc5', '#3500A2'];
2021-03-12 15:39:40 +01:00
static defaultGradients = ['#B770F6', '#9013FE'];
static lightningCustodianWallet = ['#F1AA07', '#FD7E37'];
static aezeedWallet = ['#8584FF', '#5351FB'];
2021-09-09 13:00:11 +02:00
static ldkWallet = ['#8584FF', '#5351FB'];
static createWallet = () => {
const { colors } = useTheme();
return colors.lightButton;
};
2019-01-25 05:46:03 +01:00
static gradientsFor(type) {
let gradient;
switch (type) {
case WatchOnlyWallet.type:
gradient = WalletGradient.watchOnlyWallet;
break;
case LegacyWallet.type:
gradient = WalletGradient.legacyWallet;
break;
case HDLegacyP2PKHWallet.type:
case HDLegacyElectrumSeedP2PKHWallet.type:
case SLIP39LegacyP2PKHWallet.type:
2019-01-25 05:46:03 +01:00
gradient = WalletGradient.hdLegacyP2PKHWallet;
break;
case HDLegacyBreadwalletWallet.type:
gradient = WalletGradient.hdLegacyBreadWallet;
break;
case HDSegwitP2SHWallet.type:
case SLIP39SegwitP2SHWallet.type:
2019-01-25 05:46:03 +01:00
gradient = WalletGradient.hdSegwitP2SHWallet;
break;
2019-06-01 22:44:39 +02:00
case HDSegwitBech32Wallet.type:
case HDSegwitElectrumSeedP2WPKHWallet.type:
case SLIP39SegwitBech32Wallet.type:
2019-06-01 22:44:39 +02:00
gradient = WalletGradient.hdSegwitBech32Wallet;
break;
2019-01-25 05:46:03 +01:00
case LightningCustodianWallet.type:
gradient = WalletGradient.lightningCustodianWallet;
break;
case SegwitBech32Wallet.type:
gradient = WalletGradient.segwitBech32Wallet;
break;
2020-10-05 23:25:14 +02:00
case MultisigHDWallet.type:
gradient = WalletGradient.multisigHdWallet;
break;
case HDAezeedWallet.type:
gradient = WalletGradient.aezeedWallet;
break;
2021-09-09 13:00:11 +02:00
case LightningLdkWallet.type:
gradient = WalletGradient.ldkWallet;
break;
2019-01-25 05:46:03 +01:00
default:
gradient = WalletGradient.defaultGradients;
break;
}
return gradient;
}
2020-12-11 18:35:47 +01:00
static linearGradientProps(type) {
let props;
switch (type) {
case MultisigHDWallet.type:
/* Example
2020-12-11 18:35:47 +01:00
props = { start: { x: 0, y: 0 } };
https://github.com/react-native-linear-gradient/react-native-linear-gradient
*/
break;
default:
break;
}
return props;
}
2019-01-25 05:46:03 +01:00
static headerColorFor(type) {
let gradient;
switch (type) {
case WatchOnlyWallet.type:
gradient = WalletGradient.watchOnlyWallet;
break;
case LegacyWallet.type:
gradient = WalletGradient.legacyWallet;
break;
case HDLegacyP2PKHWallet.type:
case HDLegacyElectrumSeedP2PKHWallet.type:
case SLIP39LegacyP2PKHWallet.type:
2019-01-25 05:46:03 +01:00
gradient = WalletGradient.hdLegacyP2PKHWallet;
break;
case HDLegacyBreadwalletWallet.type:
gradient = WalletGradient.hdLegacyBreadWallet;
break;
case HDSegwitP2SHWallet.type:
case SLIP39SegwitP2SHWallet.type:
2019-01-25 05:46:03 +01:00
gradient = WalletGradient.hdSegwitP2SHWallet;
break;
2019-06-01 22:44:39 +02:00
case HDSegwitBech32Wallet.type:
case HDSegwitElectrumSeedP2WPKHWallet.type:
case SLIP39SegwitBech32Wallet.type:
2019-06-01 22:44:39 +02:00
gradient = WalletGradient.hdSegwitBech32Wallet;
break;
case SegwitBech32Wallet.type:
gradient = WalletGradient.segwitBech32Wallet;
break;
2020-10-05 23:25:14 +02:00
case MultisigHDWallet.type:
gradient = WalletGradient.multisigHdWallet;
break;
2019-01-25 05:46:03 +01:00
case LightningCustodianWallet.type:
gradient = WalletGradient.lightningCustodianWallet;
break;
case HDAezeedWallet.type:
gradient = WalletGradient.aezeedWallet;
break;
2021-09-09 13:00:11 +02:00
case LightningLdkWallet.type:
gradient = WalletGradient.ldkWallet;
break;
2019-01-25 05:46:03 +01:00
default:
gradient = WalletGradient.defaultGradients;
break;
}
return gradient[0];
}
}