FIX: styles on transaction/details screen

This commit is contained in:
Ivan Vershigora 2021-08-20 11:16:57 +03:00
parent d5d589b906
commit 4263ada9f0
2 changed files with 9 additions and 24 deletions

View file

@ -382,17 +382,8 @@ export const BlueCard = props => {
export const BlueText = props => { export const BlueText = props => {
const { colors } = useTheme(); const { colors } = useTheme();
return ( const style = StyleSheet.compose({ color: colors.foregroundColor, writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr' }, props.style);
<Text return <Text {...props} style={style} />;
{...props}
style={{
color: colors.foregroundColor,
...props.style,
writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr',
}}
/>
);
}; };
export const BlueTextCentered = props => { export const BlueTextCentered = props => {

View file

@ -36,12 +36,6 @@ const TransactionsDetails = () => {
const [memo, setMemo] = useState(); const [memo, setMemo] = useState();
const { colors } = useTheme(); const { colors } = useTheme();
const stylesHooks = StyleSheet.create({ const stylesHooks = StyleSheet.create({
rowCaption: {
color: colors.foregroundColor,
},
txId: {
color: colors.foregroundColor,
},
txLink: { txLink: {
color: colors.alternativeTextColor2, color: colors.alternativeTextColor2,
}, },
@ -163,7 +157,7 @@ const TransactionsDetails = () => {
{from && ( {from && (
<> <>
<View style={styles.rowHeader}> <View style={styles.rowHeader}>
<BlueText style={[styles.rowCaption, stylesHooks.rowCaption]}>{loc.transactions.details_from}</BlueText> <BlueText style={styles.rowCaption}>{loc.transactions.details_from}</BlueText>
<BlueCopyToClipboardButton stringToCopy={from.filter(onlyUnique).join(', ')} /> <BlueCopyToClipboardButton stringToCopy={from.filter(onlyUnique).join(', ')} />
</View> </View>
<BlueText style={styles.rowValue}>{from.filter(onlyUnique).join(', ')}</BlueText> <BlueText style={styles.rowValue}>{from.filter(onlyUnique).join(', ')}</BlueText>
@ -173,7 +167,7 @@ const TransactionsDetails = () => {
{to && ( {to && (
<> <>
<View style={styles.rowHeader}> <View style={styles.rowHeader}>
<BlueText style={[styles.rowCaption, stylesHooks.rowCaption]}>{loc.transactions.details_to}</BlueText> <BlueText style={styles.rowCaption}>{loc.transactions.details_to}</BlueText>
<BlueCopyToClipboardButton stringToCopy={to.filter(onlyUnique).join(', ')} /> <BlueCopyToClipboardButton stringToCopy={to.filter(onlyUnique).join(', ')} />
</View> </View>
<BlueText style={styles.rowValue}>{arrDiff(from, to.filter(onlyUnique)).join(', ')}</BlueText> <BlueText style={styles.rowValue}>{arrDiff(from, to.filter(onlyUnique)).join(', ')}</BlueText>
@ -182,7 +176,7 @@ const TransactionsDetails = () => {
{tx.fee && ( {tx.fee && (
<> <>
<BlueText style={[styles.rowCaption, stylesHooks.rowCaption]}>{loc.send.create_fee}</BlueText> <BlueText style={styles.rowCaption}>{loc.send.create_fee}</BlueText>
<BlueText style={styles.rowValue}>{tx.fee + ' sats'}</BlueText> <BlueText style={styles.rowValue}>{tx.fee + ' sats'}</BlueText>
</> </>
)} )}
@ -199,28 +193,28 @@ const TransactionsDetails = () => {
{tx.received && ( {tx.received && (
<> <>
<BlueText style={[styles.rowCaption, stylesHooks.rowCaption]}>{loc.transactions.details_received}</BlueText> <BlueText style={styles.rowCaption}>{loc.transactions.details_received}</BlueText>
<BlueText style={styles.rowValue}>{dayjs(tx.received).format('LLL')}</BlueText> <BlueText style={styles.rowValue}>{dayjs(tx.received).format('LLL')}</BlueText>
</> </>
)} )}
{tx.block_height > 0 && ( {tx.block_height > 0 && (
<> <>
<BlueText style={[styles.rowCaption, stylesHooks.rowCaption]}>{loc.transactions.details_block}</BlueText> <BlueText style={styles.rowCaption}>{loc.transactions.details_block}</BlueText>
<BlueText style={styles.rowValue}>{tx.block_height}</BlueText> <BlueText style={styles.rowValue}>{tx.block_height}</BlueText>
</> </>
)} )}
{tx.inputs && ( {tx.inputs && (
<> <>
<BlueText style={[styles.rowCaption, stylesHooks.rowCaption]}>{loc.transactions.details_inputs}</BlueText> <BlueText style={styles.rowCaption}>{loc.transactions.details_inputs}</BlueText>
<BlueText style={styles.rowValue}>{tx.inputs.length}</BlueText> <BlueText style={styles.rowValue}>{tx.inputs.length}</BlueText>
</> </>
)} )}
{tx.outputs?.length > 0 && ( {tx.outputs?.length > 0 && (
<> <>
<BlueText style={[styles.rowCaption, stylesHooks.rowCaption]}>{loc.transactions.details_outputs}</BlueText> <BlueText style={styles.rowCaption}>{loc.transactions.details_outputs}</BlueText>
<BlueText style={styles.rowValue}>{tx.outputs.length}</BlueText> <BlueText style={styles.rowValue}>{tx.outputs.length}</BlueText>
</> </>
)} )}