Merge pull request #2223 from BlueWallet/androidfix

FIX: Address layout on multisig #2193
This commit is contained in:
GLaDOS 2020-12-01 15:20:40 +00:00 committed by GitHub
commit 315930a45a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,6 +40,9 @@ const PsbtMultisig = () => {
root: { root: {
backgroundColor: colors.elevated, backgroundColor: colors.elevated,
}, },
whitespace: {
color: colors.elevated,
},
textBtc: { textBtc: {
color: colors.buttonAlternativeTextColor, color: colors.buttonAlternativeTextColor,
}, },
@ -280,11 +283,12 @@ const PsbtMultisig = () => {
const destinationAddress = () => { const destinationAddress = () => {
// eslint-disable-next-line prefer-const // eslint-disable-next-line prefer-const
let destinationAddressView = []; let destinationAddressView = [];
const whitespace = '_';
const destinations = Object.entries(destination.split(',')); const destinations = Object.entries(destination.split(','));
for (const [index, address] of destinations) { for (const [index, address] of destinations) {
if (index > 1) { if (index > 1) {
destinationAddressView.push( destinationAddressView.push(
<View style={styles.destionationTextContainer} key={`end-${index}`}> <View style={styles.destinationTextContainer} key={`end-${index}`}>
<Text numberOfLines={0} style={[styles.textDestinationFirstFour, stylesHook.textFiat]}> <Text numberOfLines={0} style={[styles.textDestinationFirstFour, stylesHook.textFiat]}>
and {destinations.length - 2} more... and {destinations.length - 2} more...
</Text> </Text>
@ -297,13 +301,15 @@ const PsbtMultisig = () => {
const lastFour = currentAddress.substring(currentAddress.length - 5, currentAddress.length); const lastFour = currentAddress.substring(currentAddress.length - 5, currentAddress.length);
const middle = currentAddress.split(firstFour)[1].split(lastFour)[0]; const middle = currentAddress.split(firstFour)[1].split(lastFour)[0];
destinationAddressView.push( destinationAddressView.push(
<View style={styles.destionationTextContainer} key={`${currentAddress}-${index}`}> <View style={styles.destinationTextContainer} key={`${currentAddress}-${index}`}>
<Text numberOfLines={2} style={[styles.textDestinationFirstFour, stylesHook.textBtc]}> <Text style={styles.textAlignCenter}>
{firstFour} <Text numberOfLines={2} style={[styles.textDestinationFirstFour, stylesHook.textBtc]}>
<Text> </Text> {firstFour}
<Text style={[styles.textDestination, stylesHook.textFiat]}>{middle}</Text> <Text style={stylesHook.whitespace}>{whitespace}</Text>
<Text> </Text> <Text style={[styles.textDestination, stylesHook.textFiat]}>{middle}</Text>
<Text style={[styles.textDestinationFirstFour, stylesHook.textBtc]}>{lastFour}</Text> <Text style={stylesHook.whitespace}>{whitespace}</Text>
<Text style={[styles.textDestinationFirstFour, stylesHook.textBtc]}>{lastFour}</Text>
</Text>
</Text> </Text>
</View>, </View>,
); );
@ -422,7 +428,7 @@ const styles = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'center', justifyContent: 'center',
}, },
destionationTextContainer: { destinationTextContainer: {
flexDirection: 'row', flexDirection: 'row',
marginBottom: 4, marginBottom: 4,
paddingHorizontal: 60, paddingHorizontal: 60,
@ -438,6 +444,9 @@ const styles = StyleSheet.create({
fontWeight: 'bold', fontWeight: 'bold',
fontSize: 30, fontSize: 30,
}, },
textAlignCenter: {
textAlign: 'center',
},
textDestinationFirstFour: { textDestinationFirstFour: {
fontSize: 14, fontSize: 14,
}, },