diff --git a/App.js b/App.js
index f96672986..74e1bf46c 100644
--- a/App.js
+++ b/App.js
@@ -3,18 +3,20 @@ import React from 'react';
import { Linking, Appearance, DeviceEventEmitter, AppState, StyleSheet, KeyboardAvoidingView, Platform, View } from 'react-native';
import Clipboard from '@react-native-community/clipboard';
import Modal from 'react-native-modal';
-import { NavigationContainer, CommonActions, DefaultTheme, DarkTheme } from '@react-navigation/native';
+import { NavigationContainer, CommonActions } from '@react-navigation/native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import Navigation from './Navigation';
import { navigationRef } from './NavigationService';
import * as NavigationService from './NavigationService';
-import { BlueTextCentered, BlueButton } from './BlueComponents';
+import { BlueTextCentered, BlueButton, SecondButton } from './BlueComponents';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { Chain } from './models/bitcoinUnits';
import QuickActions from 'react-native-quick-actions';
import * as Sentry from '@sentry/react-native';
import OnAppLaunch from './class/on-app-launch';
import DeeplinkSchemaMatch from './class/deeplink-schema-match';
+import { BlueDefaultTheme, BlueDarkTheme, BlueCurrentTheme } from './components/themes';
+
const A = require('./blue_modules/analytics');
if (process.env.NODE_ENV !== 'development') {
@@ -35,12 +37,21 @@ export default class App extends React.Component {
isClipboardContentModalVisible: false,
clipboardContentModalAddressType: bitcoinModalString,
clipboardContent: '',
+ theme: Appearance.getColorScheme(),
};
componentDidMount() {
EV(EV.enum.WALLETS_INITIALIZED, this.addListeners);
+ Appearance.addChangeListener(this.appearanceChanged);
}
+ appearanceChanged = () => {
+ const appearance = Appearance.getColorScheme();
+ if (appearance) {
+ this.setState({ theme: appearance });
+ }
+ };
+
addListeners = () => {
Linking.addEventListener('url', this.handleOpenURL);
AppState.addEventListener('change', this._handleAppStateChange);
@@ -104,6 +115,7 @@ export default class App extends React.Component {
componentWillUnmount() {
Linking.removeEventListener('url', this.handleOpenURL);
AppState.removeEventListener('change', this._handleAppStateChange);
+ Appearance.removeChangeListener(this.appearanceChanged);
}
_handleAppStateChange = async nextAppState => {
@@ -192,7 +204,7 @@ export default class App extends React.Component {
You have a {this.state.clipboardContentModalAddressType} on your clipboard. Would you like to use it for a transaction?
- this.setState({ isClipboardContentModalVisible: false })}
@@ -219,7 +231,7 @@ export default class App extends React.Component {
return (
-
+
{this.renderClipboardContentModal()}
@@ -237,7 +249,7 @@ const styles = StyleSheet.create({
marginHorizontal: 8,
},
modalContent: {
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.elevated,
padding: 22,
justifyContent: 'center',
alignItems: 'center',
diff --git a/BlueComponents.js b/BlueComponents.js
index 2ac0d037a..8ba9d71f2 100644
--- a/BlueComponents.js
+++ b/BlueComponents.js
@@ -36,6 +36,8 @@ import NetworkTransactionFees, { NetworkTransactionFeeType } from './models/netw
import Biometric from './class/biometrics';
import { encodeUR } from 'bc-ur/dist';
import QRCode from 'react-native-qrcode-svg';
+import { useTheme } from '@react-navigation/native';
+import { BlueCurrentTheme } from './components/themes';
const loc = require('./loc/');
/** @type {AppStorage} */
const BlueApp = require('./BlueApp');
@@ -52,11 +54,49 @@ if (aspectRatio > 1.6) {
export class BlueButton extends Component {
render() {
- let backgroundColor = this.props.backgroundColor ? this.props.backgroundColor : BlueApp.settings.buttonBackgroundColor;
- let fontColor = BlueApp.settings.buttonTextColor;
+ let backgroundColor = this.props.backgroundColor ? this.props.backgroundColor : BlueCurrentTheme.colors.mainColor;
+ let fontColor = BlueCurrentTheme.colors.buttonTextColor;
if (this.props.disabled === true) {
- backgroundColor = BlueApp.settings.buttonDisabledBackgroundColor;
- fontColor = BlueApp.settings.buttonDisabledTextColor;
+ backgroundColor = BlueCurrentTheme.colors.buttonDisabledBackgroundColor;
+ fontColor = BlueCurrentTheme.colors.buttonDisabledTextColor;
+ }
+ let buttonWidth = this.props.width ? this.props.width : width / 1.5;
+ if ('noMinWidth' in this.props) {
+ buttonWidth = 0;
+ }
+ return (
+
+
+ {this.props.icon && }
+ {this.props.title && {this.props.title}}
+
+
+ );
+ }
+}
+
+export class SecondButton extends Component {
+ render() {
+ let backgroundColor = this.props.backgroundColor ? this.props.backgroundColor : BlueCurrentTheme.colors.buttonBlueBackgroundColor;
+ let fontColor = BlueCurrentTheme.colors.buttonTextColor;
+ if (this.props.disabled === true) {
+ backgroundColor = BlueCurrentTheme.colors.buttonDisabledBackgroundColor;
+ fontColor = BlueCurrentTheme.colors.buttonDisabledTextColor;
}
let buttonWidth = this.props.width ? this.props.width : width / 1.5;
if ('noMinWidth' in this.props) {
@@ -99,10 +139,10 @@ export class BitcoinButton extends Component {
>
- {loc.wallets.add.bitcoin}
+ {loc.wallets.add.bitcoin}
- {loc.wallets.add.lightning}
+ {loc.wallets.add.lightning}
{
+ const { colors } = useTheme();
+ return (
+
+ {title}
+
+ );
+};
+
export class BlueButtonLink extends Component {
render() {
return (
@@ -368,7 +425,7 @@ export class BlueButtonLink extends Component {
}}
{...this.props}
>
- {this.props.title}
+ {this.props.title}
);
}
@@ -391,6 +448,7 @@ export const BlueAlertWalletExportReminder = ({ onSuccess = () => {}, onFailure
export const BlueNavigationStyle = (navigation, withNavigationCloseButton = false, customCloseButtonFunction = undefined) => {
let headerRight;
+ const { colors, closeImage } = useTheme();
if (withNavigationCloseButton) {
headerRight = () => (
-
+
);
} else {
@@ -413,7 +471,6 @@ export const BlueNavigationStyle = (navigation, withNavigationCloseButton = fals
return {
headerStyle: {
- backgroundColor: BlueApp.settings.brandingColor,
borderBottomWidth: 0,
elevation: 0,
shadowOpacity: 0,
@@ -421,12 +478,11 @@ export const BlueNavigationStyle = (navigation, withNavigationCloseButton = fals
},
headerTitleStyle: {
fontWeight: '600',
- color: BlueApp.settings.foregroundColor,
+ color: colors.foregroundColor,
},
headerRight,
- headerTintColor: BlueApp.settings.foregroundColor,
- // headerBackTitle: null,
headerBackTitleVisible: false,
+ headerTintColor: colors.foregroundColor,
};
};
@@ -434,8 +490,8 @@ export const BlueCreateTxNavigationStyle = (navigation, withAdvancedOptionsMenuB
let headerRight;
if (withAdvancedOptionsMenuButton) {
headerRight = () => (
-
-
+
+
);
} else {
@@ -443,25 +499,24 @@ export const BlueCreateTxNavigationStyle = (navigation, withAdvancedOptionsMenuB
}
return {
headerStyle: {
- backgroundColor: BlueApp.settings.brandingColor,
borderBottomWidth: 0,
elevation: 0,
shadowOffset: { height: 0, width: 0 },
},
headerTitleStyle: {
fontWeight: '600',
- color: BlueApp.settings.foregroundColor,
+ color: BlueCurrentTheme.colors.foregroundColor,
},
- headerTintColor: BlueApp.settings.foregroundColor,
+ headerTintColor: BlueCurrentTheme.colors.foregroundColor,
headerLeft: () => (
{
Keyboard.dismiss();
navigation.goBack(null);
}}
>
-
+
),
headerRight,
@@ -556,9 +611,9 @@ export class SafeBlueArea extends Component {
render() {
return (
);
}
@@ -575,7 +630,7 @@ export class BlueText extends Component {
return (
{
+ const { colors } = useTheme();
+ return (
+
+ );
+};
export class BlueTextCentered extends Component {
render() {
- return ;
+ return ;
}
}
@@ -595,16 +663,16 @@ export const BlueListItem = React.memo(props => (
bottomDivider
containerStyle={{
backgroundColor: 'transparent',
- borderBottomColor: '#ededed',
+ borderBottomColor: BlueCurrentTheme.colors.lightBorder,
paddingTop: 16,
paddingBottom: 16,
}}
titleStyle={{
- color: props.disabled ? BlueApp.settings.buttonDisabledTextColor : BlueApp.settings.foregroundColor,
+ color: props.disabled ? BlueCurrentTheme.colors.buttonDisabledTextColor : BlueCurrentTheme.colors.foregroundColor,
fontSize: 16,
fontWeight: '500',
}}
- subtitleStyle={{ flexWrap: 'wrap', color: BlueApp.settings.alternativeTextColor, fontWeight: '400', fontSize: 14 }}
+ subtitleStyle={{ flexWrap: 'wrap', color: BlueCurrentTheme.colors.alternativeTextColor, fontWeight: '400', fontSize: 14 }}
subtitleNumberOfLines={1}
titleNumberOfLines={0}
Component={TouchableOpacity}
@@ -612,9 +680,36 @@ export const BlueListItem = React.memo(props => (
/>
));
+export const BlueListItemHooks = props => {
+ const { colors } = useTheme();
+ return (
+
+ );
+};
+
export class BlueFormLabel extends Component {
render() {
- return ;
+ return ;
}
}
@@ -623,14 +718,14 @@ export class BlueFormInput extends Component {
return (
);
@@ -652,15 +747,18 @@ export class BlueFormMultiInput extends Component {
underlineColorAndroid="transparent"
numberOfLines={4}
style={{
+ paddingHorizontal: 8,
+ paddingVertical: 16,
flex: 1,
marginTop: 5,
marginHorizontal: 20,
- borderColor: BlueApp.settings.inputBorderColor,
- borderBottomColor: BlueApp.settings.inputBorderColor,
- borderWidth: 0.5,
+ borderColor: BlueCurrentTheme.colors.formBorder,
+ borderBottomColor: BlueCurrentTheme.colors.formBorder,
+ borderWidth: 1,
borderBottomWidth: 0.5,
- backgroundColor: BlueApp.settings.inputBackgroundColor,
- color: BlueApp.settings.foregroundColor,
+ borderRadius: 4,
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
+ color: BlueCurrentTheme.colors.foregroundColor,
}}
autoCorrect={false}
autoCapitalize="none"
@@ -691,9 +789,9 @@ export class BlueHeader extends Component {
export class BlueHeaderDefaultSub extends Component {
render() {
return (
-
+
{this.props.leftText}
@@ -731,10 +829,40 @@ export class BlueHeaderDefaultSub extends Component {
}
}
+export const BlueHeaderDefaultSubHooks = props => {
+ const { colors } = useTheme();
+
+ return (
+
+
+ }
+ {...props}
+ />
+
+ );
+};
+
export class BlueHeaderDefaultMain extends Component {
render() {
return (
-
+
;
+ return ;
}
}
export class BlueSpacing40 extends Component {
render() {
- return ;
+ return ;
}
}
@@ -840,13 +970,13 @@ export class BlueUseAllFundsButton extends Component {
maxHeight: 44,
justifyContent: 'space-between',
alignItems: 'center',
- backgroundColor: '#eef0f4',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
}}
>
-
-
-
-
+
+
+
);
}
}
+export const BlueLoadingHook = () => {
+ const { colors } = useTheme();
+ return (
+
+
+
+ );
+};
+
const stylesBlueIcon = StyleSheet.create({
container: {
flex: 1,
@@ -988,13 +1125,13 @@ const stylesBlueIcon = StyleSheet.create({
width: 30,
height: 30,
borderRadius: 15,
- backgroundColor: '#ccddf9',
+ backgroundColor: BlueCurrentTheme.colors.buttonBackgroundColor,
},
ballIncoming: {
width: 30,
height: 30,
borderRadius: 15,
- backgroundColor: '#d2f8d6',
+ backgroundColor: BlueCurrentTheme.colors.ballReceive,
transform: [{ rotate: '-45deg' }],
justifyContent: 'center',
},
@@ -1002,20 +1139,20 @@ const stylesBlueIcon = StyleSheet.create({
width: 30,
height: 30,
borderRadius: 15,
- backgroundColor: '#d2f8d6',
+ backgroundColor: BlueCurrentTheme.colors.ballReceive,
},
ballReceive: {
width: 30,
height: 30,
borderBottomLeftRadius: 15,
- backgroundColor: '#d2f8d6',
+ backgroundColor: BlueCurrentTheme.colors.ballReceive,
transform: [{ rotate: '-45deg' }],
},
ballOutgoing: {
width: 30,
height: 30,
borderRadius: 15,
- backgroundColor: '#f8d2d2',
+ backgroundColor: BlueCurrentTheme.colors.ballOutgoing,
transform: [{ rotate: '225deg' }],
justifyContent: 'center',
},
@@ -1023,13 +1160,13 @@ const stylesBlueIcon = StyleSheet.create({
width: 30,
height: 30,
borderRadius: 15,
- backgroundColor: '#f8d2d2',
+ backgroundColor: BlueCurrentTheme.colors.ballOutgoing,
},
ballOutgoingExpired: {
width: 30,
height: 30,
borderRadius: 15,
- backgroundColor: '#EEF0F4',
+ backgroundColor: BlueCurrentTheme.colors.ballOutgoingExpired,
justifyContent: 'center',
},
ballTransparrent: {
@@ -1056,7 +1193,7 @@ export class BluePlusIcon extends Component {
name="ios-add"
size={26}
style={{
- color: BlueApp.settings.foregroundColor,
+ color: BlueCurrentTheme.colors.foregroundColor,
backgroundColor: 'transparent',
left: 8,
top: 1,
@@ -1075,7 +1212,7 @@ export class BlueTransactionIncomingIcon extends Component {
-
+
@@ -1094,7 +1231,7 @@ export class BlueTransactionPendingIcon extends Component {
name="kebab-horizontal"
size={16}
type="octicon"
- color={BlueApp.settings.foregroundColor}
+ color={BlueCurrentTheme.colors.foregroundColor}
iconStyle={{ left: 0, top: 7 }}
/>
@@ -1129,7 +1266,7 @@ export class BlueTransactionOnchainIcon extends Component {
name="link"
size={16}
type="font-awesome"
- color={BlueApp.settings.incomingForegroundColor}
+ color={BlueCurrentTheme.colors.incomingForegroundColor}
iconStyle={{ left: 0, top: 0, transform: [{ rotate: '-45deg' }] }}
/>
@@ -1150,7 +1287,7 @@ export class BlueTransactionOffchainIcon extends Component {
name="bolt"
size={16}
type="font-awesome"
- color={BlueApp.settings.outgoingForegroundColor}
+ color={BlueCurrentTheme.colors.outgoingForegroundColor}
iconStyle={{ left: 0, marginTop: 6 }}
/>
@@ -1171,7 +1308,7 @@ export class BlueTransactionOffchainIncomingIcon extends Component {
name="bolt"
size={16}
type="font-awesome"
- color={BlueApp.settings.incomingForegroundColor}
+ color={BlueCurrentTheme.colors.incomingForegroundColor}
iconStyle={{ left: 0, marginTop: 6 }}
/>
@@ -1187,7 +1324,7 @@ export class BlueTransactionOutgoingIcon extends Component {
-
+
@@ -1205,7 +1342,7 @@ export class BlueReceiveButtonIcon extends Component {
style={{
flex: 1,
minWidth: 130,
- backgroundColor: BlueApp.settings.buttonBackgroundColor,
+ backgroundColor: BlueCurrentTheme.colors.buttonBackgroundColor,
}}
>
@@ -1220,11 +1357,17 @@ export class BlueReceiveButtonIcon extends Component {
marginBottom: -11,
}}
>
-
+
-
+
@@ -1307,11 +1450,17 @@ export class BlueSendButtonIcon extends Component {
marginBottom: 11,
}}
>
-
+
@@ -1347,11 +1496,11 @@ export class ManageFundsBigButton extends Component {
transform: [{ rotate: '90deg' }],
}}
>
-
+
@@ -1394,7 +1543,7 @@ export class NewWalletPanel extends Component {
{loc.wallets.list.create_a_wallet1}
@@ -1403,13 +1552,13 @@ export class NewWalletPanel extends Component {
style={{
backgroundColor: 'transparent',
fontSize: 13,
- color: BlueApp.settings.alternativeTextColor,
+ color: BlueCurrentTheme.colors.alternativeTextColor,
}}
>
{loc.wallets.list.create_a_wallet2}
- {loc.wallets.list.create_a_button}
+ {loc.wallets.list.create_a_button}
@@ -1453,7 +1602,7 @@ export const BlueTransactionListItem = React.memo(({ item, itemPriceUnit = Bitco
};
const rowTitleStyle = () => {
- let color = BlueApp.settings.successColor;
+ let color = BlueCurrentTheme.colors.successColor;
if (item.type === 'user_invoice' || item.type === 'payment_request') {
const currentDate = new Date();
@@ -1461,16 +1610,16 @@ export const BlueTransactionListItem = React.memo(({ item, itemPriceUnit = Bitco
const invoiceExpiration = item.timestamp + item.expire_time;
if (invoiceExpiration > now) {
- color = BlueApp.settings.successColor;
+ color = BlueCurrentTheme.colors.successColor;
} else if (invoiceExpiration < now) {
if (item.ispaid) {
- color = BlueApp.settings.successColor;
+ color = BlueCurrentTheme.colors.successColor;
} else {
color = '#9AA0AA';
}
}
} else if (item.value / 100000000 < 0) {
- color = BlueApp.settings.foregroundColor;
+ color = BlueCurrentTheme.colors.foregroundColor;
}
return {
@@ -1660,7 +1809,7 @@ export class BlueListTransactionItem extends Component {
}
}
} else if (item.value / 100000000 < 0) {
- color = BlueApp.settings.foregroundColor;
+ color = BlueCurrentTheme.colors.foregroundColor;
}
return {
@@ -1835,7 +1984,7 @@ const WalletCarouselItem = ({ item, index, onPress, handleLongPress }) => {
}}
>
{
style={{
backgroundColor: 'transparent',
fontSize: 19,
- color: BlueApp.settings.inverseForegroundColor,
+ color: BlueCurrentTheme.colors.inverseForegroundColor,
}}
>
{item.getLabel()}
@@ -1872,7 +2021,7 @@ const WalletCarouselItem = ({ item, index, onPress, handleLongPress }) => {
backgroundColor: 'transparent',
fontSize: 19,
marginTop: 40,
- color: BlueApp.settings.inverseForegroundColor,
+ color: BlueCurrentTheme.colors.inverseForegroundColor,
}}
>
An error was encountered when attempting to import this wallet.
@@ -1904,7 +2053,7 @@ const WalletCarouselItem = ({ item, index, onPress, handleLongPress }) => {
}}
>
{
style={{
backgroundColor: 'transparent',
fontSize: 19,
- color: BlueApp.settings.inverseForegroundColor,
+ color: BlueCurrentTheme.colors.inverseForegroundColor,
}}
>
{item.getLabel()}
@@ -1945,7 +2094,7 @@ const WalletCarouselItem = ({ item, index, onPress, handleLongPress }) => {
backgroundColor: 'transparent',
fontWeight: 'bold',
fontSize: 36,
- color: BlueApp.settings.inverseForegroundColor,
+ color: BlueCurrentTheme.colors.inverseForegroundColor,
}}
>
{loc.formatBalance(Number(item.getBalance()), item.getPreferredBalanceUnit(), true)}
@@ -1957,7 +2106,7 @@ const WalletCarouselItem = ({ item, index, onPress, handleLongPress }) => {
style={{
backgroundColor: 'transparent',
fontSize: 13,
- color: BlueApp.settings.inverseForegroundColor,
+ color: BlueCurrentTheme.colors.inverseForegroundColor,
}}
>
{loc.wallets.list.latest_transaction}
@@ -1968,7 +2117,7 @@ const WalletCarouselItem = ({ item, index, onPress, handleLongPress }) => {
backgroundColor: 'transparent',
fontWeight: 'bold',
fontSize: 16,
- color: BlueApp.settings.inverseForegroundColor,
+ color: BlueCurrentTheme.colors.inverseForegroundColor,
}}
>
{loc.transactionTimeToReadable(item.getLatestTransactionTime())}
@@ -2050,11 +2199,11 @@ export class BlueAddressInput extends Component {
-
- {loc.send.details.scan}
+
+ {loc.send.details.scan}
);
@@ -2157,42 +2306,42 @@ export class BlueReplaceFeeSuggestions extends Component {
Suggestions
this.onFeeSelected(NetworkTransactionFeeType.FAST)}
- containerStyle={{ paddingHorizontal: 0, marginHorizontal: 0 }}
+ containerStyle={{ paddingHorizontal: 0, marginHorizontal: 0, backgroundColor: BlueCurrentTheme.colors.transparent }}
bottomDivider={false}
title="Fast"
rightTitle={`${this.state.networkFees.fastestFee} sat/b`}
- rightTitleStyle={{ fontSize: 13, color: BlueApp.settings.alternativeTextColor }}
+ rightTitleStyle={{ fontSize: 13, color: BlueCurrentTheme.colors.alternativeTextColor }}
{...(this.state.selectedFeeType === NetworkTransactionFeeType.FAST
- ? { rightIcon: }
+ ? { rightIcon: }
: { hideChevron: true })}
/>
this.onFeeSelected(NetworkTransactionFeeType.MEDIUM)}
- containerStyle={{ paddingHorizontal: 0, marginHorizontal: 0 }}
+ containerStyle={{ paddingHorizontal: 0, marginHorizontal: 0, backgroundColor: BlueCurrentTheme.colors.transparent }}
bottomDivider={false}
title="Medium"
rightTitle={`${this.state.networkFees.mediumFee} sat/b`}
- rightTitleStyle={{ fontSize: 13, color: BlueApp.settings.alternativeTextColor }}
+ rightTitleStyle={{ fontSize: 13, color: BlueCurrentTheme.colors.alternativeTextColor }}
{...(this.state.selectedFeeType === NetworkTransactionFeeType.MEDIUM
- ? { rightIcon: }
+ ? { rightIcon: }
: { hideChevron: true })}
/>
this.onFeeSelected(NetworkTransactionFeeType.SLOW)}
- containerStyle={{ paddingHorizontal: 0, marginHorizontal: 0 }}
+ containerStyle={{ paddingHorizontal: 0, marginHorizontal: 0, backgroundColor: BlueCurrentTheme.colors.transparent }}
bottomDivider={false}
title="Slow"
rightTitle={`${this.state.networkFees.slowFee} sat/b`}
- rightTitleStyle={{ fontSize: 13, color: BlueApp.settings.alternativeTextColor }}
+ rightTitleStyle={{ fontSize: 13, color: BlueCurrentTheme.colors.alternativeTextColor }}
{...(this.state.selectedFeeType === NetworkTransactionFeeType.SLOW
- ? { rightIcon: }
+ ? { rightIcon: }
: { hideChevron: true })}
/>
>
)}
this.customTextInput.focus()}>
- Custom
+ Custom
(this.customTextInput = ref)}
maxLength={9}
style={{
- borderColor: '#d2d2d2',
- borderBottomColor: '#d2d2d2',
+ borderColor: BlueCurrentTheme.colors.formBorder,
+ borderBottomColor: BlueCurrentTheme.colors.formBorder,
borderWidth: 1.0,
borderBottomWidth: 0.5,
borderRadius: 4,
minHeight: 33,
maxWidth: 100,
minWidth: 44,
- backgroundColor: '#f5f5f5',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
textAlign: 'right',
}}
onFocus={() => this.onCustomFeeTextChange(this.state.customFeeValue)}
@@ -2227,13 +2376,13 @@ export class BlueReplaceFeeSuggestions extends Component {
placeholder="Custom sat/b"
inputAccessoryViewID={BlueDismissKeyboardInputAccessory.InputAccessoryViewID}
/>
- sat/b
+ sat/b
{this.state.selectedFeeType === NetworkTransactionFeeType.CUSTOM && }
-
+
The total fee rate (satoshi per byte) you want to pay should be higher than {this.props.transactionMinimum} sat/byte
@@ -2391,7 +2540,9 @@ export class BlueBitcoinAmount extends Component {
{this.state.unit === BitcoinUnit.LOCAL_CURRENCY && (
0 || amount === BitcoinUnit.MAX ? amount : undefined}
placeholderTextColor={
- this.props.disabled ? BlueApp.settings.buttonDisabledTextColor : BlueApp.settings.alternativeTextColor2
+ this.props.disabled ? BlueCurrentTheme.colors.buttonDisabledTextColor : BlueCurrentTheme.colors.alternativeTextColor2
}
style={{
- color: this.props.disabled ? BlueApp.settings.buttonDisabledTextColor : BlueApp.settings.alternativeTextColor2,
+ color: this.props.disabled
+ ? BlueCurrentTheme.colors.buttonDisabledTextColor
+ : BlueCurrentTheme.colors.alternativeTextColor2,
fontWeight: 'bold',
fontSize: amount.length > 10 ? 20 : 36,
}}
@@ -2470,7 +2623,9 @@ export class BlueBitcoinAmount extends Component {
{this.state.unit !== BitcoinUnit.LOCAL_CURRENCY && (
(
style={[
tabsStyles.tabRoot,
active === i && {
- borderColor: BlueApp.settings.buttonAlternativeTextColor,
+ borderColor: BlueCurrentTheme.colors.buttonAlternativeTextColor,
borderBottomWidth: 2,
},
{ width: width / tabs.length },
@@ -2644,8 +2799,9 @@ export class DynamicQRCode extends Component {
@@ -2700,7 +2856,6 @@ const animatedQRCodeStyle = StyleSheet.create({
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
- backgroundColor: '#ccddf9',
borderRadius: 25,
height: 45,
paddingHorizontal: 18,
@@ -2711,6 +2866,8 @@ const animatedQRCodeStyle = StyleSheet.create({
justifyContent: 'center',
},
text: {
- fontSize: 16,
+ fontSize: 14,
+ color: BlueCurrentTheme.colors.foregroundColor,
+ fontWeight: 'bold',
},
});
diff --git a/Navigation.js b/Navigation.js
index 8164659da..734166eb7 100644
--- a/Navigation.js
+++ b/Navigation.js
@@ -62,8 +62,7 @@ import LNDViewInvoice from './screen/lnd/lndViewInvoice';
import LNDViewAdditionalInvoiceInformation from './screen/lnd/lndViewAdditionalInvoiceInformation';
import LoadingScreen from './LoadingScreen';
import UnlockWith from './UnlockWith';
-const BlueApp = require('./BlueApp');
-const loc = require('./loc');
+import { BlueNavigationStyle } from './BlueComponents';
const SCREEN_HEIGHT = Dimensions.get('window').height;
const defaultScreenOptions =
@@ -103,15 +102,9 @@ const WalletsRoot = () => (
name="Settings"
component={Settings}
options={{
- headerStyle: {
- backgroundColor: '#FFFFFF',
- borderBottomWidth: 0,
- elevation: 0,
- shadowColor: 'transparent',
- },
- title: '',
- headerBackTitleVisible: false,
- headerTintColor: '#0c2550',
+ ...BlueNavigationStyle(),
+
+ headerTitle: '',
}}
/>
@@ -140,18 +133,8 @@ const WalletsRoot = () => (
component={LNDViewAdditionalInvoiceInformation}
options={LNDViewAdditionalInvoiceInformation.navigationOptions}
/>
-
+
+
);
@@ -189,16 +172,7 @@ const SendDetailsRoot = () => (
}}
/>
-
+
);
@@ -206,16 +180,7 @@ const LNDCreateInvoiceStack = createStackNavigator();
const LNDCreateInvoiceRoot = () => (
-
+
(
);
-const HodlHodlStack = createStackNavigator();
-const HodlHodlRoot = () => (
-
-
-
-
-
-
-
-);
-
// LightningScanInvoiceStackNavigator === ScanLndInvoiceStack
const ScanLndInvoiceStack = createStackNavigator();
const ScanLndInvoiceRoot = () => (
-
+
);
@@ -290,6 +235,13 @@ const UnlockWithScreenRoot = () => (
);
+const HodlHodlLoginStack = createStackNavigator();
+const HodlHodlLoginRoot = () => (
+
+
+
+);
+
const RootStack = createStackNavigator();
const Navigation = () => (
@@ -306,7 +258,9 @@ const Navigation = () => (
-
+
+
+
{
+ const appearance = Appearance.getColorScheme();
+ if (appearance) {
+ this.setState({ appearance });
+ }
+ };
+
successfullyAuthenticated = () => {
EV(EV.enum.WALLETS_INITIALIZED);
NavigationService.dispatch(StackActions.replace('WalletsRoot'));
@@ -94,9 +106,10 @@ export default class UnlockWith extends Component {
return ;
}
- const color = Appearance.getColorScheme() === 'dark' ? '#FFFFFF' : '#000000';
+ const color = this.state.appearance === 'dark' ? '#FFFFFF' : '#000000';
return (
+
@@ -115,9 +128,7 @@ export default class UnlockWith extends Component {
<>
diff --git a/class/app-storage.js b/class/app-storage.js
index 6ca2fd22c..4e574d275 100644
--- a/class/app-storage.js
+++ b/class/app-storage.js
@@ -39,32 +39,6 @@ export class AppStorage {
this.wallets = [];
this.tx_metadata = {};
this.cachedPassword = false;
- this.settings = {
- brandingColor: '#ffffff',
- foregroundColor: '#0c2550',
- buttonBackgroundColor: '#ccddf9',
- buttonTextColor: '#0c2550',
- buttonAlternativeTextColor: '#2f5fb3',
- buttonDisabledBackgroundColor: '#eef0f4',
- buttonDisabledTextColor: '#9aa0aa',
- inputBorderColor: '#d2d2d2',
- inputBackgroundColor: '#f5f5f5',
- alternativeTextColor: '#9aa0aa',
- alternativeTextColor2: '#0f5cc0',
- buttonBlueBackgroundColor: '#ccddf9',
- incomingBackgroundColor: '#d2f8d6',
- incomingForegroundColor: '#37c0a1',
- outgoingBackgroundColor: '#f8d2d2',
- outgoingForegroundColor: '#d0021b',
- successColor: '#37c0a1',
- failedColor: '#ff0000',
- shadowColor: '#000000',
- inverseForegroundColor: '#ffffff',
- hdborderColor: '#68BBE1',
- hdbackgroundColor: '#ECF9FF',
- lnborderColor: '#F7C056',
- lnbackgroundColor: '#FFFAEF',
- };
}
/**
diff --git a/class/wallet-gradient.js b/class/wallet-gradient.js
index 80b480e48..591f7e946 100644
--- a/class/wallet-gradient.js
+++ b/class/wallet-gradient.js
@@ -9,6 +9,7 @@ import { PlaceholderWallet } from './wallets/placeholder-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';
+import { BlueCurrentTheme } from '../components/themes';
export default class WalletGradient {
static hdSegwitP2SHWallet = ['#65ceef', '#68bbe1'];
@@ -20,7 +21,7 @@ export default class WalletGradient {
static hdLegacyBreadWallet = ['#fe6381', '#f99c42'];
static defaultGradients = ['#c65afb', '#9053fe'];
static lightningCustodianWallet = ['#f1be07', '#f79056'];
- static createWallet = '#eef0f4';
+ static createWallet = BlueCurrentTheme.colors.lightButton;
static gradientsFor(type) {
let gradient;
diff --git a/components/themes.js b/components/themes.js
new file mode 100644
index 000000000..4564ec52b
--- /dev/null
+++ b/components/themes.js
@@ -0,0 +1,105 @@
+import { DefaultTheme, DarkTheme } from '@react-navigation/native';
+import { Appearance } from 'react-native';
+
+export const BlueDefaultTheme = {
+ ...DefaultTheme,
+ closeImage: require('../img/close.png'),
+ scanImage: require('../img/scan.png'),
+ colors: {
+ ...DefaultTheme.colors,
+ brandingColor: '#ffffff',
+ foregroundColor: '#0c2550',
+ borderTopColor: 'rgba(0, 0, 0, 0.1)',
+ buttonBackgroundColor: '#ccddf9',
+ buttonTextColor: '#0c2550',
+ buttonAlternativeTextColor: '#2f5fb3',
+ buttonDisabledBackgroundColor: '#eef0f4',
+ buttonDisabledTextColor: '#9aa0aa',
+ inputBorderColor: '#d2d2d2',
+ inputBackgroundColor: '#f5f5f5',
+ alternativeTextColor: '#9aa0aa',
+ alternativeTextColor2: '#0f5cc0',
+ buttonBlueBackgroundColor: '#ccddf9',
+ incomingBackgroundColor: '#d2f8d6',
+ incomingForegroundColor: '#37c0a1',
+ outgoingBackgroundColor: '#f8d2d2',
+ outgoingForegroundColor: '#d0021b',
+ successColor: '#37c0a1',
+ failedColor: '#ff0000',
+ shadowColor: '#000000',
+ inverseForegroundColor: '#ffffff',
+ hdborderColor: '#68BBE1',
+ hdbackgroundColor: '#ECF9FF',
+ lnborderColor: '#F7C056',
+ lnbackgroundColor: '#FFFAEF',
+ background: '#FFFFFF',
+ customHeader: 'rgba(0,0,0,0)',
+ lightButton: '#eef0f4',
+ ballReceive: '#d2f8d6',
+ ballOutgoing: '#f8d2d2',
+ lightBorder: '#ededed',
+ ballOutgoingExpired: '#EEF0F4',
+ modal: '#ffffff',
+ formBorder: '#d2d2d2',
+ modalButton: '#ccddf9',
+ darkGray: '#9AA0AA',
+ scanLabel: '#9AA0AA',
+ feeText: '#81868e',
+ feeLabel: '#d2f8d6',
+ feeValue: '#37c0a1',
+ labelText: '#81868e',
+ cta2: '#062453',
+ outputValue: '#13244D',
+ elevated: '#ffffff',
+ mainColor: '#CFDCF6',
+ success: '#ccddf9',
+ successCheck: '#0f5cc0',
+ },
+};
+
+export const BlueDarkTheme = {
+ ...DarkTheme,
+ closeImage: require('../img/close-white.png'),
+ scanImage: require('../img/scan-white.png'),
+ colors: {
+ ...BlueDefaultTheme.colors,
+ ...DarkTheme.colors,
+ brandingColor: '#000000',
+ borderTopColor: '#9aa0aa',
+ foregroundColor: '#ffffff',
+ buttonDisabledBackgroundColor: '#3A3A3C',
+ buttonBackgroundColor: '#3A3A3C',
+ customHeader: '#000000',
+ buttonTextColor: '#ffffff',
+ lightButton: 'rgba(255,255,255,.1)',
+ buttonAlternativeTextColor: '#ffffff',
+ alternativeTextColor: '#9aa0aa',
+ alternativeTextColor2: '#0A84FF',
+ ballReceive: '#202020',
+ ballOutgoing: '#202020',
+ lightBorder: '#313030',
+ ballOutgoingExpired: '#202020',
+ modal: '#202020',
+ formBorder: '#202020',
+ inputBackgroundColor: '#262626',
+ modalButton: '#000000',
+ darkGray: '#3A3A3C',
+ feeText: '#81868e',
+ feeLabel: '#8EFFE5',
+ feeValue: '#000000',
+ cta2: '#ffffff',
+ outputValue: '#ffffff',
+ elevated: '#121212',
+ mainColor: '#0A84FF',
+ success: '#202020',
+ successCheck: '#0A84FF',
+ buttonBlueBackgroundColor: '#202020',
+ scanLabel: 'rgba(255,255,255,.2)',
+ labelText: '#ffffff',
+ },
+};
+
+export class BlueCurrentTheme {}
+BlueCurrentTheme.colors = Appearance.getColorScheme() === 'dark' ? BlueDarkTheme.colors : BlueDefaultTheme.colors;
+BlueCurrentTheme.closeImage = Appearance.getColorScheme() === 'dark' ? BlueDarkTheme.closeImage : BlueDefaultTheme.closeImage;
+BlueCurrentTheme.scanImage = Appearance.getColorScheme() === 'dark' ? BlueDarkTheme.scanImage : BlueDefaultTheme.scanImage;
diff --git a/img/scan-white.png b/img/scan-white.png
new file mode 100644
index 000000000..2602b23c8
Binary files /dev/null and b/img/scan-white.png differ
diff --git a/img/scan-white@2x.png b/img/scan-white@2x.png
new file mode 100644
index 000000000..1547fdd11
Binary files /dev/null and b/img/scan-white@2x.png differ
diff --git a/img/scan-white@3x.png b/img/scan-white@3x.png
new file mode 100644
index 000000000..f11c274d7
Binary files /dev/null and b/img/scan-white@3x.png differ
diff --git a/package.json b/package.json
index 9ad42505c..bacdd6062 100644
--- a/package.json
+++ b/package.json
@@ -60,14 +60,14 @@
]
},
"dependencies": {
- "@babel/preset-env": "7.10.2",
+ "@babel/preset-env": "7.10.3",
"@react-native-community/async-storage": "1.11.0",
"@react-native-community/blur": "3.6.0",
"@react-native-community/clipboard": "1.2.2",
"@react-native-community/masked-view": "0.1.10",
"@react-native-community/slider": "3.0.0",
- "@react-navigation/native": "5.5.1",
- "@react-navigation/stack": "5.5.1",
+ "@react-navigation/native": "5.6.1",
+ "@react-navigation/stack": "5.6.2",
"@remobile/react-native-qrcode-local-image": "git+https://github.com/BlueWallet/react-native-qrcode-local-image.git",
"@sentry/react-native": "1.4.5",
"amplitude-js": "5.11.0",
diff --git a/screen/lnd/browser.js b/screen/lnd/browser.js
index ea4b30cf2..92d24f446 100644
--- a/screen/lnd/browser.js
+++ b/screen/lnd/browser.js
@@ -287,12 +287,6 @@ const styles = StyleSheet.create({
});
export default class Browser extends Component {
- static navigationOptions = ({ navigation }) => ({
- ...BlueNavigationStyle(navigation, true),
- title: 'Lapp Browser',
- headerLeft: null,
- });
-
constructor(props) {
super(props);
if (!props.route.params.fromSecret) throw new Error('Invalid param');
@@ -435,7 +429,7 @@ export default class Browser extends Component {
return (
-
+
{
@@ -516,3 +510,9 @@ Browser.propTypes = {
params: PropTypes.object,
}),
};
+
+Browser.navigationOptions = ({ navigation }) => ({
+ ...BlueNavigationStyle(navigation, true),
+ title: 'Lapp Browser',
+ headerLeft: null,
+});
diff --git a/screen/lnd/lndCreateInvoice.js b/screen/lnd/lndCreateInvoice.js
index 4852e0416..a5a89e037 100644
--- a/screen/lnd/lndCreateInvoice.js
+++ b/screen/lnd/lndCreateInvoice.js
@@ -11,6 +11,7 @@ import {
TouchableOpacity,
Text,
StyleSheet,
+ Image,
} from 'react-native';
import {
BlueNavigationStyle,
@@ -26,6 +27,7 @@ import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
import * as NavigationService from '../../NavigationService';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { Icon } from 'react-native-elements';
+import { BlueCurrentTheme } from '../../components/themes';
const currency = require('../../blue_modules/currency');
const BlueApp = require('../../BlueApp');
const EV = require('../../blue_modules/events');
@@ -37,14 +39,13 @@ const styles = StyleSheet.create({
marginVertical: 16,
minHeight: 45,
alignContent: 'center',
- backgroundColor: '#FFFFFF',
},
scanRoot: {
height: 36,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
- backgroundColor: '#9AA0AA',
+ backgroundColor: BlueCurrentTheme.colors.scanLabel,
borderRadius: 4,
paddingVertical: 4,
paddingHorizontal: 8,
@@ -52,7 +53,7 @@ const styles = StyleSheet.create({
},
scanClick: {
marginLeft: 4,
- color: BlueApp.settings.inverseForegroundColor,
+ color: BlueCurrentTheme.colors.inverseForegroundColor,
},
walletRoot: {
marginBottom: 16,
@@ -78,18 +79,18 @@ const styles = StyleSheet.create({
alignItems: 'center',
},
walletNameText: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.buttonAlternativeTextColor,
fontSize: 14,
},
walletNameBalance: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.buttonAlternativeTextColor,
fontSize: 14,
fontWeight: '600',
marginLeft: 8,
marginRight: 4,
},
walletNameSats: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.buttonAlternativeTextColor,
fontSize: 11,
fontWeight: '600',
textAlignVertical: 'bottom',
@@ -102,19 +103,19 @@ const styles = StyleSheet.create({
root: {
flex: 1,
justifyContent: 'space-between',
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
amount: {
flex: 1,
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
fiat: {
flexDirection: 'row',
- borderColor: '#d2d2d2',
- borderBottomColor: '#d2d2d2',
+ borderColor: BlueCurrentTheme.colors.formBorder,
+ borderBottomColor: BlueCurrentTheme.colors.formBorder,
borderWidth: 1.0,
borderBottomWidth: 0.5,
- backgroundColor: '#f5f5f5',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
minHeight: 44,
height: 44,
marginHorizontal: 20,
@@ -131,11 +132,6 @@ const styles = StyleSheet.create({
});
export default class LNDCreateInvoice extends Component {
- static navigationOptions = ({ navigation }) => ({
- ...BlueNavigationStyle(navigation, true),
- title: loc.receive.header,
- });
-
constructor(props) {
super(props);
this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
@@ -356,7 +352,7 @@ export default class LNDCreateInvoice extends Component {
}}
style={styles.scanRoot}
>
-
+
{loc.send.details.scan}
);
@@ -478,3 +474,8 @@ LNDCreateInvoice.propTypes = {
}),
}),
};
+LNDCreateInvoice.navigationOptions = ({ navigation }) => ({
+ ...BlueNavigationStyle(navigation, true),
+ headerTitle: loc.receive.header,
+ headerLeft: null,
+});
diff --git a/screen/lnd/lndViewAdditionalInvoiceInformation.js b/screen/lnd/lndViewAdditionalInvoiceInformation.js
index fe356dc1d..91479a878 100644
--- a/screen/lnd/lndViewAdditionalInvoiceInformation.js
+++ b/screen/lnd/lndViewAdditionalInvoiceInformation.js
@@ -13,7 +13,7 @@ import {
import PropTypes from 'prop-types';
import QRCode from 'react-native-qrcode-svg';
/** @type {AppStorage} */
-const BlueApp = require('../../BlueApp');
+import { BlueCurrentTheme } from '../../components/themes';
const loc = require('../../loc');
const styles = StyleSheet.create({
@@ -21,9 +21,11 @@ const styles = StyleSheet.create({
flex: 1,
justifyContent: 'center',
alignItems: 'center',
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
root: {
flex: 1,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
wrapper: {
flex: 1,
@@ -42,11 +44,6 @@ const styles = StyleSheet.create({
});
export default class LNDViewAdditionalInvoiceInformation extends Component {
- static navigationOptions = ({ navigation }) => ({
- ...BlueNavigationStyle(),
- title: 'Additional Information',
- });
-
state = { walletInfo: undefined };
async componentDidMount() {
@@ -78,8 +75,9 @@ export default class LNDViewAdditionalInvoiceInformation extends Component {
logo={require('../../img/qr-code.png')}
size={300}
logoSize={90}
- color={BlueApp.settings.foregroundColor}
- logoBackgroundColor={BlueApp.settings.brandingColor}
+ color={BlueCurrentTheme.colors.foregroundColor}
+ logoBackgroundColor={BlueCurrentTheme.colors.brandingColor}
+ backgroundColor={BlueCurrentTheme.colors.background}
/>
{loc.lndViewInvoice.open_direct_channel}
@@ -90,7 +88,7 @@ export default class LNDViewAdditionalInvoiceInformation extends Component {
icon={{
name: 'share-alternative',
type: 'entypo',
- color: BlueApp.settings.buttonTextColor,
+ color: BlueCurrentTheme.colors.buttonTextColor,
}}
onPress={async () => {
Share.share({
@@ -111,3 +109,8 @@ LNDViewAdditionalInvoiceInformation.propTypes = {
params: PropTypes.object,
}),
};
+
+LNDViewAdditionalInvoiceInformation.navigationOptions = ({ navigation }) => ({
+ ...BlueNavigationStyle(),
+ title: 'Additional Information',
+});
diff --git a/screen/lnd/lndViewInvoice.js b/screen/lnd/lndViewInvoice.js
index ff8332341..6ed1d5567 100644
--- a/screen/lnd/lndViewInvoice.js
+++ b/screen/lnd/lndViewInvoice.js
@@ -1,11 +1,12 @@
import React, { Component } from 'react';
-import { View, Text, Dimensions, ScrollView, BackHandler, TouchableOpacity, StyleSheet } from 'react-native';
+import { View, Text, Dimensions, StatusBar, ScrollView, BackHandler, TouchableOpacity, StyleSheet } from 'react-native';
import Share from 'react-native-share';
import {
BlueLoading,
BlueText,
SafeBlueArea,
BlueButton,
+ SecondButton,
BlueCopyTextToClipboard,
BlueNavigationStyle,
BlueSpacing20,
@@ -16,7 +17,7 @@ import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { Icon } from 'react-native-elements';
import QRCode from 'react-native-qrcode-svg';
/** @type {AppStorage} */
-const BlueApp = require('../../BlueApp');
+import { BlueCurrentTheme } from '../../components/themes';
const loc = require('../../loc');
const EV = require('../../blue_modules/events');
const { width, height } = Dimensions.get('window');
@@ -41,12 +42,12 @@ const styles = StyleSheet.create({
paddingBottom: 8,
},
valueText: {
- color: '#0f5cc0',
+ color: BlueCurrentTheme.colors.alternativeTextColor2,
fontSize: 32,
fontWeight: '600',
},
valueSats: {
- color: '#0f5cc0',
+ color: BlueCurrentTheme.colors.alternativeTextColor2,
fontSize: 16,
marginHorizontal: 4,
paddingBottom: 3,
@@ -69,6 +70,7 @@ const styles = StyleSheet.create({
paidMark: {
marginTop: -100,
marginBottom: 16,
+ backgroundColor: BlueCurrentTheme.colors.success,
},
detailsRoot: {
flex: 1,
@@ -81,12 +83,12 @@ const styles = StyleSheet.create({
alignItems: 'center',
},
detailsText: {
- color: '#9aa0aa',
+ color: BlueCurrentTheme.colors.alternativeTextColor,
fontSize: 14,
marginRight: 8,
},
expired: {
- backgroundColor: '#ccddf9',
+ backgroundColor: BlueCurrentTheme.colors.success,
width: 120,
height: 120,
borderRadius: 60,
@@ -108,20 +110,11 @@ const styles = StyleSheet.create({
paddingHorizontal: 16,
},
additionalInfo: {
- backgroundColor: BlueApp.settings.brandingColor,
+ backgroundColor: BlueCurrentTheme.colors.brandingColor,
},
});
export default class LNDViewInvoice extends Component {
- static navigationOptions = ({ navigation, route }) =>
- route.params.isModal === true
- ? {
- ...BlueNavigationStyle(navigation, true, () => navigation.dangerouslyGetParent().pop()),
- title: 'Lightning Invoice',
- headerLeft: null,
- }
- : { ...BlueNavigationStyle(), title: 'Lightning Invoice' };
-
constructor(props) {
super(props);
const invoice = props.route.params.invoice;
@@ -212,6 +205,7 @@ export default class LNDViewInvoice extends Component {
if (this.state.showPreimageQr) {
return (
+
Preimage:
@@ -220,8 +214,9 @@ export default class LNDViewInvoice extends Component {
logo={require('../../img/qr-code.png')}
size={this.state.qrCodeHeight}
logoSize={90}
- color={BlueApp.settings.foregroundColor}
- logoBackgroundColor={BlueApp.settings.brandingColor}
+ color={BlueCurrentTheme.colors.foregroundColor}
+ backgroundColor={BlueCurrentTheme.colors.background}
+ logoBackgroundColor={BlueCurrentTheme.colors.brandingColor}
/>
+
{invoice.type === 'paid_invoice' && invoice.value && (
@@ -259,7 +255,7 @@ export default class LNDViewInvoice extends Component {
{invoice.payment_preimage && typeof invoice.payment_preimage === 'string' ? (
this.setState({ showPreimageQr: true })}>
{loc.send.create.details}
-
+
) : (
@@ -271,9 +267,10 @@ export default class LNDViewInvoice extends Component {
if (invoiceExpiration < now && !invoice.ispaid) {
return (
+
-
+
{loc.lndViewInvoice.wasnt_paid_and_expired}
@@ -294,6 +291,7 @@ export default class LNDViewInvoice extends Component {
// Invoice has not expired, nor has it been paid for.
return (
+
@@ -302,8 +300,9 @@ export default class LNDViewInvoice extends Component {
logo={require('../../img/qr-code.png')}
size={this.state.qrCodeHeight}
logoSize={90}
- color={BlueApp.settings.foregroundColor}
- logoBackgroundColor={BlueApp.settings.brandingColor}
+ color={BlueCurrentTheme.colors.foregroundColor}
+ logoBackgroundColor={BlueCurrentTheme.colors.brandingColor}
+ backgroundColor={BlueCurrentTheme.colors.background}
/>
@@ -318,15 +317,9 @@ export default class LNDViewInvoice extends Component {
)}
- {
- Share.open({ message: `lightning://${invoice.payment_request}` }).catch(error => console.log(error));
+ Share.open({ message: `lightning:${invoice.payment_request}` }).catch(error => console.log(error));
}}
title={loc.receive.details.share}
/>
@@ -354,3 +347,21 @@ LNDViewInvoice.propTypes = {
params: PropTypes.object,
}),
};
+
+LNDViewInvoice.navigationOptions = ({ navigation, route }) =>
+ route.params.isModal === true
+ ? {
+ ...BlueNavigationStyle(navigation, true, () => navigation.dangerouslyGetParent().pop()),
+ title: 'Lightning Invoice',
+ headerLeft: null,
+ headerStyle: {
+ backgroundColor: BlueCurrentTheme.colors.customHeader,
+ },
+ }
+ : {
+ ...BlueNavigationStyle(),
+ title: 'Lightning Invoice',
+ headerStyle: {
+ backgroundColor: BlueCurrentTheme.colors.customHeader,
+ },
+ };
diff --git a/screen/lnd/scanLndInvoice.js b/screen/lnd/scanLndInvoice.js
index 568468143..fbaf6576a 100644
--- a/screen/lnd/scanLndInvoice.js
+++ b/screen/lnd/scanLndInvoice.js
@@ -27,6 +27,7 @@ import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
import { Icon } from 'react-native-elements';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import Biometric from '../../class/biometrics';
+import { BlueCurrentTheme } from '../../components/themes';
/** @type {AppStorage} */
const BlueApp = require('../../BlueApp');
const EV = require('../../blue_modules/events');
@@ -58,18 +59,18 @@ const styles = StyleSheet.create({
alignItems: 'center',
},
walletWrapLabel: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.buttonAlternativeTextColor,
fontSize: 14,
},
walletWrapBalance: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.buttonAlternativeTextColor,
fontSize: 14,
fontWeight: '600',
marginLeft: 4,
marginRight: 4,
},
walletWrapSats: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.buttonAlternativeTextColor,
fontSize: 11,
fontWeight: '600',
textAlignVertical: 'bottom',
@@ -77,6 +78,7 @@ const styles = StyleSheet.create({
},
root: {
flex: 1,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
scroll: {
flex: 1,
@@ -106,12 +108,6 @@ const styles = StyleSheet.create({
});
export default class ScanLndInvoice extends React.Component {
- static navigationOptions = ({ navigation }) => ({
- ...BlueNavigationStyle(navigation, true),
- title: loc.send.header,
- headerLeft: null,
- });
-
state = {
isLoading: false,
isAmountInitiallyEmpty: false,
@@ -465,3 +461,9 @@ ScanLndInvoice.propTypes = {
}),
}),
};
+
+ScanLndInvoice.navigationOptions = ({ navigation }) => ({
+ ...BlueNavigationStyle(navigation, true),
+ title: loc.send.header,
+ headerLeft: null,
+});
diff --git a/screen/plausibledeniability.js b/screen/plausibledeniability.js
index a341ec66a..38a332519 100644
--- a/screen/plausibledeniability.js
+++ b/screen/plausibledeniability.js
@@ -17,10 +17,6 @@ const styles = StyleSheet.create({
});
export default class PlausibleDeniability extends Component {
- static navigationOptions = {
- ...BlueNavigationStyle(),
- title: loc.plausibledeniability.title,
- };
constructor(props) {
super(props);
@@ -92,3 +88,8 @@ PlausibleDeniability.propTypes = {
popToTop: PropTypes.func,
}),
};
+
+PlausibleDeniability.navigationOptions = ({ navigation, route }) => ({
+ ...BlueNavigationStyle(),
+ title: loc.plausibledeniability.title,
+});
diff --git a/screen/receive/aztecoRedeem.js b/screen/receive/aztecoRedeem.js
index 334a8d60c..0dedc9c4e 100644
--- a/screen/receive/aztecoRedeem.js
+++ b/screen/receive/aztecoRedeem.js
@@ -51,11 +51,6 @@ const styles = StyleSheet.create({
});
export default class AztecoRedeem extends Component {
- static navigationOptions = ({ navigation }) => ({
- ...BlueCreateTxNavigationStyle(navigation),
- title: 'Redeem Azte.co voucher',
- });
-
state = { isLoading: true };
constructor(props) {
@@ -156,7 +151,7 @@ export default class AztecoRedeem extends Component {
return (
-
+
Your voucher code is
@@ -187,3 +182,8 @@ AztecoRedeem.propTypes = {
}),
}),
};
+
+AztecoRedeem.navigationOptions = ({ navigation }) => ({
+ ...BlueCreateTxNavigationStyle(navigation),
+ title: 'Redeem Azte.co voucher',
+});
diff --git a/screen/receive/details.js b/screen/receive/details.js
index 322d2b162..908b7cb2a 100644
--- a/screen/receive/details.js
+++ b/screen/receive/details.js
@@ -11,19 +11,19 @@ import {
ScrollView,
} from 'react-native';
import QRCode from 'react-native-qrcode-svg';
-import { useNavigation, useRoute } from '@react-navigation/native';
+import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import {
- BlueLoading,
- SafeBlueArea,
+ BlueLoadingHook,
BlueCopyTextToClipboard,
BlueButton,
- BlueButtonLink,
- BlueNavigationStyle,
+ SecondButton,
+ BlueButtonLinkHook,
is,
BlueBitcoinAmount,
BlueText,
BlueSpacing20,
BlueAlertWalletExportReminder,
+ BlueNavigationStyle,
} from '../../BlueComponents';
import Privacy from '../../Privacy';
import Share from 'react-native-share';
@@ -32,6 +32,7 @@ import Modal from 'react-native-modal';
import HandoffSettings from '../../class/handoff';
import DeeplinkSchemaMatch from '../../class/deeplink-schema-match';
import Handoff from 'react-native-handoff';
+import { BlueCurrentTheme } from '../../components/themes';
/** @type {AppStorage} */
const BlueApp = require('../../BlueApp');
const loc = require('../../loc');
@@ -49,6 +50,89 @@ const ReceiveDetails = () => {
const [isCustom, setIsCustom] = useState(false);
const [isCustomModalVisible, setIsCustomModalVisible] = useState(false);
const { navigate, goBack } = useNavigation();
+ const { colors } = useTheme();
+ const styles = StyleSheet.create({
+ modalContent: {
+ backgroundColor: BlueCurrentTheme.colors.modal,
+ padding: 22,
+ justifyContent: 'center',
+ alignItems: 'center',
+ borderTopLeftRadius: 16,
+ borderTopRightRadius: 16,
+ borderTopColor: colors.foregroundColor,
+ borderWidth: colors.borderWidth,
+ minHeight: 350,
+ height: 350,
+ },
+ bottomModal: {
+ justifyContent: 'flex-end',
+ margin: 0,
+ },
+ customAmount: {
+ flexDirection: 'row',
+ borderColor: BlueCurrentTheme.colors.formBorder,
+ borderBottomColor: BlueCurrentTheme.colors.formBorder,
+ borderWidth: 1.0,
+ borderBottomWidth: 0.5,
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
+ minHeight: 44,
+ height: 44,
+ marginHorizontal: 20,
+ alignItems: 'center',
+ marginVertical: 8,
+ borderRadius: 4,
+ },
+ customAmountText: {
+ flex: 1,
+ marginHorizontal: 8,
+ color: BlueCurrentTheme.colors.foregroundColor,
+ minHeight: 33,
+ },
+ root: {
+ flex: 1,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
+ },
+ scroll: {
+ justifyContent: 'space-between',
+ },
+ scrollBody: {
+ marginTop: 32,
+ alignItems: 'center',
+ paddingHorizontal: 16,
+ },
+ amount: {
+ color: BlueCurrentTheme.colors.foregroundColor,
+ fontWeight: '600',
+ fontSize: 36,
+ textAlign: 'center',
+ paddingBottom: 24,
+ },
+ label: {
+ color: BlueCurrentTheme.colors.foregroundColor,
+ fontWeight: '600',
+ textAlign: 'center',
+ paddingBottom: 24,
+ },
+ loading: {
+ alignItems: 'center',
+ width: 300,
+ height: 300,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
+ },
+ share: {
+ alignItems: 'center',
+ alignContent: 'flex-end',
+ marginBottom: 24,
+ },
+ modalButton: {
+ backgroundColor: BlueCurrentTheme.colors.modalButton,
+ paddingVertical: 14,
+ paddingHorizontal: 70,
+ maxWidth: '80%',
+ borderRadius: 50,
+ fontWeight: '700',
+ },
+ });
const renderReceiveDetails = useCallback(async () => {
console.log('receive/details - componentDidMount');
@@ -144,14 +228,6 @@ const ReceiveDetails = () => {
setBip21encoded(DeeplinkSchemaMatch.bip21encode(address, { amount, label: customLabel }));
};
- const clearCustomAmount = () => {
- setIsCustom(false);
- setIsCustomModalVisible(false);
- setCustomAmount('');
- setCustomLabel('');
- setBip21encoded(DeeplinkSchemaMatch.bip21encode(address));
- };
-
const renderCustomAmountModal = () => {
return (
@@ -175,9 +251,8 @@ const ReceiveDetails = () => {
-
+
-
@@ -206,7 +281,7 @@ const ReceiveDetails = () => {
};
return (
-
+
{isHandOffUseEnabled && address !== undefined && (
{
url={`https://blockstream.info/address/${address}`}
/>
)}
-
+
{isCustom && (
<>
@@ -229,7 +304,7 @@ const ReceiveDetails = () => {
)}
{bip21encoded === undefined ? (
-
+
) : (
{
logo={require('../../img/qr-code.png')}
size={(is.ipad() && 300) || 300}
logoSize={90}
- color={BlueApp.settings.foregroundColor}
- logoBackgroundColor={BlueApp.settings.brandingColor}
+ color={colors.foregroundColor}
+ logoBackgroundColor={colors.brandingColor}
+ backgroundColor={colors.background}
ecl="H"
/>
)}
-
+
-
+
- {renderCustomAmountModal()}
-
+ {renderCustomAmountModal()}
+
);
};
@@ -271,75 +339,3 @@ ReceiveDetails.navigationOptions = ({ navigation }) => ({
});
export default ReceiveDetails;
-
-const styles = StyleSheet.create({
- modalContent: {
- backgroundColor: '#FFFFFF',
- padding: 22,
- justifyContent: 'center',
- alignItems: 'center',
- borderTopLeftRadius: 16,
- borderTopRightRadius: 16,
- borderColor: 'rgba(0, 0, 0, 0.1)',
- minHeight: 350,
- height: 350,
- },
- bottomModal: {
- justifyContent: 'flex-end',
- margin: 0,
- },
- customAmount: {
- flexDirection: 'row',
- borderColor: '#d2d2d2',
- borderBottomColor: '#d2d2d2',
- borderWidth: 1.0,
- borderBottomWidth: 0.5,
- backgroundColor: '#f5f5f5',
- minHeight: 44,
- height: 44,
- marginHorizontal: 20,
- alignItems: 'center',
- marginVertical: 8,
- borderRadius: 4,
- },
- customAmountText: {
- flex: 1,
- marginHorizontal: 8,
- color: '#81868e',
- minHeight: 33,
- },
- root: {
- flex: 1,
- },
- scroll: {
- justifyContent: 'space-between',
- },
- scrollBody: {
- marginTop: 32,
- alignItems: 'center',
- paddingHorizontal: 16,
- },
- amount: {
- color: '#0c2550',
- fontWeight: '600',
- fontSize: 36,
- textAlign: 'center',
- paddingBottom: 24,
- },
- label: {
- color: '#0c2550',
- fontWeight: '600',
- textAlign: 'center',
- paddingBottom: 24,
- },
- loading: {
- alignItems: 'center',
- width: 300,
- height: 300,
- },
- share: {
- alignItems: 'center',
- alignContent: 'flex-end',
- marginBottom: 24,
- },
-});
diff --git a/screen/selftest.js b/screen/selftest.js
index 0be1ef21f..d5111909f 100644
--- a/screen/selftest.js
+++ b/screen/selftest.js
@@ -1,8 +1,9 @@
import React, { Component } from 'react';
import { ScrollView, View, StyleSheet } from 'react-native';
-import { BlueLoading, BlueSpacing20, SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle } from '../BlueComponents';
+import { BlueSpacing20, SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle, BlueLoadingHook } from '../BlueComponents';
import PropTypes from 'prop-types';
import { SegwitP2SHWallet, LegacyWallet, HDSegwitP2SHWallet, HDSegwitBech32Wallet } from '../class';
+import { BlueCurrentTheme } from '../components/themes';
const bitcoin = require('bitcoinjs-lib');
const BlueCrypto = require('react-native-blue-crypto');
const encryption = require('../blue_modules/encryption');
@@ -11,6 +12,7 @@ const BlueElectrum = require('../blue_modules/BlueElectrum');
const styles = StyleSheet.create({
root: {
flex: 1,
+ backgroundColor: BlueCurrentTheme.colors.background,
},
center: {
alignItems: 'center',
@@ -18,11 +20,6 @@ const styles = StyleSheet.create({
});
export default class Selftest extends Component {
- static navigationOptions = () => ({
- ...BlueNavigationStyle(),
- title: 'Self test',
- });
-
constructor(props) {
super(props);
this.state = {
@@ -213,7 +210,7 @@ export default class Selftest extends Component {
render() {
if (this.state.isLoading) {
- return ;
+ return ;
}
return (
@@ -261,3 +258,8 @@ Selftest.propTypes = {
goBack: PropTypes.func,
}),
};
+
+Selftest.navigationOptions = () => ({
+ ...BlueNavigationStyle(),
+ title: 'Self test',
+});
diff --git a/screen/send/broadcast.js b/screen/send/broadcast.js
index 119f41df9..5812e1a77 100644
--- a/screen/send/broadcast.js
+++ b/screen/send/broadcast.js
@@ -12,7 +12,9 @@ import {
BlueFormLabel,
BlueTextCentered,
BlueBigCheckmark,
+ BlueNavigationStyle,
} from '../../BlueComponents';
+import { BlueCurrentTheme } from '../../components/themes';
import BlueElectrum from '../../blue_modules/BlueElectrum';
const bitcoin = require('bitcoinjs-lib');
@@ -23,7 +25,7 @@ const BROADCAST_RESULT = Object.freeze({
error: 'error',
});
-export default function Broadcast() {
+const Broadcast = () => {
const [tx, setTx] = useState('');
const [txHex, setTxHex] = useState('');
const [broadcastResult, setBroadcastResult] = useState(BROADCAST_RESULT.none);
@@ -72,7 +74,7 @@ export default function Broadcast() {
/>
-
+
)}
{BROADCAST_RESULT.success === broadcastResult && }
@@ -80,7 +82,13 @@ export default function Broadcast() {
);
-}
+};
+
+export default Broadcast;
+Broadcast.navigationOptions = () => ({
+ ...BlueNavigationStyle(),
+ title: 'Broadcast',
+});
const styles = StyleSheet.create({
wrapper: {
@@ -101,7 +109,7 @@ const styles = StyleSheet.create({
width: '100%',
},
link: {
- color: 'blue',
+ color: BlueCurrentTheme.colors.foregroundColor,
},
mainCard: {
padding: 0,
@@ -128,7 +136,7 @@ const styles = StyleSheet.create({
backgroundColor: '#d2f8d6',
borderRadius: 4,
marginTop: 20,
- color: '#37c0a1',
+ color: BlueCurrentTheme.colors.foregroundColor,
fontWeight: '500',
fontSize: 14,
paddingHorizontal: 16,
diff --git a/screen/send/confirm.js b/screen/send/confirm.js
index 0fa5abba9..52e62a706 100644
--- a/screen/send/confirm.js
+++ b/screen/send/confirm.js
@@ -17,20 +17,15 @@ import {
SegwitP2SHWallet,
SegwitBech32Wallet,
} from '../../class';
+import { BlueCurrentTheme } from '../../components/themes';
const loc = require('../../loc');
const EV = require('../../blue_modules/events');
const currency = require('../../blue_modules/currency');
const BlueElectrum = require('../../blue_modules/BlueElectrum');
const Bignumber = require('bignumber.js');
/** @type {AppStorage} */
-const BlueApp = require('../../BlueApp');
export default class Confirm extends Component {
- static navigationOptions = () => ({
- ...BlueNavigationStyle(null, false),
- title: loc.send.confirm.header,
- });
-
constructor(props) {
super(props);
@@ -207,19 +202,19 @@ export default class Confirm extends Component {
const styles = StyleSheet.create({
transactionDetailsTitle: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
fontWeight: '500',
fontSize: 17,
marginBottom: 2,
},
transactionDetailsSubtitle: {
- color: '#9aa0aa',
+ color: BlueCurrentTheme.colors.feeText,
fontWeight: '500',
fontSize: 15,
marginBottom: 20,
},
transactionAmountFiat: {
- color: '#9aa0aa',
+ color: BlueCurrentTheme.colors.feeText,
fontWeight: '500',
fontSize: 15,
marginVertical: 20,
@@ -230,12 +225,12 @@ const styles = StyleSheet.create({
justifyContent: 'center',
},
valueValue: {
- color: '#0f5cc0',
+ color: BlueCurrentTheme.colors.alternativeTextColor2,
fontSize: 36,
fontWeight: '600',
},
valueUnit: {
- color: '#0f5cc0',
+ color: BlueCurrentTheme.colors.alternativeTextColor2,
fontSize: 16,
marginHorizontal: 4,
paddingBottom: 6,
@@ -248,19 +243,18 @@ const styles = StyleSheet.create({
marginVertical: 8,
},
separator: {
- backgroundColor: BlueApp.settings.inputBorderColor,
height: 0.5,
margin: 16,
},
root: {
flex: 1,
paddingTop: 19,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
rootWrap: {
marginTop: 16,
alignItems: 'center',
justifyContent: 'space-between',
- backgroundColor: '#FFFFFF',
},
flat: {
maxHeight: '55%',
@@ -270,7 +264,6 @@ const styles = StyleSheet.create({
justifyContent: 'center',
paddingTop: 16,
paddingBottom: 16,
- backgroundColor: '#FFFFFF',
},
cardText: {
color: '#37c0a1',
@@ -284,7 +277,7 @@ const styles = StyleSheet.create({
marginVertical: 24,
},
txText: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.buttonTextColor,
fontSize: 15,
fontWeight: '500',
alignSelf: 'center',
@@ -301,3 +294,8 @@ Confirm.propTypes = {
params: PropTypes.object,
}),
};
+
+Confirm.navigationOptions = () => ({
+ ...BlueNavigationStyle(null, false),
+ title: loc.send.confirm.header,
+});
diff --git a/screen/send/create.js b/screen/send/create.js
index a0bb50927..ce9c40eec 100644
--- a/screen/send/create.js
+++ b/screen/send/create.js
@@ -22,31 +22,11 @@ import { BitcoinUnit } from '../../models/bitcoinUnits';
import { Icon } from 'react-native-elements';
import Share from 'react-native-share';
import RNFS from 'react-native-fs';
-/** @type {AppStorage} */
-const BlueApp = require('../../BlueApp');
+import { BlueCurrentTheme } from '../../components/themes';
const loc = require('../../loc');
const currency = require('../../blue_modules/currency');
export default class SendCreate extends Component {
- static navigationOptions = ({ navigation, route }) => {
- let headerRight;
- if (route.params.exportTXN) {
- headerRight = () => (
-
-
-
- );
- } else {
- headerRight = null;
- }
-
- return {
- ...BlueNavigationStyle,
- title: loc.send.create.details,
- headerRight,
- };
- };
-
constructor(props) {
super(props);
console.log('send/create constructor');
@@ -183,13 +163,13 @@ export default class SendCreate extends Component {
const styles = StyleSheet.create({
transactionDetailsTitle: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.feeText,
fontWeight: '500',
fontSize: 17,
marginBottom: 2,
},
transactionDetailsSubtitle: {
- color: '#9aa0aa',
+ color: BlueCurrentTheme.colors.foregroundColor,
fontWeight: '500',
fontSize: 15,
marginBottom: 20,
@@ -201,20 +181,21 @@ const styles = StyleSheet.create({
alignSelf: 'flex-end',
},
separator: {
- backgroundColor: BlueApp.settings.inputBorderColor,
+ backgroundColor: BlueCurrentTheme.colors.inputBorderColor,
height: 0.5,
marginVertical: 16,
},
root: {
flex: 1,
paddingTop: 19,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
card: {
alignItems: 'center',
flex: 1,
},
cardText: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
fontWeight: '500',
},
cardTx: {
@@ -251,3 +232,22 @@ SendCreate.propTypes = {
params: PropTypes.object,
}),
};
+
+SendCreate.navigationOptions = ({ navigation, route }) => {
+ let headerRight;
+ if (route.params.exportTXN) {
+ headerRight = () => (
+
+
+
+ );
+ } else {
+ headerRight = null;
+ }
+
+ return {
+ ...BlueNavigationStyle,
+ title: loc.send.create.details,
+ headerRight,
+ };
+};
diff --git a/screen/send/details.js b/screen/send/details.js
index 8fba292c1..24ffb48d5 100644
--- a/screen/send/details.js
+++ b/screen/send/details.js
@@ -40,6 +40,7 @@ import { BitcoinTransaction } from '../../models/bitcoinTransactionInfo';
import DocumentPicker from 'react-native-document-picker';
import RNFS from 'react-native-fs';
import DeeplinkSchemaMatch from '../../class/deeplink-schema-match';
+import { BlueCurrentTheme } from '../../components/themes';
const bitcoin = require('bitcoinjs-lib');
const currency = require('../../blue_modules/currency');
const BigNumber = require('bignumber.js');
@@ -53,34 +54,36 @@ const styles = StyleSheet.create({
loading: {
flex: 1,
paddingTop: 20,
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.background,
},
root: {
flex: 1,
justifyContent: 'space-between',
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
scrollViewContent: {
flexWrap: 'wrap',
flexDirection: 'row',
},
modalContent: {
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.modal,
padding: 22,
justifyContent: 'center',
alignItems: 'center',
borderTopLeftRadius: 16,
borderTopRightRadius: 16,
- borderColor: 'rgba(0, 0, 0, 0.1)',
+ borderTopColor: BlueCurrentTheme.colors.borderTopColor,
+ borderWidth: BlueCurrentTheme.colors.borderWidth,
minHeight: 200,
height: 200,
},
advancedTransactionOptionsModalContent: {
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.modal,
padding: 22,
borderTopLeftRadius: 16,
borderTopRightRadius: 16,
- borderColor: 'rgba(0, 0, 0, 0.1)',
+ borderTopColor: BlueCurrentTheme.colors.borderTopColor,
+ borderWidth: BlueCurrentTheme.colors.borderWidth,
minHeight: 130,
},
bottomModal: {
@@ -88,7 +91,7 @@ const styles = StyleSheet.create({
margin: 0,
},
feeSliderInput: {
- backgroundColor: '#d2f8d6',
+ backgroundColor: BlueCurrentTheme.colors.feeLabel,
minWidth: 127,
height: 60,
borderRadius: 8,
@@ -98,7 +101,7 @@ const styles = StyleSheet.create({
},
feeSliderText: {
fontWeight: '600',
- color: '#37c0a1',
+ color: BlueCurrentTheme.colors.feeValue,
marginBottom: 0,
marginRight: 4,
textAlign: 'right',
@@ -106,7 +109,7 @@ const styles = StyleSheet.create({
},
feeSliderUnit: {
fontWeight: '600',
- color: '#37c0a1',
+ color: BlueCurrentTheme.colors.feeValue,
paddingRight: 4,
textAlign: 'left',
fontSize: 16,
@@ -137,7 +140,6 @@ const styles = StyleSheet.create({
marginHorizontal: 56,
marginVertical: 16,
alignContent: 'center',
- backgroundColor: '#FFFFFF',
minHeight: 44,
},
select: {
@@ -159,21 +161,22 @@ const styles = StyleSheet.create({
marginVertical: 4,
},
selectLabel: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.buttonTextColor,
fontSize: 14,
},
of: {
alignSelf: 'flex-end',
marginRight: 18,
marginVertical: 8,
+ color: BlueCurrentTheme.colors.feeText,
},
memo: {
flexDirection: 'row',
- borderColor: '#d2d2d2',
- borderBottomColor: '#d2d2d2',
+ borderColor: BlueCurrentTheme.colors.formBorder,
+ borderBottomColor: BlueCurrentTheme.colors.formBorder,
borderWidth: 1,
borderBottomWidth: 0.5,
- backgroundColor: '#f5f5f5',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
minHeight: 44,
height: 44,
marginHorizontal: 20,
@@ -194,11 +197,11 @@ const styles = StyleSheet.create({
alignItems: 'center',
},
feeLabel: {
- color: '#81868e',
+ color: BlueCurrentTheme.colors.feeText,
fontSize: 14,
},
feeRow: {
- backgroundColor: '#d2f8d6',
+ backgroundColor: BlueCurrentTheme.colors.feeLabel,
minWidth: 40,
height: 25,
borderRadius: 4,
@@ -208,24 +211,19 @@ const styles = StyleSheet.create({
paddingHorizontal: 10,
},
feeValue: {
- color: '#37c0a1',
+ color: BlueCurrentTheme.colors.feeValue,
marginBottom: 0,
marginRight: 4,
textAlign: 'right',
},
feeUnit: {
- color: '#37c0a1',
+ color: BlueCurrentTheme.colors.feeValue,
paddingRight: 4,
textAlign: 'left',
},
});
export default class SendDetails extends Component {
- static navigationOptions = ({ navigation, route }) => ({
- ...BlueCreateTxNavigationStyle(navigation, route.params.withAdvancedOptionsMenuButton, route.params.advancedOptionsMenuButtonAction),
- title: loc.send.header,
- });
-
state = { isLoading: true };
constructor(props) {
@@ -1082,3 +1080,8 @@ SendDetails.propTypes = {
}),
}),
};
+
+SendDetails.navigationOptions = ({ navigation, route }) => ({
+ ...BlueCreateTxNavigationStyle(navigation, route.params.withAdvancedOptionsMenuButton, route.params.advancedOptionsMenuButtonAction),
+ title: loc.send.header,
+});
diff --git a/screen/send/psbtWithHardwareWallet.js b/screen/send/psbtWithHardwareWallet.js
index 5e80e73fb..11d89d71b 100644
--- a/screen/send/psbtWithHardwareWallet.js
+++ b/screen/send/psbtWithHardwareWallet.js
@@ -17,6 +17,7 @@ import {
import Clipboard from '@react-native-community/clipboard';
import {
BlueButton,
+ SecondButton,
BlueText,
SafeBlueArea,
BlueCard,
@@ -34,6 +35,7 @@ import RNFS from 'react-native-fs';
import DocumentPicker from 'react-native-document-picker';
import { decodeUR, extractSingleWorkload } from 'bc-ur/dist';
import { Psbt } from 'bitcoinjs-lib';
+import { BlueCurrentTheme } from '../../components/themes';
const loc = require('../../loc');
const EV = require('../../blue_modules/events');
const BlueElectrum = require('../../blue_modules/BlueElectrum');
@@ -45,6 +47,7 @@ const { height, width } = Dimensions.get('window');
const styles = StyleSheet.create({
root: {
flex: 1,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
scrollViewContent: {
flexGrow: 1,
@@ -86,15 +89,15 @@ const styles = StyleSheet.create({
flex: 1,
},
hexLabel: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
fontWeight: '500',
},
hexInput: {
- borderColor: '#ebebeb',
- backgroundColor: '#d2f8d6',
+ borderColor: BlueCurrentTheme.colors.formBorder,
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
borderRadius: 4,
marginTop: 20,
- color: '#37c0a1',
+ color: BlueCurrentTheme.colors.foregroundColor,
fontWeight: '500',
fontSize: 14,
paddingHorizontal: 16,
@@ -105,7 +108,7 @@ const styles = StyleSheet.create({
marginVertical: 24,
},
hexText: {
- color: '#9aa0aa',
+ color: BlueCurrentTheme.colors.foregroundColor,
fontSize: 15,
fontWeight: '500',
alignSelf: 'center',
@@ -117,11 +120,6 @@ const styles = StyleSheet.create({
});
export default class PsbtWithHardwareWallet extends Component {
- static navigationOptions = () => ({
- ...BlueNavigationStyle(null, false),
- title: loc.send.header,
- });
-
cameraRef = null;
_onReadUniformResource = ur => {
@@ -319,7 +317,7 @@ export default class PsbtWithHardwareWallet extends Component {
Verify on coinb.in
-
+
);
@@ -394,36 +392,36 @@ export default class PsbtWithHardwareWallet extends Component {
- This is partially signed bitcoin transaction (PSBT). Please finish signing it with your hardware wallet.
+ This is a partially signed bitcoin transaction (PSBT). Please finish signing it with your hardware wallet.
- this.setState({ renderScanner: true, animatedQRCodeData: [] })}
title="Scan Signed Transaction"
/>
-
- ({
+ ...BlueNavigationStyle(null, false),
+ title: loc.send.header,
+});
diff --git a/screen/send/success.js b/screen/send/success.js
index fe28ed773..c0b10bb87 100644
--- a/screen/send/success.js
+++ b/screen/send/success.js
@@ -6,12 +6,14 @@ import { Text } from 'react-native-elements';
import { BlueButton, SafeBlueArea, BlueCard } from '../../BlueComponents';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import PropTypes from 'prop-types';
+import { BlueCurrentTheme } from '../../components/themes';
const loc = require('../../loc');
const styles = StyleSheet.create({
root: {
flex: 1,
paddingTop: 19,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
amout: {
alignItems: 'center',
@@ -24,12 +26,12 @@ const styles = StyleSheet.create({
paddingBottom: 16,
},
amountValue: {
- color: '#0f5cc0',
+ color: BlueCurrentTheme.colors.alternativeTextColor2,
fontSize: 36,
fontWeight: '600',
},
amountUnit: {
- color: '#0f5cc0',
+ color: BlueCurrentTheme.colors.alternativeTextColor2,
fontSize: 16,
marginHorizontal: 4,
paddingBottom: 6,
@@ -61,11 +63,6 @@ const styles = StyleSheet.create({
});
export default class Success extends Component {
- static navigationOptions = {
- headerShown: false,
- gesturesEnabled: false,
- };
-
constructor(props) {
super(props);
console.log('send/success constructor');
@@ -103,7 +100,26 @@ export default class Success extends Component {
)}
-
+
{
const [isAdancedModeEnabled, setIsAdancedModeEnabled] = useState(false);
const [isHandoffUseEnabled, setIsHandoffUseEnabled] = useState(false);
const { navigate } = useNavigation();
+ const { colors } = useTheme();
const onAdvancedModeSwitch = async value => {
await BlueApp.setIsAdancedModeEnabled(value);
setIsAdancedModeEnabled(value);
@@ -37,46 +37,59 @@ const GeneralSettings = () => {
})();
});
+ const stylesWithThemeHook = {
+ root: {
+ ...styles.root,
+ backgroundColor: colors.background,
+ },
+ scroll: {
+ ...styles.scroll,
+ backgroundColor: colors.background,
+ },
+ scrollBody: {
+ ...styles.scrollBody,
+ backgroundColor: colors.background,
+ },
+ };
+
return isLoading ? (
) : (
-
-
- {BlueApp.getWallets().length > 1 && (
- <>
- navigate('DefaultView')} title="On Launch" chevron />
- >
- )}
- {Platform.OS === 'ios' ? (
- <>
-
-
-
- When enabled, you will be able to view selected wallets, and transactions, using your other Apple iCloud connected devices.
-
-
-
- >
- ) : null}
-
-
-
- When enabled, you will see advanced options such as different wallet types, the ability to specify the LNDHub instance you wish
- to connect to and custom entropy during wallet creation.
-
-
-
-
-
+
+ {BlueApp.getWallets().length > 1 && (
+ <>
+ navigate('DefaultView')} title="On Launch" chevron />
+ >
+ )}
+ {Platform.OS === 'ios' ? (
+ <>
+
+
+
+ When enabled, you will be able to view selected wallets, and transactions, using your other Apple iCloud connected devices.
+
+
+
+ >
+ ) : null}
+
+
+
+ When enabled, you will see advanced options such as different wallet types, the ability to specify the LNDHub instance you wish to
+ connect to and custom entropy during wallet creation.
+
+
+
+
);
};
@@ -85,12 +98,4 @@ GeneralSettings.navigationOptions = () => ({
title: 'General',
});
-GeneralSettings.propTypes = {
- navigation: PropTypes.shape({
- navigate: PropTypes.func,
- popToTop: PropTypes.func,
- goBack: PropTypes.func,
- }),
-};
-
export default GeneralSettings;
diff --git a/screen/settings/NetworkSettings.js b/screen/settings/NetworkSettings.js
index 27429adc7..551e42492 100644
--- a/screen/settings/NetworkSettings.js
+++ b/screen/settings/NetworkSettings.js
@@ -1,42 +1,48 @@
import React, { useEffect, useState } from 'react';
-import { ScrollView, TouchableOpacity, StyleSheet } from 'react-native';
-import { BlueNavigationStyle, BlueLoading, SafeBlueArea, BlueListItem } from '../../BlueComponents';
-import { useNavigation } from '@react-navigation/native';
+import { ScrollView, StyleSheet } from 'react-native';
+import { SafeBlueArea, BlueListItemHooks, BlueNavigationStyle, BlueLoadingHook } from '../../BlueComponents';
+import { useNavigation, useTheme } from '@react-navigation/native';
const loc = require('../../loc');
-
-const styles = StyleSheet.create({
- root: {
- flex: 1,
- },
-});
-
const NetworkSettings = () => {
const [isLoading, setIsLoading] = useState(true);
const { navigate } = useNavigation();
+ const { colors } = useTheme();
+ const styles = StyleSheet.create({
+ root: {
+ flex: 1,
+ backgroundColor: colors.background,
+ },
+ });
useEffect(() => {
setIsLoading(false);
}, []);
+ const navigateToElectrumSettings = () => {
+ navigate('ElectrumSettings');
+ };
+
+ const navigateToLightningSettings = () => {
+ navigate('LightningSettings');
+ };
+
+ const navigateToBroadcast = () => {
+ navigate('Broadcast');
+ };
return isLoading ? (
-
+
) : (
- navigate('ElectrumSettings')} chevron />
- navigate('LightningSettings')}
- chevron
- />
- navigate('Broadcast')} chevron />
+
+
+
);
};
-NetworkSettings.navigationOptions = {
+NetworkSettings.navigationOptions = () => ({
...BlueNavigationStyle(),
title: 'Network',
-};
+});
export default NetworkSettings;
diff --git a/screen/settings/about.js b/screen/settings/about.js
index 5021d21fe..53ad3e3aa 100644
--- a/screen/settings/about.js
+++ b/screen/settings/about.js
@@ -1,15 +1,15 @@
import React, { useEffect, useState } from 'react';
import { ScrollView, Linking, Dimensions, Image, View, Text, StyleSheet } from 'react-native';
-import { useNavigation } from '@react-navigation/native';
+import { useNavigation, useTheme } from '@react-navigation/native';
import {
BlueTextCentered,
- BlueLoading,
BlueSpacing20,
BlueButton,
SafeBlueArea,
BlueCard,
+ BlueListItemHooks,
BlueNavigationStyle,
- BlueListItem,
+ BlueLoadingHook,
} from '../../BlueComponents';
import { getApplicationName, getVersion, getBundleId, getBuildNumber } from 'react-native-device-info';
import Rate, { AndroidMarket } from 'react-native-rate';
@@ -17,46 +17,46 @@ import Rate, { AndroidMarket } from 'react-native-rate';
const { width, height } = Dimensions.get('window');
const loc = require('../../loc/');
-const styles = StyleSheet.create({
- root: {
- flex: 1,
- },
- center: {
- justifyContent: 'center',
- alignItems: 'center',
- marginTop: 54,
- },
- logo: {
- width: 102,
- height: 124,
- },
- textFree: {
- maxWidth: 260,
- marginVertical: 24,
- color: '#9AA0AA',
- fontSize: 15,
- textAlign: 'center',
- fontWeight: '500',
- },
- textBackup: {
- maxWidth: 260,
- marginBottom: 40,
- color: '#0C2550',
- fontSize: 15,
- textAlign: 'center',
- fontWeight: '500',
- },
- buildWith: {
- backgroundColor: '#f9f9f9',
- padding: 16,
- paddingTop: 0,
- borderRadius: 8,
- },
-});
-
const About = () => {
const [isLoading, setIsLoading] = useState(true);
const { navigate } = useNavigation();
+ const { colors } = useTheme();
+ const styles = StyleSheet.create({
+ root: {
+ flex: 1,
+ },
+ center: {
+ justifyContent: 'center',
+ alignItems: 'center',
+ marginTop: 54,
+ },
+ logo: {
+ width: 102,
+ height: 124,
+ },
+ textFree: {
+ maxWidth: 260,
+ marginVertical: 24,
+ color: '#9AA0AA',
+ fontSize: 15,
+ textAlign: 'center',
+ fontWeight: '500',
+ },
+ textBackup: {
+ maxWidth: 260,
+ marginBottom: 40,
+ color: colors.foregroundColor,
+ fontSize: 15,
+ textAlign: 'center',
+ fontWeight: '500',
+ },
+ buildWith: {
+ backgroundColor: colors.inputBackgroundColor,
+ padding: 16,
+ paddingTop: 0,
+ borderRadius: 8,
+ },
+ });
useEffect(() => {
setIsLoading(false);
@@ -103,7 +103,7 @@ const About = () => {
};
return isLoading ? (
-
+
) : (
@@ -115,7 +115,7 @@ const About = () => {
- {
onPress={handleOnTwitterPress}
title="Follow us on Twitter"
/>
- {
onPress={handleOnTelegramPress}
title="Telegram chat"
/>
- {
Electrum server
- {
onPress={handleOnReleaseNotesPress}
title="Release notes"
/>
-
- {
About.navigationOptions = () => ({
...BlueNavigationStyle(),
- title: loc.settings.about,
+ headerTitle: loc.settings.about,
});
export default About;
diff --git a/screen/settings/currency.js b/screen/settings/currency.js
index 5db59df8e..499386aa7 100644
--- a/screen/settings/currency.js
+++ b/screen/settings/currency.js
@@ -1,28 +1,31 @@
import React, { useState, useEffect } from 'react';
import { FlatList, TouchableOpacity, ActivityIndicator, View, StyleSheet } from 'react-native';
-import { SafeBlueArea, BlueNavigationStyle, BlueListItem, BlueText, BlueCard } from '../../BlueComponents';
+import { SafeBlueArea, BlueListItemHooks, BlueTextHooks, BlueCard, BlueNavigationStyle } from '../../BlueComponents';
import PropTypes from 'prop-types';
import { Icon } from 'react-native-elements';
import { FiatUnit } from '../../models/fiatUnit';
+import { useTheme } from '@react-navigation/native';
const loc = require('../../loc');
const currency = require('../../blue_modules/currency');
const data = Object.values(FiatUnit);
-const styles = StyleSheet.create({
- flex: {
- flex: 1,
- },
- activity: {
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
- },
-});
-
const Currency = () => {
const [isSavingNewPreferredCurrency, setIsSavingNewPreferredCurrency] = useState(false);
const [selectedCurrency, setSelectedCurrency] = useState(null);
+ const { colors } = useTheme();
+ const styles = StyleSheet.create({
+ flex: {
+ flex: 1,
+ backgroundColor: colors.background,
+ },
+ activity: {
+ flex: 1,
+ justifyContent: 'center',
+ alignItems: 'center',
+ backgroundColor: colors.background,
+ },
+ });
useEffect(() => {
const fetchCurrency = async () => {
@@ -49,7 +52,7 @@ const Currency = () => {
extraData={data}
renderItem={({ item }) => {
return (
- {
}}
/>
- Prices are obtained from CoinDesk
+ Prices are obtained from CoinDesk
);
diff --git a/screen/settings/defaultView.js b/screen/settings/defaultView.js
index 795523ef0..17b5922d3 100644
--- a/screen/settings/defaultView.js
+++ b/screen/settings/defaultView.js
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
-import { TouchableOpacity, View, TouchableWithoutFeedback, StyleSheet } from 'react-native';
-import { SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle, BlueListItem } from '../../BlueComponents';
+import { View, TouchableWithoutFeedback, StyleSheet } from 'react-native';
+import { SafeBlueArea, BlueCard, BlueNavigationStyle, BlueListItemHooks, BlueTextHooks } from '../../BlueComponents';
import OnAppLaunch from '../../class/on-app-launch';
import { useNavigation } from '@react-navigation/native';
const BlueApp = require('../../BlueApp');
@@ -56,7 +56,7 @@ const DefaultView = () => {
return (
- {
}}
/>
- When disabled, BlueWallet will immediately open the selected wallet at launch.
+ When disabled, BlueWallet will immediately open the selected wallet at launch.
{!viewAllWalletsEnabled && (
-
+
)}
diff --git a/screen/settings/electrumSettings.js b/screen/settings/electrumSettings.js
index 5d38cd503..37ce6e276 100644
--- a/screen/settings/electrumSettings.js
+++ b/screen/settings/electrumSettings.js
@@ -4,8 +4,9 @@ import { View, TextInput, StyleSheet } from 'react-native';
import { AppStorage } from '../../class';
import AsyncStorage from '@react-native-community/async-storage';
import { ScrollView } from 'react-native-gesture-handler';
-import { BlueLoading, BlueSpacing20, BlueButton, SafeBlueArea, BlueCard, BlueNavigationStyle, BlueText } from '../../BlueComponents';
-import PropTypes from 'prop-types';
+import { BlueLoading, BlueSpacing20, BlueButton, SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle } from '../../BlueComponents';
+import { BlueCurrentTheme } from '../../components/themes';
+
const loc = require('../../loc');
const BlueElectrum = require('../../blue_modules/BlueElectrum');
@@ -15,7 +16,7 @@ const styles = StyleSheet.create({
},
status: {
textAlign: 'center',
- color: '#9AA0AA',
+ color: BlueCurrentTheme.colors.feeText,
marginBottom: 4,
},
connectWrap: {
@@ -33,13 +34,13 @@ const styles = StyleSheet.create({
borderRadius: 20,
},
containerConnected: {
- backgroundColor: '#D2F8D6',
+ backgroundColor: BlueCurrentTheme.colors.feeLabel,
},
containerDisconnected: {
backgroundColor: '#F8D2D2',
},
textConnected: {
- color: '#37C0A1',
+ color: BlueCurrentTheme.colors.feeValue,
fontWeight: 'bold',
},
textDisconnected: {
@@ -48,19 +49,19 @@ const styles = StyleSheet.create({
},
hostname: {
textAlign: 'center',
- color: '#0C2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
},
explain: {
- color: '#9AA0AA',
+ color: BlueCurrentTheme.colors.feeText,
marginBottom: -24,
},
inputWrap: {
flexDirection: 'row',
- borderColor: '#d2d2d2',
- borderBottomColor: '#d2d2d2',
+ borderColor: BlueCurrentTheme.colors.formBorder,
+ borderBottomColor: BlueCurrentTheme.colors.formBorder,
borderWidth: 1,
borderBottomWidth: 0.5,
- backgroundColor: '#f5f5f5',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
minHeight: 44,
height: 44,
alignItems: 'center',
@@ -76,11 +77,6 @@ const styles = StyleSheet.create({
});
export default class ElectrumSettings extends Component {
- static navigationOptions = () => ({
- ...BlueNavigationStyle(),
- title: loc.settings.electrum_settings,
- });
-
constructor(props) {
super(props);
this.state = {
@@ -223,9 +219,7 @@ export default class ElectrumSettings extends Component {
}
}
-ElectrumSettings.propTypes = {
- navigation: PropTypes.shape({
- navigate: PropTypes.func,
- goBack: PropTypes.func,
- }),
-};
+ElectrumSettings.navigationOptions = () => ({
+ ...BlueNavigationStyle(),
+ title: loc.settings.electrum_settings,
+});
diff --git a/screen/settings/encryptStorage.js b/screen/settings/encryptStorage.js
index 97251f9dc..f305bf340 100644
--- a/screen/settings/encryptStorage.js
+++ b/screen/settings/encryptStorage.js
@@ -1,106 +1,100 @@
/* global alert */
-import React, { Component } from 'react';
+import React, { useEffect, useState, useCallback } from 'react';
import { ScrollView, Alert, Platform, TouchableOpacity, TouchableWithoutFeedback, StyleSheet } from 'react-native';
import {
- BlueLoading,
- BlueHeaderDefaultSub,
- BlueListItem,
+ BlueLoadingHook,
SafeBlueArea,
- BlueNavigationStyle,
BlueSpacing20,
BlueCard,
- BlueText,
+ BlueListItemHooks,
+ BlueHeaderDefaultSubHooks,
+ BlueTextHooks,
+ BlueNavigationStyle,
} from '../../BlueComponents';
-import PropTypes from 'prop-types';
import { AppStorage } from '../../class';
+import { useNavigation, StackActions } from '@react-navigation/native';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import Biometric from '../../class/biometrics';
+import { colors } from 'react-native-elements';
const BlueApp: AppStorage = require('../../BlueApp');
const prompt = require('../../blue_modules/prompt');
const loc = require('../../loc');
-const styles = StyleSheet.create({
- root: {
- flex: 1,
- },
-});
-
-export default class EncryptStorage extends Component {
- static navigationOptions = () => ({
- ...BlueNavigationStyle(),
- title: 'Security',
+const EncryptStorage = () => {
+ const [isLoading, setIsLoading] = useState(true);
+ const [deleteWalletsAfterUninstall, setDeleteWalletsAfterUninstall] = useState(false);
+ const [biometrics, setBiometrics] = useState({ isDeviceBiometricCapable: false, isBiometricsEnabled: false, biometricsType: '' });
+ const [storageIsEncrypted, setStorageIsEncrypted] = useState(false);
+ const { navigate, dispatch } = useNavigation();
+ const styles = StyleSheet.create({
+ root: {
+ flex: 1,
+ backgroundColor: colors.background,
+ },
});
- constructor(props) {
- super(props);
- this.state = {
- isLoading: true,
- language: loc.getLanguage(),
- deleteWalletsAfterUninstall: false,
- biometrics: { isDeviceBiometricCapable: false, isBiometricsEnabled: false, biometricsType: '' },
- };
- }
-
- async componentDidMount() {
+ const initialState = useCallback(async () => {
const isBiometricsEnabled = await Biometric.isBiometricUseEnabled();
const isDeviceBiometricCapable = await Biometric.isDeviceBiometricCapable();
const biometricsType = (await Biometric.biometricType()) || 'biometrics';
- this.setState({
- isLoading: false,
- advancedModeEnabled: await BlueApp.isAdancedModeEnabled(),
- storageIsEncrypted: await BlueApp.storageIsEncrypted(),
- deleteWalletsAfterUninstall: await BlueApp.isDeleteWalletAfterUninstallEnabled(),
- biometrics: { isBiometricsEnabled, isDeviceBiometricCapable, biometricsType },
- });
- }
+ const deleteWalletsAfterUninstall = await BlueApp.isDeleteWalletAfterUninstallEnabled();
+ const isStorageEncrypted = await BlueApp.storageIsEncrypted();
+ setBiometrics(biometrics);
+ setStorageIsEncrypted(isStorageEncrypted);
+ setDeleteWalletsAfterUninstall(deleteWalletsAfterUninstall);
+ setBiometrics({ isBiometricsEnabled, isDeviceBiometricCapable, biometricsType });
+ setIsLoading(false);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+ useEffect(() => {
+ initialState();
+ }, [initialState]);
- decryptStorage = async () => {
+ const decryptStorage = useCallback(async () => {
const password = await prompt(loc.settings.password, loc._.storage_is_encrypted).catch(() => {
- this.setState({ isLoading: false });
+ setIsLoading(false);
});
try {
await BlueApp.decryptStorage(password);
- this.props.navigation.popToTop();
+ dispatch(StackActions.popToTop());
} catch (e) {
if (password) {
alert(loc._.bad_password);
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
}
- this.setState({
- isLoading: false,
- storageIsEncrypted: await BlueApp.storageIsEncrypted(),
- deleteWalletAfterUninstall: await BlueApp.isDeleteWalletAfterUninstallEnabled(),
- });
+
+ setIsLoading(false);
+ setStorageIsEncrypted(await BlueApp.storageIsEncrypted());
+ setDeleteWalletsAfterUninstall(await BlueApp.isDeleteWalletAfterUninstallEnabled());
}
- };
+ }, [dispatch]);
- onDeleteWalletsAfterUninstallSwitch = async value => {
+ const onDeleteWalletsAfterUninstallSwitch = useCallback(async value => {
await BlueApp.setResetOnAppUninstallTo(value);
- this.setState({ deleteWalletsAfterUninstall: value });
- };
+ setDeleteWalletsAfterUninstall(value);
+ }, []);
- onEncryptStorageSwitch = value => {
- this.setState({ isLoading: true }, async () => {
+ const onEncryptStorageSwitch = useCallback(
+ async value => {
+ setIsLoading(true);
if (value === true) {
let p1 = await prompt(loc.settings.password, loc.settings.password_explain).catch(() => {
- this.setState({ isLoading: false });
+ setIsLoading(false);
p1 = undefined;
});
if (!p1) {
- this.setState({ isLoading: false });
+ setIsLoading(false);
return;
}
const p2 = await prompt(loc.settings.password, loc.settings.retype_password).catch(() => {
- this.setState({ isLoading: false });
+ setIsLoading(false);
});
if (p1 === p2) {
await BlueApp.encryptStorage(p1);
- this.setState({
- isLoading: false,
- storageIsEncrypted: await BlueApp.storageIsEncrypted(),
- });
+ setIsLoading(false);
+ setStorageIsEncrypted(await BlueApp.storageIsEncrypted());
} else {
- this.setState({ isLoading: false });
+ setIsLoading(false);
alert(loc.settings.passwords_do_not_match);
}
} else {
@@ -111,93 +105,100 @@ export default class EncryptStorage extends Component {
{
text: loc.send.details.cancel,
style: 'cancel',
- onPress: () => this.setState({ isLoading: false }),
+ onPress: () => setIsLoading(false),
},
{
text: loc._.ok,
style: 'destructive',
- onPress: this.decryptStorage,
+ onPress: decryptStorage,
},
],
{ cancelable: false },
);
}
- });
+ },
+ [decryptStorage],
+ );
+
+ const onUseBiometricSwitch = useCallback(
+ async value => {
+ const isBiometricsEnabled = {
+ isDeviceBiometricCapable: biometrics.isDeviceBiometricCapable,
+ isBiometricsEnabled: biometrics.isBiometricsEnabled,
+ biometricsType: biometrics.biometricsType,
+ };
+ if (await Biometric.unlockWithBiometrics()) {
+ isBiometricsEnabled.isBiometricsEnabled = value;
+ await Biometric.setBiometricUseEnabled(value);
+ setBiometrics(isBiometricsEnabled);
+ }
+ },
+ [biometrics],
+ );
+
+ const navigateToPlausibleDeniability = () => {
+ navigate('PlausibleDeniability');
};
- onUseBiometricSwitch = async value => {
- const isBiometricsEnabled = this.state.biometrics;
- if (await Biometric.unlockWithBiometrics()) {
- isBiometricsEnabled.isBiometricsEnabled = value;
- await Biometric.setBiometricUseEnabled(value);
- this.setState({ biometrics: isBiometricsEnabled });
- }
- };
-
- render() {
- if (this.state.isLoading) {
- return ;
- }
-
- return (
-
-
- {this.state.biometrics.isDeviceBiometricCapable && (
- <>
-
-
-
-
- {this.state.biometrics.biometricsType} will be used to confirm your identity prior to making a transaction, unlocking,
- exporting or deleting a wallet. {this.state.biometrics.biometricsType} will not be used to unlock an encrypted storage.
-
-
-
- >
- )}
-
-
- {Platform.OS === 'ios' && (
-
+
+
+ ) : (
+
+
+ {biometrics.isDeviceBiometricCapable && (
+ <>
+
+
- )}
- {this.state.storageIsEncrypted && (
- this.props.navigation.navigate('PlausibleDeniability')}
- disabled={!this.state.storageIsEncrypted}
- title={loc.settings.plausible_deniability}
- chevron
- testID="PlausibleDeniabilityButton"
- Component={TouchableOpacity}
- />
- )}
-
-
- );
- }
-}
-
-EncryptStorage.propTypes = {
- navigation: PropTypes.shape({
- navigate: PropTypes.func,
- popToTop: PropTypes.func,
- goBack: PropTypes.func,
- }),
+
+
+ {biometrics.biometricsType} will be used to confirm your identity prior to making a transaction, unlocking, exporting or
+ deleting a wallet. {biometrics.biometricsType} will not be used to unlock an encrypted storage.
+
+
+
+ >
+ )}
+
+
+ {Platform.OS === 'ios' && (
+
+ )}
+ {storageIsEncrypted && (
+
+ )}
+
+
+ );
};
+
+export default EncryptStorage;
+EncryptStorage.navigationOptions = () => ({
+ ...BlueNavigationStyle(),
+ headerTitle: 'Security',
+});
diff --git a/screen/settings/language.js b/screen/settings/language.js
index f1f709c53..2116048f6 100644
--- a/screen/settings/language.js
+++ b/screen/settings/language.js
@@ -1,81 +1,59 @@
-import React, { Component } from 'react';
+import React, { useState, useEffect, useCallback } from 'react';
import { FlatList, StyleSheet } from 'react-native';
-import { BlueLoading, BlueText, SafeBlueArea, BlueListItem, BlueCard, BlueNavigationStyle } from '../../BlueComponents';
-import PropTypes from 'prop-types';
+import { SafeBlueArea, BlueListItemHooks, BlueCard, BlueLoadingHook, BlueNavigationStyle, BlueTextHooks } from '../../BlueComponents';
import { Icon } from 'react-native-elements';
import { AvailableLanguages } from '../../loc/languages';
const loc = require('../../loc');
-const styles = StyleSheet.create({
- flex: {
- flex: 1,
- },
-});
-
-export default class Language extends Component {
- static navigationOptions = () => ({
- ...BlueNavigationStyle(),
- title: loc.settings.language,
+const Language = () => {
+ const [isLoading, setIsLoading] = useState(true);
+ const [language, setLanguage] = useState(loc.getLanguage());
+ const styles = StyleSheet.create({
+ flex: {
+ flex: 1,
+ },
});
- constructor(props) {
- super(props);
- this.state = {
- isLoading: true,
- language: loc.getLanguage(),
- availableLanguages: AvailableLanguages,
- };
- }
+ useEffect(() => {
+ setIsLoading(false);
+ }, []);
- async componentDidMount() {
- this.setState({
- isLoading: false,
- });
- }
-
- renderItem = ({ item }) => {
- return (
- {
- console.log('setLanguage', item.value);
- loc.saveLanguage(item.value);
- return this.setState({ language: item.value });
- }}
- title={item.label}
- {...(this.state.language === item.value
- ? {
- rightIcon: ,
- }
- : { hideChevron: true })}
- />
- );
- };
-
- render() {
- if (this.state.isLoading) {
- return ;
- }
-
- return (
-
- `${index}`}
- data={this.state.availableLanguages}
- extraData={this.state.availableLanguages}
- renderItem={this.renderItem}
+ const renderItem = useCallback(
+ ({ item }) => {
+ return (
+ {
+ console.log('setLanguage', item.value);
+ loc.saveLanguage(item.value);
+ setLanguage(item.value);
+ }}
+ title={item.label}
+ {...(language === item.value
+ ? {
+ rightIcon: ,
+ }
+ : { hideChevron: true })}
/>
-
- When selecting a new language, restarting BlueWallet may be required for the change to take effect.
-
-
- );
- }
-}
+ );
+ },
+ [language],
+ );
-Language.propTypes = {
- navigation: PropTypes.shape({
- navigate: PropTypes.func,
- goBack: PropTypes.func,
- }),
+ return isLoading ? (
+
+ ) : (
+
+ `${index}`} data={AvailableLanguages} renderItem={renderItem} />
+
+ When selecting a new language, restarting BlueWallet may be required for the change to take effect.
+
+
+ );
};
+
+Language.navigationOptions = () => ({
+ ...BlueNavigationStyle(),
+ headerTitle: loc.settings.language,
+});
+
+export default Language;
diff --git a/screen/settings/licensing.js b/screen/settings/licensing.js
index 39af6124d..bd6dc5053 100644
--- a/screen/settings/licensing.js
+++ b/screen/settings/licensing.js
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';
import { ScrollView, StyleSheet } from 'react-native';
-import { BlueLoading, SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle, BlueSpacing20 } from '../../BlueComponents';
+import { SafeBlueArea, BlueCard, BlueTextHooks, BlueNavigationStyle, BlueSpacing20, BlueLoadingHook } from '../../BlueComponents';
/** @type {AppStorage} */
const styles = StyleSheet.create({
@@ -17,34 +17,34 @@ const Licensing = () => {
}, []);
return isLoading ? (
-
+
) : (
- MIT License
+ MIT License
- Copyright (c) 2018-2020 BlueWallet Services
+ Copyright (c) 2018-2020 BlueWallet Services
-
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
-
+
-
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
+
-
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+
diff --git a/screen/settings/lightningSettings.js b/screen/settings/lightningSettings.js
index 6705971ac..e44bc62bb 100644
--- a/screen/settings/lightningSettings.js
+++ b/screen/settings/lightningSettings.js
@@ -1,14 +1,22 @@
/* global alert */
-import React, { Component } from 'react';
+import React, { useState, useEffect, useCallback } from 'react';
import { View, TextInput, Linking, StyleSheet } from 'react-native';
import { AppStorage } from '../../class';
import AsyncStorage from '@react-native-community/async-storage';
-import { BlueLoading, BlueSpacing20, BlueButton, SafeBlueArea, BlueCard, BlueNavigationStyle, BlueText } from '../../BlueComponents';
-import PropTypes from 'prop-types';
+import {
+ BlueSpacing20,
+ BlueButton,
+ SafeBlueArea,
+ BlueCard,
+ BlueNavigationStyle,
+ BlueLoadingHook,
+ BlueTextHooks,
+} from '../../BlueComponents';
import { Button } from 'react-native-elements';
import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
-/** @type {AppStorage} */
-const BlueApp = require('../../BlueApp');
+import { useTheme } from '@react-navigation/native';
+import { BlueCurrentTheme } from '../../components/themes';
+
const loc = require('../../loc');
const styles = StyleSheet.create({
@@ -17,11 +25,11 @@ const styles = StyleSheet.create({
},
uri: {
flexDirection: 'row',
- borderColor: '#d2d2d2',
- borderBottomColor: '#d2d2d2',
+ borderColor: BlueCurrentTheme.colors.formBorder,
+ borderBottomColor: BlueCurrentTheme.colors.formBorder,
borderWidth: 1,
borderBottomWidth: 0.5,
- backgroundColor: '#f5f5f5',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
minHeight: 44,
height: 44,
alignItems: 'center',
@@ -39,94 +47,80 @@ const styles = StyleSheet.create({
},
});
-export default class LightningSettings extends Component {
- static navigationOptions = () => ({
- ...BlueNavigationStyle(),
- title: loc.settings.lightning_settings,
- });
+const LightningSettings = () => {
+ const [isLoading, setIsLoading] = useState(true);
+ const [URI, setURI] = useState();
+ const { colors } = useTheme();
- constructor(props) {
- super(props);
- this.state = {
- isLoading: true,
- };
- }
+ useEffect(() => {
+ AsyncStorage.getItem(AppStorage.LNDHUB)
+ .then(setURI)
+ .then(() => setIsLoading(false))
+ .catch(() => setIsLoading(false));
+ }, []);
- async componentDidMount() {
- const URI = await AsyncStorage.getItem(AppStorage.LNDHUB);
-
- this.setState({
- isLoading: false,
- URI,
- });
- }
-
- save = () => {
- this.setState({ isLoading: true }, async () => {
- this.state.URI = this.state.URI ? this.state.URI : '';
- try {
- if (this.state.URI) {
- await LightningCustodianWallet.isValidNodeAddress(this.state.URI);
- // validating only if its not empty. empty means use default
- }
- await AsyncStorage.setItem(AppStorage.LNDHUB, this.state.URI);
- alert('Your changes have been saved successfully');
- } catch (error) {
- alert('Not a valid LndHub URI');
- console.log(error);
+ const save = useCallback(async () => {
+ setIsLoading(true);
+ try {
+ if (URI) {
+ await LightningCustodianWallet.isValidNodeAddress(URI);
+ // validating only if its not empty. empty means use default
}
- this.setState({ isLoading: false });
- });
- };
+ await AsyncStorage.setItem(AppStorage.LNDHUB, URI);
+ alert('Your changes have been saved successfully');
+ } catch (error) {
+ alert('Not a valid LndHub URI');
+ console.log(error);
+ }
+ setIsLoading(false);
+ }, [URI]);
- render() {
- return (
-
-
- {loc.settings.lightning_settings_explain}
-
+ return (
+
+
+ {loc.settings.lightning_settings_explain}
+
-
- );
- }
-}
-
-LightningSettings.propTypes = {
- navigation: PropTypes.shape({
- navigate: PropTypes.func,
- goBack: PropTypes.func,
- }),
+
+ {isLoading ? : }
+
+
+ );
};
+
+LightningSettings.navigationOptions = () => ({
+ ...BlueNavigationStyle(),
+ title: loc.settings.lightning_settings,
+});
+export default LightningSettings;
diff --git a/screen/settings/releasenotes.js b/screen/settings/releasenotes.js
index 12cb7cec8..2a4204eb2 100644
--- a/screen/settings/releasenotes.js
+++ b/screen/settings/releasenotes.js
@@ -1,29 +1,31 @@
import React, { useState, useEffect } from 'react';
import { ScrollView, StyleSheet } from 'react-native';
-import { BlueLoading, SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle } from '../../BlueComponents';
+import { SafeBlueArea, BlueCard, BlueNavigationStyle, BlueLoadingHook, BlueTextHooks } from '../../BlueComponents';
+import { useTheme } from '@react-navigation/native';
/** @type {AppStorage} */
-const styles = StyleSheet.create({
- root: {
- flex: 1,
- },
-});
-
const ReleaseNotes = () => {
const [isLoading, setIsLoading] = useState(true);
const notes = require('../../release-notes');
+ const { colors } = useTheme();
+ const styles = StyleSheet.create({
+ root: {
+ flex: 1,
+ backgroundColor: colors.background,
+ },
+ });
useEffect(() => {
setIsLoading(false);
}, []);
return isLoading ? (
-
+
) : (
- {notes}
+ {notes}
diff --git a/screen/settings/settings.js b/screen/settings/settings.js
index fe58fc025..44f675062 100644
--- a/screen/settings/settings.js
+++ b/screen/settings/settings.js
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
-import { ScrollView, TouchableOpacity, StyleSheet } from 'react-native';
-import { BlueNavigationStyle, BlueLoading, SafeBlueArea, BlueHeaderDefaultSub, BlueListItem } from '../../BlueComponents';
+import { ScrollView, TouchableOpacity, StyleSheet, StatusBar } from 'react-native';
+import { BlueLoading, BlueListItemHooks, BlueHeaderDefaultSubHooks } from '../../BlueComponents';
import { useNavigation } from '@react-navigation/native';
const loc = require('../../loc');
@@ -21,32 +21,29 @@ const Settings = () => {
return isLoading ? (
) : (
-
-
-
- navigate('GeneralSettings')} chevron />
- navigate('Currency')} chevron />
- navigate('Language')} chevron />
- navigate('EncryptStorage')}
- component={TouchableOpacity}
- testID="SecurityButton"
- chevron
- />
- navigate('NetworkSettings')} chevron />
- navigate('About')}
- testID="AboutButton"
- chevron
- />
-
-
+
+
+
+ navigate('GeneralSettings')} chevron />
+ navigate('Currency')} chevron />
+ navigate('Language')} chevron />
+ navigate('EncryptStorage')}
+ component={TouchableOpacity}
+ testID="SecurityButton"
+ chevron
+ />
+ navigate('NetworkSettings')} chevron />
+ navigate('About')}
+ testID="AboutButton"
+ chevron
+ />
+
);
};
-Settings.navigationOptions = {
- ...BlueNavigationStyle,
-};
+
export default Settings;
diff --git a/screen/transactions/CPFP.js b/screen/transactions/CPFP.js
index aa64f789d..6710ffa31 100644
--- a/screen/transactions/CPFP.js
+++ b/screen/transactions/CPFP.js
@@ -79,11 +79,6 @@ const styles = StyleSheet.create({
});
export default class CPFP extends Component {
- static navigationOptions = () => ({
- ...BlueNavigationStyle(null, false),
- title: 'Bump fee (CPFP)',
- });
-
constructor(props) {
super(props);
let txid;
@@ -276,3 +271,7 @@ CPFP.propTypes = {
}),
}),
};
+CPFP.navigationOptions = () => ({
+ ...BlueNavigationStyle(null, false),
+ title: 'Bump fee (CPFP)',
+});
diff --git a/screen/transactions/RBFBumpFee.js b/screen/transactions/RBFBumpFee.js
index b9d14c803..818537e79 100644
--- a/screen/transactions/RBFBumpFee.js
+++ b/screen/transactions/RBFBumpFee.js
@@ -16,11 +16,6 @@ const styles = StyleSheet.create({
});
export default class RBFBumpFee extends CPFP {
- static navigationOptions = () => ({
- ...BlueNavigationStyle(null, false),
- title: 'Bump fee (RBF)',
- });
-
async componentDidMount() {
console.log('transactions/RBFBumpFee - componentDidMount');
this.setState({
@@ -125,3 +120,8 @@ RBFBumpFee.propTypes = {
}),
}),
};
+
+RBFBumpFee.navigationOptions = () => ({
+ ...BlueNavigationStyle(null, false),
+ title: 'Bump fee (RBF)',
+});
diff --git a/screen/transactions/RBFCancel.js b/screen/transactions/RBFCancel.js
index 546c77721..88ed4b6af 100644
--- a/screen/transactions/RBFCancel.js
+++ b/screen/transactions/RBFCancel.js
@@ -16,11 +16,6 @@ const styles = StyleSheet.create({
});
export default class RBFCancel extends CPFP {
- static navigationOptions = () => ({
- ...BlueNavigationStyle(null, false),
- title: 'Cancel this transaction (RBF)',
- });
-
async componentDidMount() {
console.log('transactions/RBFCancel - componentDidMount');
this.setState({
@@ -130,3 +125,8 @@ RBFCancel.propTypes = {
}),
}),
};
+
+RBFCancel.navigationOptions = () => ({
+ ...BlueNavigationStyle(null, false),
+ title: 'Cancel this transaction (RBF)',
+});
diff --git a/screen/transactions/details.js b/screen/transactions/details.js
index ea6b1d314..1203ceb49 100644
--- a/screen/transactions/details.js
+++ b/screen/transactions/details.js
@@ -5,7 +5,6 @@ import {
SafeBlueArea,
BlueCard,
BlueText,
- BlueHeaderDefaultSub,
BlueLoading,
BlueSpacing20,
BlueCopyToClipboardButton,
@@ -14,6 +13,7 @@ import {
import HandoffSettings from '../../class/handoff';
import Handoff from 'react-native-handoff';
import PropTypes from 'prop-types';
+import { BlueCurrentTheme } from '../../components/themes';
/** @type {AppStorage} */
const BlueApp = require('../../BlueApp');
const loc = require('../../loc');
@@ -36,6 +36,7 @@ const styles = StyleSheet.create({
fontSize: 16,
fontWeight: '500',
marginBottom: 4,
+ color: BlueCurrentTheme.colors.foregroundColor,
},
rowValue: {
marginBottom: 26,
@@ -44,6 +45,7 @@ const styles = StyleSheet.create({
txId: {
fontSize: 16,
fontWeight: '500',
+ color: BlueCurrentTheme.colors.foregroundColor,
},
txHash: {
marginBottom: 8,
@@ -51,16 +53,29 @@ const styles = StyleSheet.create({
},
txLink: {
marginBottom: 26,
- color: '#2f5fb3',
+ color: BlueCurrentTheme.colors.alternativeTextColor2,
},
save: {
marginHorizontal: 16,
justifyContent: 'center',
alignItems: 'center',
},
+ saveText: {
+ color: BlueCurrentTheme.colors.alternativeTextColor2,
+ },
memoTextInput: {
- fontSize: 24,
- color: '#2f5fb3',
+ flexDirection: 'row',
+ borderColor: BlueCurrentTheme.colors.formBorder,
+ borderBottomColor: BlueCurrentTheme.colors.formBorder,
+ borderWidth: 1,
+ borderBottomWidth: 0.5,
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
+ minHeight: 44,
+ height: 44,
+ alignItems: 'center',
+ marginVertical: 8,
+ borderRadius: 4,
+ paddingHorizontal: 8,
},
});
@@ -79,16 +94,6 @@ function arrDiff(a1, a2) {
}
export default class TransactionsDetails extends Component {
- static navigationOptions = ({ navigation, route }) => ({
- ...BlueNavigationStyle(),
- title: '',
- headerRight: () => (
-
- {loc.wallets.details.save}
-
- ),
- });
-
constructor(props) {
super(props);
const hash = props.route.params.hash;
@@ -160,7 +165,6 @@ export default class TransactionsDetails extends Component {
return (
-
{this.state.isHandOffUseEnabled && (
)}
-
+
@@ -276,3 +280,17 @@ TransactionsDetails.propTypes = {
setParams: PropTypes.func,
}),
};
+
+TransactionsDetails.navigationOptions = ({ navigation, route }) => ({
+ ...BlueNavigationStyle(),
+ title: loc.transactions.details.title,
+ headerStyle: {
+ ...BlueNavigationStyle().headerStyle,
+ backgroundColor: BlueCurrentTheme.colors.customHeader,
+ },
+ headerRight: () => (
+
+ {loc.wallets.details.save}
+
+ ),
+});
diff --git a/screen/transactions/transactionStatus.js b/screen/transactions/transactionStatus.js
index 7a1926075..53fe5ac59 100644
--- a/screen/transactions/transactionStatus.js
+++ b/screen/transactions/transactionStatus.js
@@ -18,6 +18,7 @@ import { BitcoinUnit } from '../../models/bitcoinUnits';
import { Icon } from 'react-native-elements';
import Handoff from 'react-native-handoff';
import HandoffSettings from '../../class/handoff';
+import { BlueCurrentTheme } from '../../components/themes';
/** @type {AppStorage} */
const BlueApp = require('../../BlueApp');
const loc = require('../../loc');
@@ -40,12 +41,12 @@ const styles = StyleSheet.create({
alignItems: 'center',
},
value: {
- color: '#2f5fb3',
+ color: BlueCurrentTheme.colors.alternativeTextColor2,
fontSize: 36,
fontWeight: '600',
},
valueUnit: {
- color: '#2f5fb3',
+ color: BlueCurrentTheme.colors.alternativeTextColor2,
fontSize: 16,
fontWeight: '600',
},
@@ -58,7 +59,7 @@ const styles = StyleSheet.create({
fontSize: 14,
},
iconRoot: {
- backgroundColor: '#ccddf9',
+ backgroundColor: BlueCurrentTheme.colors.success,
width: 120,
height: 120,
borderRadius: 60,
@@ -94,7 +95,7 @@ const styles = StyleSheet.create({
},
confirmations: {
borderRadius: 11,
- backgroundColor: '#eef0f4',
+ backgroundColor: BlueCurrentTheme.colors.lightButton,
width: 109,
height: 21,
alignSelf: 'center',
@@ -132,11 +133,6 @@ const styles = StyleSheet.create({
});
export default class TransactionsStatus extends Component {
- static navigationOptions = () => ({
- ...BlueNavigationStyle(),
- title: '',
- });
-
constructor(props) {
super(props);
const hash = props.route.params.hash;
@@ -251,7 +247,6 @@ export default class TransactionsStatus extends Component {
return (
-
{this.state.isHandOffUseEnabled && (
)}
+
@@ -285,7 +281,7 @@ export default class TransactionsStatus extends Component {
-
+
{(() => {
@@ -436,3 +432,12 @@ TransactionsStatus.propTypes = {
params: PropTypes.object,
}),
};
+
+TransactionsStatus.navigationOptions = () => ({
+ ...BlueNavigationStyle(),
+ title: '',
+ headerStyle: {
+ ...BlueNavigationStyle().headerStyle,
+ backgroundColor: BlueCurrentTheme.colors.customHeader,
+ },
+});
diff --git a/screen/wallets/add.js b/screen/wallets/add.js
index b0bb872e2..efc557390 100644
--- a/screen/wallets/add.js
+++ b/screen/wallets/add.js
@@ -22,14 +22,13 @@ import {
BitcoinButton,
BlueFormLabel,
BlueButton,
- SafeBlueArea,
BlueNavigationStyle,
BlueButtonLink,
BlueSpacing20,
} from '../../BlueComponents';
import PropTypes from 'prop-types';
import { HDSegwitBech32Wallet, SegwitP2SHWallet, HDSegwitP2SHWallet, LightningCustodianWallet, AppStorage } from '../../class';
-
+import { BlueCurrentTheme } from '../../components/themes';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { Icon } from 'react-native-elements';
const EV = require('../../blue_modules/events');
@@ -41,14 +40,15 @@ const styles = StyleSheet.create({
loading: {
flex: 1,
paddingTop: 20,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
label: {
flexDirection: 'row',
- borderColor: '#d2d2d2',
- borderBottomColor: '#d2d2d2',
+ borderColor: BlueCurrentTheme.colors.formBorder,
+ borderBottomColor: BlueCurrentTheme.colors.formBorder,
borderWidth: 1,
borderBottomWidth: 0.5,
- backgroundColor: '#f5f5f5',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
minHeight: 44,
height: 44,
marginHorizontal: 20,
@@ -86,16 +86,16 @@ const styles = StyleSheet.create({
marginHorizontal: 20,
},
advancedText: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.feeText,
fontWeight: '500',
},
lndUri: {
flexDirection: 'row',
- borderColor: '#d2d2d2',
- borderBottomColor: '#d2d2d2',
+ borderColor: BlueCurrentTheme.colors.formBorder,
+ borderBottomColor: BlueCurrentTheme.colors.formBorder,
borderWidth: 1,
borderBottomWidth: 0.5,
- backgroundColor: '#f5f5f5',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
minHeight: 44,
height: 44,
alignItems: 'center',
@@ -113,6 +113,10 @@ const styles = StyleSheet.create({
},
noPadding: {
paddingHorizontal: 0,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
+ },
+ root: {
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
});
@@ -181,251 +185,250 @@ export default class WalletsAdd extends Component {
}
return (
-
-
-
-
- {loc.wallets.add.wallet_name}
-
- {
- this.setLabel(text);
- }}
- style={styles.textInputCommon}
- editable={!this.state.isLoading}
- underlineColorAndroid="transparent"
- />
-
- {loc.wallets.add.wallet_type}
+
+
+
+
+ {loc.wallets.add.wallet_name}
+
+ {
+ this.setLabel(text);
+ }}
+ style={styles.textInputCommon}
+ editable={!this.state.isLoading}
+ underlineColorAndroid="transparent"
+ />
+
+ {loc.wallets.add.wallet_type}
-
- {
- Keyboard.dismiss();
- this.setState({
- activeBitcoin: true,
- activeLightning: false,
- });
- }}
- style={styles.button}
- />
-
- {loc.wallets.add.or}
-
- {
- Keyboard.dismiss();
- this.setState({
- activeBitcoin: false,
- activeLightning: true,
- });
- }}
- style={styles.button}
- />
+
+ {
+ Keyboard.dismiss();
+ this.setState({
+ activeBitcoin: true,
+ activeLightning: false,
+ });
+ }}
+ style={styles.button}
+ />
+
+ {loc.wallets.add.or}
+ {
+ Keyboard.dismiss();
+ this.setState({
+ activeBitcoin: false,
+ activeLightning: true,
+ });
+ }}
+ style={styles.button}
+ />
+
-
- {(() => {
- if (this.state.activeBitcoin && this.state.isAdvancedOptionsEnabled) {
- return (
-
-
- {loc.settings.advanced_options}
- {
- this.onSelect(0, HDSegwitBech32Wallet.type);
+
+ {(() => {
+ if (this.state.activeBitcoin && this.state.isAdvancedOptionsEnabled) {
+ return (
+
+
+ {loc.settings.advanced_options}
+ {
+ this.onSelect(0, HDSegwitBech32Wallet.type);
+ }}
+ title={HDSegwitBech32Wallet.typeReadable}
+ {...(this.state.selectedIndex === 0
+ ? {
+ rightIcon: ,
+ }
+ : { hideChevron: true })}
+ />
+ {
+ this.onSelect(1, SegwitP2SHWallet.type);
+ }}
+ title={SegwitP2SHWallet.typeReadable}
+ {...(this.state.selectedIndex === 1
+ ? {
+ rightIcon: ,
+ }
+ : { hideChevron: true })}
+ />
+ {
+ this.onSelect(2, HDSegwitP2SHWallet.typeReadable.type);
+ }}
+ title={HDSegwitP2SHWallet.typeReadable}
+ {...(this.state.selectedIndex === 2
+ ? {
+ rightIcon: ,
+ }
+ : { hideChevron: true })}
+ />
+
+ );
+ } else if (this.state.activeLightning && this.state.isAdvancedOptionsEnabled) {
+ return (
+ <>
+
+ {loc.settings.advanced_options}
+
+ Connect to your LNDHub
+
+ {
+ this.setState({ walletBaseURI: text });
}}
- title={HDSegwitBech32Wallet.typeReadable}
- {...(this.state.selectedIndex === 0
- ? {
- rightIcon: ,
- }
- : { hideChevron: true })}
- />
- {
- this.onSelect(1, SegwitP2SHWallet.type);
- }}
- title={SegwitP2SHWallet.typeReadable}
- {...(this.state.selectedIndex === 1
- ? {
- rightIcon: ,
- }
- : { hideChevron: true })}
- />
- {
- this.onSelect(2, HDSegwitP2SHWallet.typeReadable.type);
- }}
- title={HDSegwitP2SHWallet.typeReadable}
- {...(this.state.selectedIndex === 2
- ? {
- rightIcon: ,
- }
- : { hideChevron: true })}
+ onSubmitEditing={Keyboard.dismiss}
+ placeholder="your node address"
+ clearButtonMode="while-editing"
+ autoCapitalize="none"
+ placeholderTextColor="#81868e"
+ style={styles.textInputCommon}
+ editable={!this.state.isLoading}
+ underlineColorAndroid="transparent"
/>
- );
- } else if (this.state.activeLightning && this.state.isAdvancedOptionsEnabled) {
- return (
- <>
-
- {loc.settings.advanced_options}
-
- Connect to your LNDHub
-
- {
- this.setState({ walletBaseURI: text });
- }}
- onSubmitEditing={Keyboard.dismiss}
- placeholder="your node address"
- clearButtonMode="while-editing"
- autoCapitalize="none"
- placeholderTextColor="#81868e"
- style={styles.textInputCommon}
- editable={!this.state.isLoading}
- underlineColorAndroid="transparent"
- />
-
- >
- );
- } else if (this.state.activeBitcoin === undefined && this.state.isAdvancedOptionsEnabled) {
- return ;
- }
- })()}
-
- {!this.state.isLoading ? (
- {
- this.setState({ isLoading: true }, async () => {
- let w;
+ >
+ );
+ } else if (this.state.activeBitcoin === undefined && this.state.isAdvancedOptionsEnabled) {
+ return ;
+ }
+ })()}
+
+ {!this.state.isLoading ? (
+ {
+ this.setState({ isLoading: true }, async () => {
+ let w;
- if (this.state.activeLightning) {
- this.createLightningWallet = async () => {
- w = new LightningCustodianWallet();
- w.setLabel(this.state.label || loc.wallets.details.title);
+ if (this.state.activeLightning) {
+ this.createLightningWallet = async () => {
+ w = new LightningCustodianWallet();
+ w.setLabel(this.state.label || loc.wallets.details.title);
- try {
- const lndhub =
- this.state.walletBaseURI.trim().length > 0
- ? this.state.walletBaseURI
- : LightningCustodianWallet.defaultBaseUri;
- if (lndhub) {
- const isValidNodeAddress = await LightningCustodianWallet.isValidNodeAddress(lndhub);
- if (isValidNodeAddress) {
- w.setBaseURI(lndhub);
- w.init();
- } else {
- throw new Error('The provided node address is not valid LNDHub node.');
- }
+ try {
+ const lndhub =
+ this.state.walletBaseURI.trim().length > 0
+ ? this.state.walletBaseURI
+ : LightningCustodianWallet.defaultBaseUri;
+ if (lndhub) {
+ const isValidNodeAddress = await LightningCustodianWallet.isValidNodeAddress(lndhub);
+ if (isValidNodeAddress) {
+ w.setBaseURI(lndhub);
+ w.init();
+ } else {
+ throw new Error('The provided node address is not valid LNDHub node.');
}
- await w.createAccount();
- await w.authorize();
- } catch (Err) {
- this.setState({ isLoading: false });
- console.warn('lnd create failure', Err);
- return alert(Err);
- // giving app, not adding anything
}
- A(A.ENUM.CREATED_LIGHTNING_WALLET);
- await w.generate();
- BlueApp.wallets.push(w);
- await BlueApp.saveToDisk();
- EV(EV.enum.WALLETS_COUNT_CHANGED);
- A(A.ENUM.CREATED_WALLET);
- ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
- this.props.navigation.navigate('PleaseBackupLNDHub', {
- wallet: w,
- });
- };
- this.createLightningWallet();
- } else if (this.state.selectedIndex === 2) {
- // zero index radio - HD segwit
- w = new HDSegwitP2SHWallet();
- w.setLabel(this.state.label || loc.wallets.details.title);
- } else if (this.state.selectedIndex === 1) {
- // btc was selected
- // index 1 radio - segwit single address
- w = new SegwitP2SHWallet();
- w.setLabel(this.state.label || loc.wallets.details.title);
- } else {
- // btc was selected
- // index 2 radio - hd bip84
- w = new HDSegwitBech32Wallet();
- w.setLabel(this.state.label || loc.wallets.details.title);
- }
- if (this.state.activeBitcoin) {
- if (this.state.entropy) {
- try {
- await w.generateFromEntropy(this.state.entropy);
- } catch (e) {
- console.log(e.toString());
- alert(e.toString());
- this.props.navigation.goBack();
- return;
- }
- } else {
- await w.generate();
+ await w.createAccount();
+ await w.authorize();
+ } catch (Err) {
+ this.setState({ isLoading: false });
+ console.warn('lnd create failure', Err);
+ return alert(Err);
+ // giving app, not adding anything
}
+ A(A.ENUM.CREATED_LIGHTNING_WALLET);
+ await w.generate();
BlueApp.wallets.push(w);
await BlueApp.saveToDisk();
EV(EV.enum.WALLETS_COUNT_CHANGED);
A(A.ENUM.CREATED_WALLET);
ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
- if (w.type === HDSegwitP2SHWallet.type || w.type === HDSegwitBech32Wallet.type) {
- this.props.navigation.navigate('PleaseBackup', {
- secret: w.getSecret(),
- });
- } else {
+ this.props.navigation.navigate('PleaseBackupLNDHub', {
+ wallet: w,
+ });
+ };
+ this.createLightningWallet();
+ } else if (this.state.selectedIndex === 2) {
+ // zero index radio - HD segwit
+ w = new HDSegwitP2SHWallet();
+ w.setLabel(this.state.label || loc.wallets.details.title);
+ } else if (this.state.selectedIndex === 1) {
+ // btc was selected
+ // index 1 radio - segwit single address
+ w = new SegwitP2SHWallet();
+ w.setLabel(this.state.label || loc.wallets.details.title);
+ } else {
+ // btc was selected
+ // index 2 radio - hd bip84
+ w = new HDSegwitBech32Wallet();
+ w.setLabel(this.state.label || loc.wallets.details.title);
+ }
+ if (this.state.activeBitcoin) {
+ if (this.state.entropy) {
+ try {
+ await w.generateFromEntropy(this.state.entropy);
+ } catch (e) {
+ console.log(e.toString());
+ alert(e.toString());
this.props.navigation.goBack();
+ return;
}
+ } else {
+ await w.generate();
}
- });
- }}
- />
- ) : (
-
- )}
-
- {
- this.props.navigation.navigate('ImportWallet');
- }}
- />
- {this.state.isAdvancedOptionsEnabled && (
- {
- this.props.navigation.navigate('ProvideEntropy', { onGenerated: entropy => this.setState({ entropy }) });
+ BlueApp.wallets.push(w);
+ await BlueApp.saveToDisk();
+ EV(EV.enum.WALLETS_COUNT_CHANGED);
+ A(A.ENUM.CREATED_WALLET);
+ ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
+ if (w.type === HDSegwitP2SHWallet.type || w.type === HDSegwitBech32Wallet.type) {
+ this.props.navigation.navigate('PleaseBackup', {
+ secret: w.getSecret(),
+ });
+ } else {
+ this.props.navigation.goBack();
+ }
+ }
+ });
}}
/>
+ ) : (
+
)}
-
-
-
+ {
+ this.props.navigation.navigate('ImportWallet');
+ }}
+ />
+ {this.state.isAdvancedOptionsEnabled && (
+ {
+ this.props.navigation.navigate('ProvideEntropy', { onGenerated: entropy => this.setState({ entropy }) });
+ }}
+ />
+ )}
+
+
+
);
}
}
diff --git a/screen/wallets/buyBitcoin.js b/screen/wallets/buyBitcoin.js
index 98bb1af28..892f8ab42 100644
--- a/screen/wallets/buyBitcoin.js
+++ b/screen/wallets/buyBitcoin.js
@@ -14,12 +14,6 @@ const styles = StyleSheet.create({
});
export default class BuyBitcoin extends Component {
- static navigationOptions = ({ navigation }) => ({
- ...BlueNavigationStyle(navigation, true),
- title: '',
- headerLeft: null,
- });
-
constructor(props) {
super(props);
const wallet = props.route.params.wallet;
@@ -97,7 +91,7 @@ export default class BuyBitcoin extends Component {
return (
-
+
({
+ ...BlueNavigationStyle(navigation, true),
+ title: '',
+ headerLeft: null,
+});
diff --git a/screen/wallets/details.js b/screen/wallets/details.js
index 49ec761fa..35a661c51 100644
--- a/screen/wallets/details.js
+++ b/screen/wallets/details.js
@@ -16,7 +16,7 @@ import {
StyleSheet,
StatusBar,
} from 'react-native';
-import { BlueButton, SafeBlueArea, BlueCard, BlueSpacing20, BlueNavigationStyle, BlueText } from '../../BlueComponents';
+import { SecondButton, SafeBlueArea, BlueCard, BlueSpacing20, BlueNavigationStyle, BlueText } from '../../BlueComponents';
import PropTypes from 'prop-types';
import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
import { HDLegacyBreadwalletWallet } from '../../class/wallets/hd-legacy-breadwallet-wallet';
@@ -26,6 +26,7 @@ import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import Biometric from '../../class/biometrics';
import { HDSegwitBech32Wallet, SegwitP2SHWallet, LegacyWallet, SegwitBech32Wallet, WatchOnlyWallet } from '../../class';
import { ScrollView } from 'react-native-gesture-handler';
+import { BlueCurrentTheme } from '../../components/themes';
const EV = require('../../blue_modules/events');
const prompt = require('../../blue_modules/prompt');
/** @type {AppStorage} */
@@ -45,36 +46,36 @@ const styles = StyleSheet.create({
alignItems: 'center',
},
saveText: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.outputValue,
},
address: {
alignItems: 'center',
flex: 1,
},
textLabel1: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.feeText,
fontWeight: '500',
fontSize: 14,
marginVertical: 12,
},
textLabel2: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.feeText,
fontWeight: '500',
fontSize: 14,
marginVertical: 16,
},
textValue: {
- color: '#81868e',
+ color: BlueCurrentTheme.colors.outputValue,
fontWeight: '500',
fontSize: 14,
},
input: {
flexDirection: 'row',
- borderColor: '#d2d2d2',
- borderBottomColor: '#d2d2d2',
+ borderColor: BlueCurrentTheme.colors.formBorder,
+ borderBottomColor: BlueCurrentTheme.colors.formBorder,
borderWidth: 1,
borderBottomWidth: 0.5,
- backgroundColor: '#f5f5f5',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
minHeight: 44,
height: 44,
alignItems: 'center',
@@ -102,24 +103,6 @@ const styles = StyleSheet.create({
});
export default class WalletDetails extends Component {
- static navigationOptions = ({ navigation, route }) => ({
- ...BlueNavigationStyle(),
- title: loc.wallets.details.title,
- headerRight: () => (
- {
- if (route.params.saveAction) {
- route.params.saveAction();
- }
- }}
- >
- {loc.wallets.details.save}
-
- ),
- });
-
constructor(props) {
super(props);
@@ -200,7 +183,7 @@ export default class WalletDetails extends Component {
renderMarketplaceButton = () => {
return Platform.select({
android: (
-
this.props.navigation.navigate('Marketplace', {
fromWallet: this.state.wallet,
@@ -210,7 +193,7 @@ export default class WalletDetails extends Component {
/>
),
ios: (
- {
Linking.openURL('https://bluewallet.io/marketplace-btc/');
}}
@@ -230,7 +213,7 @@ export default class WalletDetails extends Component {
}
return (
-
+
@@ -309,7 +292,7 @@ export default class WalletDetails extends Component {
>
)}
-
this.props.navigation.navigate('WalletExport', {
wallet: this.state.wallet,
@@ -325,7 +308,7 @@ export default class WalletDetails extends Component {
this.state.wallet.type === HDSegwitBech32Wallet.type ||
this.state.wallet.type === HDSegwitP2SHWallet.type) && (
<>
-
this.props.navigation.navigate('WalletXpub', {
secret: this.state.wallet.getSecret(),
@@ -341,7 +324,7 @@ export default class WalletDetails extends Component {
{this.state.wallet.type !== LightningCustodianWallet.type && (
<>
- this.props.navigation.navigate('Broadcast')} title="Broadcast transaction" />
+ this.props.navigation.navigate('Broadcast')} title="Broadcast transaction" />
>
)}
@@ -397,6 +380,24 @@ export default class WalletDetails extends Component {
}
}
+WalletDetails.navigationOptions = ({ navigation, route }) => ({
+ ...BlueNavigationStyle(),
+ title: loc.wallets.details.title,
+ headerRight: () => (
+ {
+ if (route.params.saveAction) {
+ route.params.saveAction();
+ }
+ }}
+ >
+ {loc.wallets.details.save}
+
+ ),
+});
+
WalletDetails.propTypes = {
navigation: PropTypes.shape({
state: PropTypes.shape({
diff --git a/screen/wallets/export.js b/screen/wallets/export.js
index 562cbde80..dae56dbc1 100644
--- a/screen/wallets/export.js
+++ b/screen/wallets/export.js
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
import Privacy from '../../Privacy';
import Biometric from '../../class/biometrics';
import { LegacyWallet, LightningCustodianWallet, SegwitBech32Wallet, SegwitP2SHWallet, WatchOnlyWallet } from '../../class';
+import { BlueCurrentTheme } from '../../components/themes';
/** @type {AppStorage} */
const BlueApp = require('../../BlueApp');
const loc = require('../../loc');
@@ -18,6 +19,7 @@ const styles = StyleSheet.create({
},
root: {
flex: 1,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
scrollViewContent: {
alignItems: 'center',
@@ -27,24 +29,18 @@ const styles = StyleSheet.create({
type: {
fontSize: 17,
fontWeight: '700',
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
},
secret: {
alignItems: 'center',
paddingHorizontal: 16,
fontSize: 16,
- color: '#0C2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
lineHeight: 24,
},
});
export default class WalletExport extends Component {
- static navigationOptions = ({ navigation }) => ({
- ...BlueNavigationStyle(navigation, true),
- title: loc.wallets.export.title,
- headerLeft: null,
- });
-
constructor(props) {
super(props);
const wallet = props.route.params.wallet;
@@ -118,8 +114,9 @@ export default class WalletExport extends Component {
logo={require('../../img/qr-code.png')}
size={this.state.qrCodeHeight}
logoSize={70}
- color={BlueApp.settings.foregroundColor}
- logoBackgroundColor={BlueApp.settings.brandingColor}
+ color={BlueCurrentTheme.colors.foregroundColor}
+ logoBackgroundColor={BlueCurrentTheme.colors.brandingColor}
+ backgroundColor={BlueCurrentTheme.colors.background}
ecl="H"
/>
@@ -147,3 +144,8 @@ WalletExport.propTypes = {
}),
}),
};
+WalletExport.navigationOptions = ({ navigation }) => ({
+ ...BlueNavigationStyle(navigation, true),
+ title: loc.wallets.export.title,
+ headerLeft: null,
+});
diff --git a/screen/wallets/hodlHodl.js b/screen/wallets/hodlHodl.js
index b160e86ed..c2166b6f8 100644
--- a/screen/wallets/hodlHodl.js
+++ b/screen/wallets/hodlHodl.js
@@ -25,6 +25,7 @@ import Modal from 'react-native-modal';
import { Icon } from 'react-native-elements';
import { AppStorage } from '../../class';
import * as NavigationService from '../../NavigationService';
+import { BlueCurrentTheme } from '../../components/themes';
const BlueApp: AppStorage = require('../../BlueApp');
const A = require('../../blue_modules/analytics');
@@ -38,11 +39,6 @@ export default class HodlHodl extends Component {
constructor(props) {
super(props);
- props.navigation.setParams({
- handleLoginPress: this.handleLoginPress,
- displayLoginButton: true,
- handleMyContractsPress: this.handleMyContractsPress,
- });
this.state = {
HodlApi: false,
isLoading: true,
@@ -72,7 +68,7 @@ export default class HodlHodl extends Component {
this.setState({ HodlApi, hodlApiKey });
this.props.navigation.setParams({ displayLoginButton });
};
- NavigationService.navigate('HodlHodlRoot', { params: { cb: handleLoginCallback }, screen: 'HodlHodlLogin' });
+ NavigationService.navigate('HodlHodlLoginRoot', { params: { cb: handleLoginCallback }, screen: 'HodlHodlLogin' });
};
handleMyContractsPress = () => {
@@ -185,7 +181,11 @@ export default class HodlHodl extends Component {
const HodlApi = new HodlHodlApi(hodlApiKey);
this.setState({ HodlApi, hodlApiKey });
- this.props.navigation.setParams({ displayLoginButton });
+ this.props.navigation.setParams({
+ handleLoginPress: this.handleLoginPress,
+ displayLoginButton: displayLoginButton,
+ handleMyContractsPress: this.handleMyContractsPress,
+ });
try {
await this.fetchMyCountry();
@@ -204,16 +204,14 @@ export default class HodlHodl extends Component {
this.fetchListOfMethods();
}
- _onPress(item) {
+ _onPress = item => {
const offers = this.state.offers.filter(value => value.id === item.id);
if (offers && offers[0]) {
- NavigationService.navigate('HodlHodlViewOffer', {
- offerToDisplay: offers[0],
- });
+ this.props.navigation.navigate('HodlHodlViewOffer', { offerToDisplay: offers[0] });
} else {
Linking.openURL('https://hodlhodl.com/offers/' + item.id);
}
- }
+ };
_onCountryPress(item) {
this.setState(
@@ -716,7 +714,13 @@ export default class HodlHodl extends Component {
-
+
{this.state.isLoading ? (
) : (
@@ -732,7 +736,13 @@ export default class HodlHodl extends Component {
>
Filters
-
+
@@ -815,7 +825,7 @@ export default class HodlHodl extends Component {
render() {
return (
-
+
}
renderItem={this.renderItem}
@@ -848,7 +858,11 @@ HodlHodl.propTypes = {
HodlHodl.navigationOptions = ({ navigation, route }) => ({
...BlueNavigationStyle(navigation, true),
title: '',
- headerLeft: () => {
+ headerStyle: {
+ ...BlueNavigationStyle(navigation, true).headerStyle,
+ backgroundColor: BlueCurrentTheme.colors.customHeader,
+ },
+ headerRight: () => {
return route.params.displayLoginButton ? (
) : (
@@ -864,7 +878,7 @@ const styles = StyleSheet.create({
color: '#9AA0AA',
},
modalContent: {
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.elevated,
padding: 22,
justifyContent: 'center',
alignItems: 'center',
@@ -875,7 +889,7 @@ const styles = StyleSheet.create({
height: 400,
},
modalContentShort: {
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.elevated,
padding: 22,
justifyContent: 'center',
alignItems: 'center',
@@ -892,14 +906,14 @@ const styles = StyleSheet.create({
Title: {
fontWeight: 'bold',
fontSize: 30,
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
},
BottomLine: {
fontSize: 10,
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
},
grayDropdownTextContainer: {
- backgroundColor: '#EEF0F4',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
borderRadius: 20,
height: 35,
top: 3,
@@ -911,7 +925,7 @@ const styles = StyleSheet.create({
flexDirection: 'row',
},
grayTextContainerContainer: {
- backgroundColor: '#EEF0F4',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
borderRadius: 20,
height: 44,
justifyContent: 'center',
@@ -925,7 +939,7 @@ const styles = StyleSheet.create({
flexDirection: 'row',
},
blueText: {
- color: '#2f5fb3',
+ color: BlueCurrentTheme.colors.foregroundColor,
fontSize: 15,
fontWeight: '600',
},
@@ -939,17 +953,17 @@ const styles = StyleSheet.create({
locationText: {
top: 0,
left: 5,
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
fontSize: 20,
fontWeight: '500',
},
nicknameText: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
fontSize: 18,
fontWeight: '600',
},
blueTextContainer: {
- backgroundColor: '#CCDDF9',
+ backgroundColor: BlueCurrentTheme.colors.mainColor,
borderRadius: 20,
width: 110,
flex: 1,
@@ -963,11 +977,11 @@ const styles = StyleSheet.create({
},
searchInputContainer: {
flexDirection: 'row',
- borderColor: '#EEF0F4',
- borderBottomColor: '#EEF0F4',
+ borderColor: BlueCurrentTheme.colors.inputBackgroundColor,
+ borderBottomColor: BlueCurrentTheme.colors.inputBackgroundColor,
borderWidth: 1.0,
borderBottomWidth: 0.5,
- backgroundColor: '#EEF0F4',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
minHeight: 48,
height: 48,
marginHorizontal: 20,
@@ -997,40 +1011,44 @@ const styles = StyleSheet.create({
itemPrice: { fontWeight: '600', fontSize: 14, color: '#9AA0AA' },
minmax: { color: '#9AA0AA', fontSize: 12, paddingLeft: 10 },
noOffersWrapper: { height: '100%', justifyContent: 'center' },
- noOffersText: { textAlign: 'center', color: '#9AA0AA', paddingHorizontal: 16 },
+ noOffersText: { textAlign: 'center', color: BlueCurrentTheme.colors.feeText, paddingHorizontal: 16 },
modalFlatList: { width: '100%' },
- itemSeparator: { height: 0.5, width: '100%', backgroundColor: '#C8C8C8' },
- itemNameWrapper: { backgroundColor: 'white', flex: 1, flexDirection: 'row', paddingTop: 20, paddingBottom: 20 },
- itemNameBold: { fontSize: 20, color: '#0c2550', fontWeight: 'bold' },
- itemNameNormal: { fontSize: 20, color: '#0c2550', fontWeight: 'normal' },
- whiteBackground: { backgroundColor: 'white' },
- filterCurrencyText: { fontSize: 16, color: '#9AA0AA' },
- filteCurrencyTextWrapper: { color: '#9AA0AA', right: 0, position: 'absolute' },
- currencyNativeName: { fontSize: 20, color: '#0c2550' },
+ itemSeparator: { height: 0.5, width: '100%', backgroundColor: BlueCurrentTheme.colors.lightBorder },
+ itemNameWrapper: { backgroundColor: BlueCurrentTheme.colors.elevated, flex: 1, flexDirection: 'row', paddingTop: 20, paddingBottom: 20 },
+ itemNameBold: { fontSize: 20, color: BlueCurrentTheme.colors.foregroundColor, fontWeight: 'bold' },
+ itemNameNormal: { fontSize: 20, color: BlueCurrentTheme.colors.foregroundColor, fontWeight: 'normal' },
+ whiteBackground: { backgroundColor: BlueCurrentTheme.colors.background },
+ filterCurrencyText: { fontSize: 16, color: BlueCurrentTheme.colors.foregroundColor },
+ filteCurrencyTextWrapper: { color: BlueCurrentTheme.colors.foregroundColor, right: 0, position: 'absolute' },
+ currencyNativeName: { fontSize: 20, color: BlueCurrentTheme.colors.foregroundColor },
currencyWrapper: { paddingLeft: 10, flex: 1, flexDirection: 'row' },
- methodNameText: { fontSize: 16, color: '#9AA0AA' },
+ methodNameText: { fontSize: 16, color: BlueCurrentTheme.colors.foregroundColor },
searchTextInput: { fontSize: 17, flex: 1, marginHorizontal: 8, minHeight: 33, paddingLeft: 6, paddingRight: 6, color: '#81868e' },
iconWithOffset: { left: -10 },
paddingLeft10: { paddingLeft: 10 },
- countryNativeNameBold: { fontSize: 20, color: '#0c2550', fontWeight: 'bold' },
- countryNativeNameNormal: { fontSize: 20, color: '#0c2550', fontWeight: 'normal' },
+ countryNativeNameBold: { fontSize: 20, color: BlueCurrentTheme.colors.foregroundColor, fontWeight: 'bold' },
+ countryNativeNameNormal: { fontSize: 20, color: BlueCurrentTheme.colors.foregroundColor, fontWeight: 'normal' },
curSearchInput: { flex: 1, marginHorizontal: 8, minHeight: 33, paddingLeft: 6, paddingRight: 6, color: '#81868e' },
mthdSearchInput: { flex: 1, marginHorizontal: 8, minHeight: 33, paddingLeft: 6, paddingRight: 6, color: '#81868e' },
currencyTextBold: {
fontSize: 20,
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
fontWeight: 'bold',
},
currencyTextNormal: {
fontSize: 20,
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
fontWeight: 'normal',
},
+ currencyText: {
+ fontSize: 20,
+ color: BlueCurrentTheme.colors.foregroundColor,
+ },
noPaddingLeftOrRight: { paddingLeft: 0, paddingRight: 0 },
flexRow: { flexDirection: 'row' },
traderRatingText2: { color: '#9AA0AA' },
itemPriceWrapper: {
- backgroundColor: '#EEF0F4',
+ backgroundColor: BlueCurrentTheme.colors.lightButton,
borderRadius: 20,
paddingLeft: 8,
paddingRight: 8,
@@ -1043,8 +1061,8 @@ const styles = StyleSheet.create({
offersSectionList: { marginTop: 24, flex: 1 },
marginHorizontal20: { marginHorizontal: 20 },
avatarImage: { width: 40, height: 40, borderRadius: 40 },
- avatarWrapper: { backgroundColor: 'white', flex: 1, flexDirection: 'row' },
- avatarWrapperWrapper: { backgroundColor: 'white', paddingTop: 16, paddingBottom: 16 },
- headerWrapper: { marginHorizontal: 20, marginBottom: 8 },
+ avatarWrapper: { backgroundColor: BlueCurrentTheme.colors.background, flex: 1, flexDirection: 'row' },
+ avatarWrapperWrapper: { backgroundColor: BlueCurrentTheme.colors.background, paddingTop: 16, paddingBottom: 16 },
+ headerWrapper: { backgroundColor: BlueCurrentTheme.colors.background, marginHorizontal: 20, marginBottom: 8 },
verifiedIcon: { marginTop: 5, marginRight: 5 },
});
diff --git a/screen/wallets/hodlHodlLogin.js b/screen/wallets/hodlHodlLogin.js
index adf434478..4a077b407 100644
--- a/screen/wallets/hodlHodlLogin.js
+++ b/screen/wallets/hodlHodlLogin.js
@@ -1,7 +1,7 @@
-import React, { Component } from 'react';
+import React, { useRef } from 'react';
import { WebView } from 'react-native-webview';
import { BlueNavigationStyle, SafeBlueArea } from '../../BlueComponents';
-import PropTypes from 'prop-types';
+import { useRoute, useNavigation } from '@react-navigation/native';
const url = 'https://accounts.hodlhodl.com/accounts/request_access?attributes=api_key,api_signature_key';
@@ -15,61 +15,44 @@ const INJECTED_JAVASCRIPT = `(function() {
})();`;
-export default class HodlHodlLogin extends Component {
- static navigationOptions = ({ navigation }) => ({
- ...BlueNavigationStyle(navigation, true),
- title: 'Login',
- headerLeft: null,
- });
+const HodlHodlLogin = () => {
+ const webView = useRef();
+ const { cb } = useRoute().params;
+ const navigation = useNavigation();
- constructor(props) {
- super(props);
+ return (
+
+ {
+ // this is a handler which receives messages sent from within the browser
- this.state = {
- url: url,
- };
- }
+ if (lastTimeIvebeenHere && +new Date() - lastTimeIvebeenHere < 5000) return;
+ lastTimeIvebeenHere = +new Date();
+ // page can post messages several times, and that can confuse our react navigation, so we have protection
+ // against that
- render() {
- return (
-
- (this.webview = ref)}
- source={{ uri: this.state.url }}
- onMessage={e => {
- // this is a handler which receives messages sent from within the browser
+ let json = false;
+ try {
+ json = JSON.parse(e.nativeEvent.data);
+ } catch (_) {}
- if (lastTimeIvebeenHere && +new Date() - lastTimeIvebeenHere < 5000) return;
- lastTimeIvebeenHere = +new Date();
- // page can post messages several times, and that can confuse our react navigation, so we have protection
- // against that
-
- let json = false;
- try {
- json = JSON.parse(e.nativeEvent.data);
- } catch (_) {}
-
- if (json && json.allowed && json.data && json.data.api_key) {
- this.props.route.params.cb(json.data.api_key, json.data.api_signature_key);
- this.props.navigation.pop();
- }
- }}
- />
-
- );
- }
-}
-
-HodlHodlLogin.propTypes = {
- route: PropTypes.shape({
- params: PropTypes.shape({
- cb: PropTypes.func.isRequired,
- }),
- }),
- navigation: PropTypes.shape({
- getParam: PropTypes.func,
- navigate: PropTypes.func,
- pop: PropTypes.func,
- }),
+ if (json && json.allowed && json.data && json.data.api_key) {
+ cb(json.data.api_key, json.data.api_signature_key);
+ navigation.dangerouslyGetParent().pop();
+ }
+ }}
+ />
+
+ );
};
+
+HodlHodlLogin.navigationOptions = ({ navigation }) => ({
+ ...BlueNavigationStyle(navigation, true),
+ title: 'Login',
+ headerLeft: null,
+});
+
+export default HodlHodlLogin;
diff --git a/screen/wallets/hodlHodlMyContracts.js b/screen/wallets/hodlHodlMyContracts.js
index fbb0363bc..be4705e53 100644
--- a/screen/wallets/hodlHodlMyContracts.js
+++ b/screen/wallets/hodlHodlMyContracts.js
@@ -19,22 +19,16 @@ import {
BlueNavigationStyle,
BlueSpacing10,
BlueSpacing20,
- SafeBlueArea,
} from '../../BlueComponents';
import { AppStorage } from '../../class';
import { HodlHodlApi } from '../../class/hodl-hodl-api';
import Modal from 'react-native-modal';
import * as NavigationService from '../../NavigationService';
+import { BlueCurrentTheme } from '../../components/themes';
const BlueApp: AppStorage = require('../../BlueApp');
export default class HodlHodlMyContracts extends Component {
- static navigationOptions = ({ navigation }) => ({
- ...BlueNavigationStyle(navigation, true),
- title: 'My contracts',
- headerLeft: null,
- });
-
constructor(props) {
super(props);
@@ -64,13 +58,13 @@ export default class HodlHodlMyContracts extends Component {
render() {
if (this.state.isLoading) return ;
return (
-
+
{
return item.id;
}}
- ListEmptyComponent={() => You dont have any contracts in progress}
+ ListEmptyComponent={() => You don't have any contracts in progress}
style={styles.flatList}
ItemSeparatorComponent={() => }
data={this.state.contracts}
@@ -104,7 +98,7 @@ export default class HodlHodlMyContracts extends Component {
)}
/>
{this.renderContract()}
-
+
);
}
@@ -346,12 +340,16 @@ export default class HodlHodlMyContracts extends Component {
}
const styles = StyleSheet.create({
+ root: {
+ flex: 1,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
+ },
bottomModal: {
justifyContent: 'flex-end',
margin: 0,
},
modalContent: {
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.modal,
padding: 22,
borderTopLeftRadius: 16,
borderTopRightRadius: 16,
@@ -363,7 +361,7 @@ const styles = StyleSheet.create({
alignItems: 'center',
},
statusGreenWrapper: {
- backgroundColor: '#d2f8d5',
+ backgroundColor: BlueCurrentTheme.colors.feeLabel,
borderRadius: 20,
height: 28,
justifyContent: 'center',
@@ -374,10 +372,10 @@ const styles = StyleSheet.create({
},
statusGreenText: {
fontSize: 12,
- color: '#37bfa0',
+ color: BlueCurrentTheme.colors.feeValue,
},
statusGrayWrapper: {
- backgroundColor: '#ebebeb',
+ backgroundColor: BlueCurrentTheme.colors.lightBorder,
borderRadius: 20,
height: 28,
justifyContent: 'center',
@@ -388,10 +386,10 @@ const styles = StyleSheet.create({
},
statusGrayText: {
fontSize: 12,
- color: 'gray',
+ color: '#9AA0AA',
},
statusGrayWrapper2: {
- backgroundColor: '#f8f8f8',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
borderRadius: 5,
minHeight: 28,
maxHeight: 56,
@@ -402,26 +400,36 @@ const styles = StyleSheet.create({
},
statusGrayText2: {
fontSize: 12,
- color: 'gray',
+ color: '#9AA0AA',
},
btcText: {
fontWeight: 'bold',
fontSize: 18,
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
},
subheaderText: {
fontSize: 12,
fontWeight: 'bold',
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.feeText,
},
- emptyComponentText: { textAlign: 'center', color: '#9AA0AA', paddingHorizontal: 16 },
+ loading: { backgroundColor: BlueCurrentTheme.colors.elevated },
+ emptyComponentText: { textAlign: 'center', color: '#9AA0AA', paddingHorizontal: 16, backgroundColor: BlueCurrentTheme.colors.elevated },
itemSeparatorComponent: { height: 0.5, width: '100%', backgroundColor: '#C8C8C8' },
flexDirectionRow: { flexDirection: 'row' },
flexDirectionColumn: { flexDirection: 'column' },
- volumeBreakdownText: { fontSize: 18, color: '#0c2550' },
- contractStatusText: { fontSize: 14, color: 'gray', fontWeight: 'normal' },
+ volumeBreakdownText: { fontSize: 18, color: BlueCurrentTheme.colors.foregroundColor },
+ contractStatusText: { fontSize: 13, color: 'gray', fontWeight: 'normal' },
cancelContractText: { color: '#d0021b', fontSize: 15, paddingTop: 20, fontWeight: '500', textAlign: 'center' },
- openChatText: { color: '#1b02d0', fontSize: 15, paddingTop: 20, fontWeight: '500', textAlign: 'center' },
- flatList: { paddingTop: 30 },
+ openChatText: { color: BlueCurrentTheme.colors.foregroundColor, fontSize: 15, paddingTop: 20, fontWeight: '500', textAlign: 'center' },
+ flatList: { paddingTop: 30, backgroundColor: BlueCurrentTheme.colors.elevated },
roleText: { fontSize: 14, color: 'gray', padding: 5 },
});
+
+HodlHodlMyContracts.navigationOptions = ({ navigation }) => ({
+ ...BlueNavigationStyle(navigation, true),
+ title: 'My contracts',
+ headerStyle: {
+ backgroundColor: BlueCurrentTheme.colors.elevated,
+ },
+ headerRight: null,
+});
diff --git a/screen/wallets/hodlHodlViewOffer.js b/screen/wallets/hodlHodlViewOffer.js
index 4cdb8c702..713cbe91f 100644
--- a/screen/wallets/hodlHodlViewOffer.js
+++ b/screen/wallets/hodlHodlViewOffer.js
@@ -7,16 +7,12 @@ import { HodlHodlApi } from '../../class/hodl-hodl-api';
import { Icon } from 'react-native-elements';
import { AppStorage } from '../../class';
import * as NavigationService from '../../NavigationService';
+import { BlueCurrentTheme } from '../../components/themes';
const BlueApp: AppStorage = require('../../BlueApp');
const prompt = require('../../blue_modules/prompt');
export default class HodlHodlViewOffer extends Component {
- static navigationOptions = ({ navigation }) => ({
- ...BlueNavigationStyle(),
- title: '',
- });
-
constructor(props) {
super(props);
@@ -75,7 +71,7 @@ export default class HodlHodlViewOffer extends Component {
const HodlApi = new HodlHodlApi(hodlApiKey);
this.setState({ HodlApi, hodlApiKey });
};
- NavigationService.navigate('HodlHodlRoot', { params: { cb: handleLoginCallback }, screen: 'HodlHodlLogin' });
+ NavigationService.navigate('HodlHodl', { params: { cb: handleLoginCallback }, screen: 'HodlHodlLogin' });
};
async _onAcceptOfferPress(offer) {
@@ -269,19 +265,19 @@ HodlHodlViewOffer.propTypes = {
const styles = StyleSheet.create({
modalContent: {
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.background,
padding: 22,
},
Title: {
fontWeight: '600',
fontSize: 24,
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
},
circleWhite: {
position: 'absolute',
bottom: 0,
right: 3,
- backgroundColor: 'white',
+ backgroundColor: BlueCurrentTheme.colors.background,
width: 13,
height: 13,
borderRadius: 6,
@@ -296,7 +292,7 @@ const styles = StyleSheet.create({
borderRadius: 5,
},
grayTextContainerContainer: {
- backgroundColor: '#EEF0F4',
+ backgroundColor: BlueCurrentTheme.colors.lightButton,
borderRadius: 20,
height: 30,
justifyContent: 'center',
@@ -306,7 +302,7 @@ const styles = StyleSheet.create({
paddingRight: 20,
},
greenTextContainerContainer: {
- backgroundColor: '#d2f8d5',
+ backgroundColor: BlueCurrentTheme.colors.feeLabel,
borderRadius: 20,
height: 30,
justifyContent: 'center',
@@ -323,7 +319,7 @@ const styles = StyleSheet.create({
},
priceText: {
top: 0,
- color: '#37bfa0',
+ color: BlueCurrentTheme.colors.feeValue,
fontSize: 14,
fontWeight: '500',
},
@@ -338,7 +334,7 @@ const styles = StyleSheet.create({
lineHeight: 23,
},
nicknameText: {
- color: '#0c2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
fontSize: 16,
fontWeight: 'bold',
},
@@ -349,20 +345,35 @@ const styles = StyleSheet.create({
locationText: {
color: '#9BA0A9',
},
- horizontalScrollIemHeader: { fontSize: 12, color: '#9AA0AA' },
- horizontalScrollItemBody: { fontSize: 14, fontWeight: 'bold', color: '#0c2550' },
+ horizontalScrollIemHeader: { color: BlueCurrentTheme.colors.feeText },
+ horizontalScrollItemBody: { fontSize: 14, fontWeight: 'bold', color: BlueCurrentTheme.colors.foregroundColor },
horizontalScrollWrapper: { flexDirection: 'column', paddingTop: 20, paddingBottom: 20, paddingRight: 40 },
flexDirRow: { flexDirection: 'row' },
iconWithPadding: { paddingLeft: 16 },
_hr: {
borderWidth: 0,
borderBottomWidth: 1,
- borderColor: '#ebebeb',
+ borderColor: BlueCurrentTheme.colors.lightBorder,
},
avatarImg: { width: 60, height: 60, borderRadius: 60 },
- avatarWrapper: { backgroundColor: 'white', flex: 1, flexDirection: 'column', alignItems: 'center', marginTop: 32 },
+ avatarWrapper: {
+ backgroundColor: BlueCurrentTheme.colors.background,
+ flex: 1,
+ flexDirection: 'column',
+ alignItems: 'center',
+ marginTop: 32,
+ },
verifiedIcon: { marginTop: 3, marginRight: 5 },
traderWrapper: { alignItems: 'center', marginTop: 8 },
acceptOfferButtonWrapper: { width: '70%', alignItems: 'center' },
acceptOfferButtonWrapperWrapper: { marginTop: 24, alignItems: 'center' },
});
+
+HodlHodlViewOffer.navigationOptions = () => ({
+ ...BlueNavigationStyle(),
+ title: '',
+ headerStyle: {
+ ...BlueNavigationStyle().headerStyle,
+ backgroundColor: BlueCurrentTheme.colors.customHeader,
+ },
+});
diff --git a/screen/wallets/hodlHodlWebview.js b/screen/wallets/hodlHodlWebview.js
index 9d2d5f6ee..3efd57302 100644
--- a/screen/wallets/hodlHodlWebview.js
+++ b/screen/wallets/hodlHodlWebview.js
@@ -4,12 +4,6 @@ import { BlueNavigationStyle, SafeBlueArea } from '../../BlueComponents';
import PropTypes from 'prop-types';
export default class HodlHodlWebview extends Component {
- static navigationOptions = ({ navigation }) => ({
- ...BlueNavigationStyle(navigation, true),
- title: '',
- headerLeft: null,
- });
-
constructor(props) {
super(props);
@@ -36,3 +30,9 @@ HodlHodlWebview.propTypes = {
}),
}),
};
+
+HodlHodlWebview.navigationOptions = ({ navigation }) => ({
+ ...BlueNavigationStyle(navigation, true),
+ title: '',
+ headerLeft: null,
+});
diff --git a/screen/wallets/import.js b/screen/wallets/import.js
index cb2a6849e..c19f7706f 100644
--- a/screen/wallets/import.js
+++ b/screen/wallets/import.js
@@ -13,28 +13,30 @@ import {
} from '../../BlueComponents';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import Privacy from '../../Privacy';
-import { useNavigation, useRoute } from '@react-navigation/native';
+import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import WalletImport from '../../class/wallet-import';
const loc = require('../../loc');
const { width } = Dimensions.get('window');
-const styles = StyleSheet.create({
- root: {
- flex: 1,
- paddingTop: 40,
- },
- center: {
- flex: 1,
- alignItems: 'center',
- },
-});
-
const WalletsImport = () => {
const [isToolbarVisibleForAndroid, setIsToolbarVisibleForAndroid] = useState(false);
const route = useRoute();
const label = (route.params && route.params.label) || '';
const [importText, setImportText] = useState(label);
const navigation = useNavigation();
+ const { colors } = useTheme();
+ const styles = StyleSheet.create({
+ root: {
+ flex: 1,
+ paddingTop: 40,
+ backgroundColor: colors.elevated,
+ },
+ center: {
+ flex: 1,
+ alignItems: 'center',
+ backgroundColor: colors.elevated,
+ },
+ });
useEffect(() => {
Privacy.enableBlur();
@@ -92,8 +94,8 @@ const WalletsImport = () => {
return (
-
-
+
+
{loc.wallets.import.explanation}
{
);
};
-WalletsImport.navigationOptions = {
+WalletsImport.navigationOptions = ({ navigation, route }) => ({
...BlueNavigationStyle(),
title: loc.wallets.import.title,
-};
+});
export default WalletsImport;
diff --git a/screen/wallets/list.js b/screen/wallets/list.js
index 84fe45e68..59459aaac 100644
--- a/screen/wallets/list.js
+++ b/screen/wallets/list.js
@@ -23,6 +23,7 @@ import WalletImport from '../../class/wallet-import';
import ActionSheet from '../ActionSheet';
import ImagePicker from 'react-native-image-picker';
import * as NavigationService from '../../NavigationService';
+import { BlueCurrentTheme } from '../../components/themes';
const EV = require('../../blue_modules/events');
const A = require('../../blue_modules/analytics');
const BlueApp: AppStorage = require('../../BlueApp');
@@ -33,18 +34,6 @@ const LocalQRCode = require('@remobile/react-native-qrcode-local-image');
const WalletsListSections = { CAROUSEL: 'CAROUSEL', LOCALTRADER: 'LOCALTRADER', TRANSACTIONS: 'TRANSACTIONS' };
export default class WalletsList extends Component {
- static navigationOptions = ({ navigation, route }) => {
- return {
- ...BlueNavigationStyle(navigation, true),
- title: '',
- headerRight: () => (
- NavigationService.navigate('Settings')}>
-
-
- ),
- };
- };
-
walletsCarousel = React.createRef();
constructor(props) {
@@ -289,7 +278,7 @@ export default class WalletsList extends Component {
renderListHeaderComponent = () => {
return (
-
+
{loc.transactions.list.title}
);
@@ -316,7 +305,7 @@ export default class WalletsList extends Component {
return (
{
- this.props.navigation.navigate('HodlHodlRoot', { params: { wallet: this.state.wallet }, screen: 'HodlHodl' });
+ this.props.navigation.navigate('HodlHodl', { params: { wallet: this.state.wallet }, screen: 'HodlHodl' });
}}
style={styles.ltRoot}
>
@@ -527,7 +516,7 @@ export default class WalletsList extends Component {
render() {
return (
-
+
}
@@ -561,12 +550,12 @@ const styles = StyleSheet.create({
right: 0,
},
wrapper: {
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.brandingColor,
flex: 1,
},
walletsListWrapper: {
flex: 1,
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.brandingColor,
},
headerStyle: {
...Platform.select({
@@ -595,7 +584,7 @@ const styles = StyleSheet.create({
fontWeight: 'bold',
fontSize: 24,
marginVertical: 8,
- color: BlueApp.settings.foregroundColor,
+ color: BlueCurrentTheme.colors.foregroundColor,
},
ltRoot: {
flexDirection: 'row',
@@ -603,7 +592,7 @@ const styles = StyleSheet.create({
alignItems: 'center',
marginHorizontal: 16,
marginVertical: 16,
- backgroundColor: '#eef0f4',
+ backgroundColor: BlueCurrentTheme.colors.ballOutgoingExpired,
padding: 16,
borderRadius: 6,
},
@@ -613,12 +602,12 @@ const styles = StyleSheet.create({
ltTextBig: {
fontSize: 16,
fontWeight: '600',
- color: '#0C2550',
+ color: BlueCurrentTheme.colors.foregroundColor,
},
ltTextSmall: {
fontSize: 13,
fontWeight: '500',
- color: '#9AA0AA',
+ color: BlueCurrentTheme.colors.alternativeTextColor,
},
ltButtonWrap: {
flexDirection: 'column',
@@ -676,3 +665,22 @@ WalletsList.propTypes = {
params: PropTypes.object,
}),
};
+
+WalletsList.navigationOptions = ({ navigation, route }) => {
+ return {
+ ...BlueNavigationStyle(navigation, true),
+ title: '',
+ headerStyle: {
+ backgroundColor: BlueCurrentTheme.colors.customHeader,
+ borderBottomWidth: 0,
+ elevation: 0,
+ shadowOpacity: 0,
+ shadowOffset: { height: 0, width: 0 },
+ },
+ headerRight: () => (
+ NavigationService.navigate('Settings')}>
+
+
+ ),
+ };
+};
diff --git a/screen/wallets/marketplace.js b/screen/wallets/marketplace.js
index f64cff8c4..fbd9b6ed4 100644
--- a/screen/wallets/marketplace.js
+++ b/screen/wallets/marketplace.js
@@ -5,12 +5,6 @@ import { BlueLoading, BlueNavigationStyle } from '../../BlueComponents';
import PropTypes from 'prop-types';
export default class Marketplace extends Component {
- static navigationOptions = ({ navigation }) => ({
- ...BlueNavigationStyle(navigation, true),
- title: 'Marketplace',
- headerLeft: null,
- });
-
webview = React.createRef();
constructor(props) {
@@ -80,3 +74,9 @@ Marketplace.propTypes = {
params: PropTypes.object,
}),
};
+
+Marketplace.navigationOptions = ({ navigation }) => ({
+ ...BlueNavigationStyle(navigation, true),
+ title: 'Marketplace',
+ headerLeft: null,
+});
diff --git a/screen/wallets/pleaseBackup.js b/screen/wallets/pleaseBackup.js
index f18fb33ac..72dfced2e 100644
--- a/screen/wallets/pleaseBackup.js
+++ b/screen/wallets/pleaseBackup.js
@@ -1,71 +1,73 @@
import React, { useEffect, useState, useCallback } from 'react';
import { ActivityIndicator, View, BackHandler, Text, ScrollView, StyleSheet, StatusBar } from 'react-native';
-import { useNavigation, useRoute } from '@react-navigation/native';
+import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { BlueSpacing20, SafeBlueArea, BlueNavigationStyle, BlueText, BlueButton } from '../../BlueComponents';
import Privacy from '../../Privacy';
-const loc = require('../../loc');
-const styles = StyleSheet.create({
- flex: {
- flex: 1,
- },
- loading: {
- flex: 1,
- paddingTop: 20,
- },
- word: {
- width: 'auto',
- marginRight: 8,
- marginBottom: 8,
- backgroundColor: '#f5f5f5',
- paddingTop: 6,
- paddingBottom: 6,
- paddingLeft: 8,
- paddingRight: 8,
- borderRadius: 4,
- },
- wortText: {
- color: '#81868E',
- fontWeight: 'bold',
- },
- scrollViewContent: {
- justifyContent: 'space-between',
- },
- please: {
- alignItems: 'center',
- paddingHorizontal: 16,
- },
- successText: {
- textAlign: 'center',
- fontWeight: 'bold',
- color: '#0C2550',
- },
- pleaseText: {
- paddingBottom: 10,
- paddingRight: 0,
- paddingLeft: 0,
- color: '#0C2550',
- },
- secret: {
- flex: 1,
- flexDirection: 'row',
- justifyContent: 'center',
- flexWrap: 'wrap',
- marginTop: 14,
- },
- ok: {
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
- flexWrap: 'wrap',
- },
-});
+const loc = require('../../loc');
const PleaseBackup = () => {
const [isLoading, setIsLoading] = useState(true);
const route = useRoute();
const words = route.params.secret.split(' ');
const navigation = useNavigation();
+ const { colors } = useTheme();
+ const styles = StyleSheet.create({
+ flex: {
+ flex: 1,
+ backgroundColor: colors.elevated,
+ },
+ loading: {
+ flex: 1,
+ paddingTop: 20,
+ },
+ word: {
+ width: 'auto',
+ marginRight: 8,
+ marginBottom: 8,
+ backgroundColor: colors.inputBackgroundColor,
+ paddingTop: 6,
+ paddingBottom: 6,
+ paddingLeft: 8,
+ paddingRight: 8,
+ borderRadius: 4,
+ },
+ wortText: {
+ color: colors.labelText,
+ fontWeight: 'bold',
+ },
+ scrollViewContent: {
+ justifyContent: 'space-between',
+ },
+ please: {
+ alignItems: 'center',
+ paddingHorizontal: 16,
+ },
+ successText: {
+ textAlign: 'center',
+ fontWeight: 'bold',
+ color: colors.foregroundColor,
+ },
+ pleaseText: {
+ paddingBottom: 10,
+ paddingRight: 0,
+ paddingLeft: 0,
+ color: colors.foregroundColor,
+ },
+ secret: {
+ flex: 1,
+ flexDirection: 'row',
+ justifyContent: 'center',
+ flexWrap: 'wrap',
+ marginTop: 14,
+ },
+ ok: {
+ flex: 1,
+ justifyContent: 'center',
+ alignItems: 'center',
+ flexWrap: 'wrap',
+ },
+ });
const handleBackButton = useCallback(() => {
navigation.dangerouslyGetParent().pop();
@@ -102,7 +104,7 @@ const PleaseBackup = () => {
) : (
-
+
{loc.pleasebackup.success}
diff --git a/screen/wallets/pleaseBackupLNDHub.js b/screen/wallets/pleaseBackupLNDHub.js
index 9c4fe0b5e..3039024fd 100644
--- a/screen/wallets/pleaseBackupLNDHub.js
+++ b/screen/wallets/pleaseBackupLNDHub.js
@@ -1,5 +1,5 @@
import React, { useState, useCallback, useEffect } from 'react';
-import { useNavigation, useRoute } from '@react-navigation/native';
+import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { View, Dimensions, StyleSheet, BackHandler, StatusBar } from 'react-native';
import {
SafeBlueArea,
@@ -14,27 +14,27 @@ import QRCode from 'react-native-qrcode-svg';
import Privacy from '../../Privacy';
import { ScrollView } from 'react-native-gesture-handler';
const { height, width } = Dimensions.get('window');
-const BlueApp = require('../../BlueApp');
const loc = require('../../loc');
-const styles = StyleSheet.create({
- root: {
- flex: 1,
- },
- scrollViewContent: {
- flexGrow: 1,
- },
-});
-
const PleaseBackupLNDHub = () => {
const { wallet } = useRoute().params;
const navigation = useNavigation();
+ const { colors } = useTheme();
const [qrCodeHeight, setQrCodeHeight] = useState(height > width ? width - 40 : width / 2);
-
const handleBackButton = useCallback(() => {
navigation.dangerouslyGetParent().pop();
return true;
}, [navigation]);
+ const styles = StyleSheet.create({
+ root: {
+ flex: 1,
+ backgroundColor: colors.elevated,
+ },
+ scrollViewContent: {
+ flexGrow: 1,
+ backgroundColor: colors.elevated,
+ },
+ });
useEffect(() => {
Privacy.enableBlur();
@@ -52,7 +52,7 @@ const PleaseBackupLNDHub = () => {
return (
-
+
@@ -67,8 +67,9 @@ const PleaseBackupLNDHub = () => {
logo={require('../../img/qr-code.png')}
logoSize={90}
size={qrCodeHeight}
- color={BlueApp.settings.foregroundColor}
- logoBackgroundColor={BlueApp.settings.brandingColor}
+ color={colors.foregroundColor}
+ logoBackgroundColor={colors.brandingColor}
+ backgroundColor={colors.background}
ecl="H"
/>
diff --git a/screen/wallets/provideEntropy.js b/screen/wallets/provideEntropy.js
index 1431bab0f..bcb0c77f0 100644
--- a/screen/wallets/provideEntropy.js
+++ b/screen/wallets/provideEntropy.js
@@ -3,11 +3,10 @@ import PropTypes from 'prop-types';
import BN from 'bignumber.js';
import { Dimensions, View, ScrollView, Text, Image, TouchableOpacity, StyleSheet } from 'react-native';
import { Icon } from 'react-native-elements';
-import { useNavigation, useRoute } from '@react-navigation/native';
-
-import { SafeBlueArea, BlueNavigationStyle, BlueTabs } from '../../BlueComponents';
+import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
+import { BlueCurrentTheme } from '../../components/themes';
+import { BlueSpacing20, SafeBlueArea, BlueNavigationStyle, BlueTabs } from '../../BlueComponents';
const loc = require('../../loc');
-const BlueApp = require('../../BlueApp');
const ENTROPY_LIMIT = 256;
@@ -133,7 +132,7 @@ const Dice = ({ push, sides }) => {
};
return (
-
+
{[...Array(sides)].map((_, i) => (
push(getEntropy(i, sides))}>
@@ -141,7 +140,7 @@ const Dice = ({ push, sides }) => {
) : (
- {i + 1}
+ {i + 1}
)}
@@ -162,7 +161,7 @@ const Buttons = ({ pop, save }) => (
-
+
{loc.entropy.undo}
@@ -172,7 +171,7 @@ const Buttons = ({ pop, save }) => (
-
+
{loc.entropy.save}
@@ -192,6 +191,7 @@ const Entropy = () => {
const navigation = useNavigation();
const [tab, setTab] = useState(1);
const [show, setShow] = useState(false);
+ const { colors } = useTheme();
const push = v => v && dispatch({ type: 'push', value: v.value, bits: v.bits });
const pop = () => dispatch({ type: 'pop' });
@@ -207,6 +207,7 @@ const Entropy = () => {
return (
+
setShow(!show)}>
{show ? hex : `${bits} of 256 bits`}
@@ -218,25 +219,13 @@ const Entropy = () => {
onSwitch={setTab}
tabs={[
({ active }) => (
-
+
),
({ active }) => (
-
+
),
({ active }) => (
-
+
),
]}
/>
@@ -267,7 +256,7 @@ const styles = StyleSheet.create({
padding: 5,
marginLeft: 10,
marginRight: 10,
- backgroundColor: '#f2f2f2',
+ backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
borderRadius: 9,
minHeight: 49,
paddingHorizontal: 8,
@@ -278,13 +267,13 @@ const styles = StyleSheet.create({
entropyText: {
fontSize: 15,
fontFamily: 'Courier',
+ color: BlueCurrentTheme.colors.foregroundColor,
},
coinRoot: {
flex: 1,
justifyContent: 'center',
flexDirection: 'row',
flexWrap: 'wrap',
- backgroundColor: 'white',
},
coinBody: {
flex: 0.33,
@@ -293,7 +282,7 @@ const styles = StyleSheet.create({
aspectRatio: 1,
borderWidth: 1,
borderRadius: 5,
- borderColor: 'grey',
+ borderColor: BlueCurrentTheme.colors.lightButton,
margin: 10,
padding: 10,
},
@@ -303,9 +292,6 @@ const styles = StyleSheet.create({
height: '100%',
borderRadius: 75,
},
- diceScroll: {
- backgroundColor: 'white',
- },
diceContainer: {
alignItems: 'flex-start',
flexDirection: 'row',
@@ -321,10 +307,13 @@ const styles = StyleSheet.create({
margin: 3,
borderWidth: 1,
borderRadius: 5,
- borderColor: 'grey',
justifyContent: 'center',
alignItems: 'center',
aspectRatio: 1,
+ borderColor: BlueCurrentTheme.colors.buttonBackgroundColor,
+ },
+ diceText: {
+ color: BlueCurrentTheme.colors.foregroundColor,
},
diceIcon: {
margin: 3,
@@ -346,7 +335,7 @@ const styles = StyleSheet.create({
buttonsBody: {
flex: 1,
minWidth: 130,
- backgroundColor: BlueApp.settings.buttonBackgroundColor,
+ backgroundColor: BlueCurrentTheme.colors.buttonBackgroundColor,
},
buttonsRow: {
flex: 1,
@@ -364,7 +353,7 @@ const styles = StyleSheet.create({
marginBottom: -11,
},
buttonsLabel: {
- color: BlueApp.settings.buttonAlternativeTextColor,
+ color: BlueCurrentTheme.colors.buttonAlternativeTextColor,
fontWeight: '500',
left: 5,
backgroundColor: 'transparent',
diff --git a/screen/wallets/reorderWallets.js b/screen/wallets/reorderWallets.js
index 4059d192f..5e34777c8 100644
--- a/screen/wallets/reorderWallets.js
+++ b/screen/wallets/reorderWallets.js
@@ -7,6 +7,7 @@ import PropTypes from 'prop-types';
import { PlaceholderWallet, LightningCustodianWallet } from '../../class';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import WalletGradient from '../../class/wallet-gradient';
+import { BlueCurrentTheme } from '../../components/themes';
const EV = require('../../blue_modules/events');
/** @type {AppStorage} */
const BlueApp = require('../../BlueApp');
@@ -19,6 +20,7 @@ const styles = StyleSheet.create({
},
root: {
flex: 1,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
itemRoot: {
backgroundColor: 'transparent',
@@ -66,17 +68,6 @@ const styles = StyleSheet.create({
});
export default class ReorderWallets extends Component {
- static navigationOptions = ({ navigation, route }) => ({
- ...BlueNavigationStyle(
- navigation,
- true,
- route.params && route.params.customCloseButtonFunction ? route.params.customCloseButtonFunction : undefined,
- ),
- headerTitle: loc.wallets.reorder.title,
- headerLeft: null,
- gestureEnabled: false,
- });
-
constructor(props) {
super(props);
this.state = {
@@ -196,3 +187,14 @@ ReorderWallets.propTypes = {
goBack: PropTypes.func,
}),
};
+
+ReorderWallets.navigationOptions = ({ navigation, route }) => ({
+ ...BlueNavigationStyle(
+ navigation,
+ true,
+ route.params && route.params.customCloseButtonFunction ? route.params.customCloseButtonFunction : undefined,
+ ),
+ headerTitle: loc.wallets.reorder.title,
+ headerLeft: null,
+ gestureEnabled: false,
+});
diff --git a/screen/wallets/selectWallet.js b/screen/wallets/selectWallet.js
index fd004e9a3..81788dbc2 100644
--- a/screen/wallets/selectWallet.js
+++ b/screen/wallets/selectWallet.js
@@ -1,83 +1,20 @@
/* eslint-disable react/prop-types */
import React, { useEffect, useState } from 'react';
import { View, ActivityIndicator, Image, Text, TouchableOpacity, FlatList, StyleSheet, StatusBar } from 'react-native';
-import { SafeBlueArea, BlueNavigationStyle, BlueText, BlueSpacing20, BluePrivateBalance } from '../../BlueComponents';
+import { SafeBlueArea, BlueText, BlueSpacing20, BluePrivateBalance, BlueNavigationStyle } from '../../BlueComponents';
import LinearGradient from 'react-native-linear-gradient';
import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import WalletGradient from '../../class/wallet-gradient';
-import { useRoute } from '@react-navigation/native';
+import { useRoute, useTheme } from '@react-navigation/native';
/** @type {AppStorage} */
const BlueApp = require('../../BlueApp');
const loc = require('../../loc');
-const styles = StyleSheet.create({
- root: {
- flex: 1,
- },
- loading: {
- flex: 1,
- justifyContent: 'center',
- alignContent: 'center',
- paddingTop: 20,
- },
- itemRoot: {
- backgroundColor: 'transparent',
- padding: 10,
- marginVertical: 17,
- },
- gradient: {
- padding: 15,
- borderRadius: 10,
- minHeight: 164,
- elevation: 5,
- },
- image: {
- width: 99,
- height: 94,
- position: 'absolute',
- bottom: 0,
- right: 0,
- },
- transparentText: {
- backgroundColor: 'transparent',
- },
- label: {
- backgroundColor: 'transparent',
- fontSize: 19,
- color: '#fff',
- },
- balance: {
- backgroundColor: 'transparent',
- fontWeight: 'bold',
- fontSize: 36,
- color: '#fff',
- },
- latestTxLabel: {
- backgroundColor: 'transparent',
- fontSize: 13,
- color: '#fff',
- },
- latestTxValue: {
- backgroundColor: 'transparent',
- fontWeight: 'bold',
- fontSize: 16,
- color: '#fff',
- },
- noWallets: {
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
- paddingTop: 20,
- },
- center: {
- textAlign: 'center',
- },
-});
-
const SelectWallet = ({ navigation }) => {
const { chainType, onWalletSelect, availableWallets } = useRoute().params;
const [isLoading, setIsLoading] = useState(true);
+ const { colors } = useTheme();
let data = chainType
? BlueApp.getWallets().filter(item => item.chain === chainType && item.allowSend())
: BlueApp.getWallets().filter(item => item.allowSend()) || [];
@@ -86,6 +23,70 @@ const SelectWallet = ({ navigation }) => {
// availableWallets if provided, overrides chainType argument and `allowSend()` check
data = availableWallets;
}
+ const styles = StyleSheet.create({
+ root: {
+ flex: 1,
+ backgroundColor: colors.background,
+ },
+ loading: {
+ flex: 1,
+ justifyContent: 'center',
+ alignContent: 'center',
+ paddingTop: 20,
+ },
+ itemRoot: {
+ backgroundColor: 'transparent',
+ padding: 10,
+ marginVertical: 17,
+ },
+ gradient: {
+ padding: 15,
+ borderRadius: 10,
+ minHeight: 164,
+ elevation: 5,
+ },
+ image: {
+ width: 99,
+ height: 94,
+ position: 'absolute',
+ bottom: 0,
+ right: 0,
+ },
+ transparentText: {
+ backgroundColor: 'transparent',
+ },
+ label: {
+ backgroundColor: 'transparent',
+ fontSize: 19,
+ color: '#fff',
+ },
+ balance: {
+ backgroundColor: 'transparent',
+ fontWeight: 'bold',
+ fontSize: 36,
+ color: '#fff',
+ },
+ latestTxLabel: {
+ backgroundColor: 'transparent',
+ fontSize: 13,
+ color: '#fff',
+ },
+ latestTxValue: {
+ backgroundColor: 'transparent',
+ fontWeight: 'bold',
+ fontSize: 16,
+ color: '#fff',
+ },
+ noWallets: {
+ flex: 1,
+ justifyContent: 'center',
+ alignItems: 'center',
+ paddingTop: 20,
+ },
+ center: {
+ textAlign: 'center',
+ },
+ });
useEffect(() => {
setIsLoading(false);
@@ -135,13 +136,14 @@ const SelectWallet = ({ navigation }) => {
if (isLoading) {
return (
+
);
} else if (data.length <= 0) {
return (
-
+
There are currently no Bitcoin wallets available.
@@ -152,7 +154,7 @@ const SelectWallet = ({ navigation }) => {
} else {
return (
-
+
`${index}`} />
);
@@ -160,9 +162,10 @@ const SelectWallet = ({ navigation }) => {
};
SelectWallet.navigationOptions = ({ navigation }) => ({
- ...BlueNavigationStyle(navigation, true, () => navigation.goBack(null)),
- title: loc.wallets.select_wallet,
+ ...BlueNavigationStyle(navigation, true),
headerRight: null,
+ headerTitle: loc.wallets.select_wallet,
+ headerBackTitleVisible: false,
});
export default SelectWallet;
diff --git a/screen/wallets/transactions.js b/screen/wallets/transactions.js
index cceb5a37b..0bfdf165a 100644
--- a/screen/wallets/transactions.js
+++ b/screen/wallets/transactions.js
@@ -36,6 +36,7 @@ import Modal from 'react-native-modal';
import * as NavigationService from '../../NavigationService';
import HandoffSettings from '../../class/handoff';
import Handoff from 'react-native-handoff';
+import { BlueCurrentTheme } from '../../components/themes';
import ActionSheet from '../ActionSheet';
/** @type {AppStorage} */
const BlueApp = require('../../BlueApp');
@@ -66,7 +67,7 @@ const styles = StyleSheet.create({
height: 200,
},
advancedTransactionOptionsModalContent: {
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.elevated,
padding: 22,
borderTopLeftRadius: 16,
borderTopRightRadius: 16,
@@ -98,10 +99,10 @@ const styles = StyleSheet.create({
marginBottom: 8,
fontWeight: 'bold',
fontSize: 24,
- color: BlueApp.settings.foregroundColor,
+ color: BlueCurrentTheme.colors.foregroundColor,
},
marketplaceButton1: {
- backgroundColor: '#f2f2f2',
+ backgroundColor: BlueCurrentTheme.colors.lightButton,
borderRadius: 9,
minHeight: 49,
flex: 1,
@@ -112,7 +113,7 @@ const styles = StyleSheet.create({
},
marketplaceButton2: {
marginLeft: 5,
- backgroundColor: '#f2f2f2',
+ backgroundColor: BlueCurrentTheme.colors.lightButton,
borderRadius: 9,
minHeight: 49,
flex: 1,
@@ -122,16 +123,16 @@ const styles = StyleSheet.create({
alignItems: 'center',
},
marketpalceText1: {
- color: '#062453',
+ color: BlueCurrentTheme.colors.cta2,
fontSize: 18,
},
marketpalceText2: {
- color: '#062453',
+ color: BlueCurrentTheme.colors.cta2,
fontSize: 18,
marginHorizontal: 8,
},
list: {
- backgroundColor: '#FFFFFF',
+ backgroundColor: BlueCurrentTheme.colors.background,
flex: 1,
},
emptyTxs: {
@@ -173,34 +174,6 @@ const styles = StyleSheet.create({
});
export default class WalletTransactions extends Component {
- static navigationOptions = ({ navigation, route }) => {
- return {
- headerRight: () => (
-
- navigation.navigate('WalletDetails', {
- wallet: route.params.wallet,
- })
- }
- >
-
-
- ),
- headerTitle: () => null,
- headerStyle: {
- backgroundColor: WalletGradient.headerColorFor(route.params.wallet.type),
- borderBottomWidth: 0,
- elevation: 0,
- // shadowRadius: 0,
- shadowOffset: { height: 0, width: 0 },
- },
- headerTintColor: '#FFFFFF',
- headerBackTitleVisible: false,
- };
- };
-
walletBalanceText = null;
constructor(props) {
@@ -833,3 +806,31 @@ WalletTransactions.propTypes = {
params: PropTypes.object,
}),
};
+
+WalletTransactions.navigationOptions = ({ navigation, route }) => {
+ return {
+ headerRight: () => (
+
+ navigation.navigate('WalletDetails', {
+ wallet: route.params.wallet,
+ })
+ }
+ >
+
+
+ ),
+ headerTitle: () => null,
+ headerStyle: {
+ backgroundColor: WalletGradient.headerColorFor(route.params.wallet.type),
+ borderBottomWidth: 0,
+ elevation: 0,
+ // shadowRadius: 0,
+ shadowOffset: { height: 0, width: 0 },
+ },
+ headerTintColor: '#FFFFFF',
+ headerBackTitleVisible: false,
+ };
+};
diff --git a/screen/wallets/xpub.js b/screen/wallets/xpub.js
index 53a470bbc..ef63d1842 100644
--- a/screen/wallets/xpub.js
+++ b/screen/wallets/xpub.js
@@ -5,6 +5,7 @@ import { BlueSpacing20, SafeBlueArea, BlueText, BlueNavigationStyle, BlueCopyTex
import PropTypes from 'prop-types';
import Privacy from '../../Privacy';
import Biometric from '../../class/biometrics';
+import { BlueCurrentTheme } from '../../components/themes';
/** @type {AppStorage} */
const BlueApp = require('../../BlueApp');
const loc = require('../../loc');
@@ -14,6 +15,7 @@ const styles = StyleSheet.create({
root: {
flex: 1,
paddingTop: 20,
+ backgroundColor: BlueCurrentTheme.colors.elevated,
},
container: {
alignItems: 'center',
@@ -23,12 +25,6 @@ const styles = StyleSheet.create({
});
export default class WalletXpub extends Component {
- static navigationOptions = ({ navigation }) => ({
- ...BlueNavigationStyle(navigation, true),
- title: loc.wallets.xpub.title,
- headerLeft: null,
- });
-
constructor(props) {
super(props);
@@ -98,8 +94,9 @@ export default class WalletXpub extends Component {
logo={require('../../img/qr-code.png')}
size={this.state.qrCodeHeight}
logoSize={90}
- color={BlueApp.settings.foregroundColor}
- logoBackgroundColor={BlueApp.settings.brandingColor}
+ color={BlueCurrentTheme.colors.foregroundColor}
+ logoBackgroundColor={BlueCurrentTheme.colors.brandingColor}
+ backgroundColor={BlueCurrentTheme.colors.background}
ecl="H"
/>
@@ -123,3 +120,9 @@ WalletXpub.propTypes = {
}),
}),
};
+
+WalletXpub.navigationOptions = ({ navigation }) => ({
+ ...BlueNavigationStyle(navigation, true),
+ title: loc.wallets.xpub.title,
+ headerLeft: null,
+});