fix: some styles

This commit is contained in:
Ivan Vershigora 2024-11-15 22:32:50 +00:00
parent 0a1bbe44fd
commit 9c01d06212
No known key found for this signature in database
GPG Key ID: DCCF7FB5ED2CEBD7
5 changed files with 29 additions and 15 deletions

View File

@ -1,5 +1,5 @@
import React, { useCallback } from 'react';
import { Keyboard, StyleSheet, TextInput, View } from 'react-native';
import { Keyboard, StyleProp, StyleSheet, TextInput, View, ViewStyle } from 'react-native';
import loc from '../loc';
import { AddressInputScanButton } from './AddressInputScanButton';
import { useTheme } from './themes';
@ -19,6 +19,7 @@ interface AddressInputProps {
onBlur?: () => void;
onFocus?: () => void;
testID?: string;
style?: StyleProp<ViewStyle>;
keyboardType?:
| 'default'
| 'numeric'
@ -49,6 +50,7 @@ const AddressInput = ({
onBlur = () => {},
onFocus = () => {},
keyboardType = 'default',
style,
}: AddressInputProps) => {
const { colors } = useTheme();
const stylesHook = StyleSheet.create({
@ -81,7 +83,7 @@ const AddressInput = ({
};
return (
<View style={[styles.root, stylesHook.root]}>
<View style={[styles.root, stylesHook.root, style]}>
<TextInput
testID={testID}
onChangeText={onChangeText}
@ -120,8 +122,6 @@ const styles = StyleSheet.create({
minHeight: 44,
height: 44,
alignItems: 'center',
marginVertical: 8,
marginHorizontal: 18,
borderRadius: 4,
},
input: {

View File

@ -20,6 +20,8 @@ interface QRCodeComponentProps {
onError?: () => void;
}
const BORDER_WIDTH = 6;
const actionIcons: { [key: string]: ActionIcons } = {
Share: {
iconValue: 'square.and.arrow.up',
@ -62,7 +64,7 @@ const QRCodeComponent: React.FC<QRCodeComponentProps> = ({
onError = () => {},
}) => {
const qrCode = useRef<any>();
const { colors } = useTheme();
const { colors, dark } = useTheme();
const handleShareQRCode = () => {
qrCode.current.toDataURL((data: string) => {
@ -82,11 +84,17 @@ const QRCodeComponent: React.FC<QRCodeComponentProps> = ({
}
}, []);
// Adjust the size of the QR code to account for the border width
const newSize = dark ? size - BORDER_WIDTH * 2 : size;
const stylesHook = StyleSheet.create({
container: { borderWidth: dark ? BORDER_WIDTH : 0 },
});
const renderQRCode = (
<QRCode
value={value}
{...(isLogoRendered ? { logo: require('../img/qr-code.png') } : {})}
size={size}
size={newSize}
logoSize={logoSize}
color="#000000"
logoBackgroundColor={colors.brandingColor}
@ -99,7 +107,7 @@ const QRCodeComponent: React.FC<QRCodeComponentProps> = ({
return (
<View
style={styles.qrCodeContainer}
style={[styles.container, stylesHook.container]}
testID="BitcoinAddressQRCodeContainer"
accessibilityIgnoresInvertColors
importantForAccessibility="no-hide-descendants"
@ -120,5 +128,5 @@ const QRCodeComponent: React.FC<QRCodeComponentProps> = ({
export default QRCodeComponent;
const styles = StyleSheet.create({
qrCodeContainer: { borderWidth: 6, borderRadius: 8, borderColor: '#FFFFFF' },
container: { borderRadius: 8, borderColor: '#FFFFFF' },
});

View File

@ -340,14 +340,13 @@ const styles = StyleSheet.create({
feeModalFooter: {
paddingVertical: 46,
flexDirection: 'row',
justifyContent: 'center',
alignContent: 'center',
alignItems: 'center',
minHeight: 80,
},
feeModalFooterSpacing: {
paddingHorizontal: 24,
paddingHorizontal: 16,
},
memo: {
flexDirection: 'row',

View File

@ -326,6 +326,7 @@ const ScanLndInvoice = () => {
launchedBy={name}
onBlur={onBlur}
keyboardType="email-address"
style={styles.addressInput}
/>
<View style={styles.description}>
<Text numberOfLines={0} style={styles.descriptionText}>
@ -418,7 +419,7 @@ const styles = StyleSheet.create({
},
description: {
flexDirection: 'row',
marginHorizontal: 20,
marginHorizontal: 16,
alignItems: 'center',
marginVertical: 0,
borderRadius: 4,
@ -435,4 +436,7 @@ const styles = StyleSheet.create({
left: 20,
top: 10,
},
addressInput: {
marginHorizontal: 16,
},
});

View File

@ -1264,10 +1264,10 @@ const SendDetails = () => {
onBarScanned={processAddressData}
address={item.address}
isLoading={isLoading}
/* @ts-ignore marcos fixme */
inputAccessoryViewID={DismissKeyboardInputAccessoryViewID}
launchedBy={name}
editable={isEditable}
style={styles.addressInput}
/>
{addresses.length > 1 && (
<Text style={[styles.of, stylesHook.of]}>{loc.formatString(loc._.of, { number: index + 1, total: addresses.length })}</Text>
@ -1312,7 +1312,6 @@ const SendDetails = () => {
style={styles.memoText}
editable={!isLoading}
onSubmitEditing={Keyboard.dismiss}
/* @ts-ignore marcos fixme */
inputAccessoryViewID={DismissKeyboardInputAccessoryViewID}
/>
</View>
@ -1415,7 +1414,7 @@ const styles = StyleSheet.create({
borderBottomWidth: 0.5,
minHeight: 44,
height: 44,
marginHorizontal: 20,
marginHorizontal: 16,
alignItems: 'center',
marginVertical: 8,
borderRadius: 4,
@ -1428,7 +1427,7 @@ const styles = StyleSheet.create({
},
fee: {
flexDirection: 'row',
marginHorizontal: 20,
marginHorizontal: 16,
justifyContent: 'space-between',
alignItems: 'center',
},
@ -1450,4 +1449,8 @@ const styles = StyleSheet.create({
alignItems: 'center',
marginVertical: 8,
},
addressInput: {
marginHorizontal: 16,
marginVertical: 8,
},
});