mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 06:52:41 +01:00
fix: remove components/LNNodeBar, fix lint errors
This commit is contained in:
parent
7b87199ca4
commit
b8f5cad12b
3 changed files with 2 additions and 103 deletions
|
@ -1,94 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { StyleSheet, Text, View } from 'react-native';
|
|
||||||
|
|
||||||
import loc, { formatBalanceWithoutSuffix } from '../loc';
|
|
||||||
import { BitcoinUnit } from '../models/bitcoinUnits';
|
|
||||||
import { useTheme } from './themes';
|
|
||||||
|
|
||||||
interface LNNodeBarProps {
|
|
||||||
canReceive: number;
|
|
||||||
canSend: number;
|
|
||||||
nodeAlias?: string;
|
|
||||||
disabled?: boolean;
|
|
||||||
itemPriceUnit?: BitcoinUnit;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const LNNodeBar: React.FC<LNNodeBarProps> = ({
|
|
||||||
canReceive = 0,
|
|
||||||
canSend = 0,
|
|
||||||
nodeAlias = '',
|
|
||||||
disabled = false,
|
|
||||||
itemPriceUnit = BitcoinUnit.SATS,
|
|
||||||
}) => {
|
|
||||||
const { colors } = useTheme();
|
|
||||||
const opacity = { opacity: disabled ? 0.5 : 1.0 };
|
|
||||||
const canSendBarFlex = {
|
|
||||||
flex: canReceive > 0 && canSend > 0 ? Math.abs(canSend / (canReceive + canSend)) * 1.0 : 1.0,
|
|
||||||
};
|
|
||||||
const stylesHook = StyleSheet.create({
|
|
||||||
nodeAlias: {
|
|
||||||
color: colors.alternativeTextColor2,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return (
|
|
||||||
<View style={[styles.root, opacity]}>
|
|
||||||
{nodeAlias.trim().length > 0 && <Text style={[styles.nodeAlias, stylesHook.nodeAlias]}>{nodeAlias}</Text>}
|
|
||||||
<View style={styles.canReceiveBar}>
|
|
||||||
<View style={styles.fullFlexDirectionRow}>
|
|
||||||
<View style={[styles.canSendBar, canSendBarFlex]} />
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<View style={styles.containerBottomText}>
|
|
||||||
<View style={styles.containerBottomRightText}>
|
|
||||||
<Text style={styles.titleText}>{loc.lnd.can_send.toUpperCase()}</Text>
|
|
||||||
<Text style={styles.canSend}>{formatBalanceWithoutSuffix(canSend, itemPriceUnit, true).toString()}</Text>
|
|
||||||
</View>
|
|
||||||
<View style={styles.containerBottomLeftText}>
|
|
||||||
<Text style={styles.titleText}>{loc.lnd.can_receive.toUpperCase()}</Text>
|
|
||||||
<Text style={styles.canReceive}>{formatBalanceWithoutSuffix(canReceive, itemPriceUnit, true).toString()}</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default LNNodeBar;
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
root: {
|
|
||||||
flex: 1,
|
|
||||||
},
|
|
||||||
containerBottomText: {
|
|
||||||
flexDirection: 'row',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
marginTop: 16,
|
|
||||||
},
|
|
||||||
nodeAlias: {
|
|
||||||
marginVertical: 16,
|
|
||||||
},
|
|
||||||
canSendBar: {
|
|
||||||
height: 14,
|
|
||||||
maxHeight: 14,
|
|
||||||
backgroundColor: '#4E6CF5',
|
|
||||||
borderRadius: 6,
|
|
||||||
},
|
|
||||||
canReceiveBar: { backgroundColor: '#57B996', borderRadius: 6, height: 14, maxHeight: 14 },
|
|
||||||
fullFlexDirectionRow: {
|
|
||||||
flexDirection: 'row',
|
|
||||||
flex: 1,
|
|
||||||
},
|
|
||||||
containerBottomLeftText: {},
|
|
||||||
containerBottomRightText: {},
|
|
||||||
titleText: {
|
|
||||||
color: '#9AA0AA',
|
|
||||||
},
|
|
||||||
canReceive: {
|
|
||||||
color: '#57B996',
|
|
||||||
textAlign: 'right',
|
|
||||||
},
|
|
||||||
canSend: {
|
|
||||||
color: '#4E6CF5',
|
|
||||||
textAlign: 'left',
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -19,13 +19,7 @@ import {
|
||||||
import A from '../../blue_modules/analytics';
|
import A from '../../blue_modules/analytics';
|
||||||
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
|
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
|
||||||
import { BlueButtonLink, BlueFormLabel, BlueSpacing20, BlueSpacing40, BlueText } from '../../BlueComponents';
|
import { BlueButtonLink, BlueFormLabel, BlueSpacing20, BlueSpacing40, BlueText } from '../../BlueComponents';
|
||||||
import {
|
import { BlueApp, HDSegwitBech32Wallet, HDSegwitP2SHWallet, LightningCustodianWallet, SegwitP2SHWallet } from '../../class';
|
||||||
BlueApp,
|
|
||||||
HDSegwitBech32Wallet,
|
|
||||||
HDSegwitP2SHWallet,
|
|
||||||
LightningCustodianWallet,
|
|
||||||
SegwitP2SHWallet,
|
|
||||||
} from '../../class';
|
|
||||||
import presentAlert from '../../components/Alert';
|
import presentAlert from '../../components/Alert';
|
||||||
import Button from '../../components/Button';
|
import Button from '../../components/Button';
|
||||||
import ListItem from '../../components/ListItem';
|
import ListItem from '../../components/ListItem';
|
||||||
|
@ -120,7 +114,7 @@ const WalletsAdd: React.FC = () => {
|
||||||
const entropyButtonText = state.entropyButtonText;
|
const entropyButtonText = state.entropyButtonText;
|
||||||
//
|
//
|
||||||
const colorScheme = useColorScheme();
|
const colorScheme = useColorScheme();
|
||||||
const { addWallet, saveToDisk, wallets } = useStorage();
|
const { addWallet, saveToDisk } = useStorage();
|
||||||
const { isAdvancedModeEnabled } = useSettings();
|
const { isAdvancedModeEnabled } = useSettings();
|
||||||
const { navigate, goBack, setOptions } = useNavigation();
|
const { navigate, goBack, setOptions } = useNavigation();
|
||||||
const stylesHook = {
|
const stylesHook = {
|
||||||
|
|
|
@ -28,7 +28,6 @@ import { LightningCustodianWallet, MultisigHDWallet, WatchOnlyWallet } from '../
|
||||||
import WalletGradient from '../../class/wallet-gradient';
|
import WalletGradient from '../../class/wallet-gradient';
|
||||||
import presentAlert, { AlertType } from '../../components/Alert';
|
import presentAlert, { AlertType } from '../../components/Alert';
|
||||||
import { FButton, FContainer } from '../../components/FloatButtons';
|
import { FButton, FContainer } from '../../components/FloatButtons';
|
||||||
import LNNodeBar from '../../components/LNNodeBar';
|
|
||||||
import navigationStyle from '../../components/navigationStyle';
|
import navigationStyle from '../../components/navigationStyle';
|
||||||
import { useTheme } from '../../components/themes';
|
import { useTheme } from '../../components/themes';
|
||||||
import { TransactionListItem } from '../../components/TransactionListItem';
|
import { TransactionListItem } from '../../components/TransactionListItem';
|
||||||
|
|
Loading…
Add table
Reference in a new issue