BlueWallet/components/WalletToImport.tsx

66 lines
1.6 KiB
TypeScript
Raw Normal View History

import React from 'react';
import { I18nManager, StyleSheet, TouchableOpacity, View } from 'react-native';
2024-06-12 18:46:44 +02:00
import { Text } from '@rneui/themed';
2024-05-20 11:54:13 +02:00
2023-10-24 03:28:44 +02:00
import { useTheme } from './themes';
2024-02-17 17:21:35 +01:00
interface WalletToImportProp {
title: string;
subtitle: string;
active: boolean;
onPress: () => void;
}
const WalletToImport: React.FC<WalletToImportProp> = ({ title, subtitle, active, onPress }) => {
const { colors } = useTheme();
const stylesHooks = StyleSheet.create({
root: {
borderColor: active ? colors.newBlue : colors.buttonDisabledBackgroundColor,
backgroundColor: colors.buttonDisabledBackgroundColor,
},
title: {
color: colors.newBlue,
writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr',
},
subtitle: {
color: colors.alternativeTextColor,
writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr',
},
});
return (
<TouchableOpacity accessibilityRole="button" onPress={onPress}>
<View style={[styles.root, stylesHooks.root]}>
<Text style={[styles.title, stylesHooks.title]}>{title}</Text>
<Text style={[styles.subtitle, stylesHooks.subtitle]}>{subtitle}</Text>
</View>
</TouchableOpacity>
);
};
const styles = StyleSheet.create({
root: {
alignItems: 'stretch',
borderRadius: 8,
borderWidth: 1.5,
flexDirection: 'column',
justifyContent: 'center',
marginBottom: 8,
minWidth: '100%',
paddingHorizontal: 16,
paddingVertical: 10,
},
title: {
fontWeight: 'bold',
fontSize: 15,
paddingBottom: 3,
},
subtitle: {
fontSize: 13,
fontWeight: '500',
},
});
export default WalletToImport;