Skip to content

Commit

Permalink
Use default QR code colors (#4639)
Browse files Browse the repository at this point in the history
* Use default QR code colors

* Add padding to QR codes

Co-authored-by: Gustavo Antunes <17601467+gantunesr@users.noreply.github.com>
  • Loading branch information
Cal-L and gantunesr authored Jul 29, 2022
1 parent 04f03b9 commit a0549ac
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 28 deletions.
11 changes: 4 additions & 7 deletions app/components/UI/PaymentRequestSuccess/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
TouchableOpacity,
} from 'react-native';
import { connect } from 'react-redux';
import { fontStyles } from '../../../styles/common';
import { fontStyles, colors as importedColors } from '../../../styles/common';
import { getPaymentRequestSuccessOptionsTitle } from '../../UI/Navbar';
import PropTypes from 'prop-types';
import EvilIcons from 'react-native-vector-icons/EvilIcons';
Expand Down Expand Up @@ -149,10 +149,9 @@ const createStyles = (colors) =>
borderRadius: 8,
},
qrCodeWrapper: {
borderColor: colors.border.default,
borderRadius: 8,
borderWidth: 1,
padding: 15,
marginVertical: 8,
padding: 8,
backgroundColor: importedColors.white,
},
});

Expand Down Expand Up @@ -389,8 +388,6 @@ class PaymentRequestSuccess extends PureComponent {
<QRCode
value={this.state.qrLink}
size={Dimensions.get('window').width - 160}
color={colors.text.default}
backgroundColor={colors.background.default}
/>
</View>
</View>
Expand Down
8 changes: 4 additions & 4 deletions app/components/UI/ReceiveRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { showAlert } from '../../../actions/alert';
import { toggleReceiveModal } from '../../../actions/modals';
import { protectWalletModalVisible } from '../../../actions/user';

import { fontStyles } from '../../../styles/common';
import { fontStyles, colors as importedColors } from '../../../styles/common';
import Text from '../../Base/Text';
import ModalHandler from '../../Base/ModalHandler';
import ModalDragger from '../../Base/ModalDragger';
Expand All @@ -52,7 +52,9 @@ const createStyles = (colors) =>
paddingHorizontal: 15,
},
qrWrapper: {
margin: 15,
margin: 8,
padding: 8,
backgroundColor: importedColors.white,
},
addressWrapper: {
flexDirection: 'row',
Expand Down Expand Up @@ -274,8 +276,6 @@ class ReceiveRequest extends PureComponent {
<QRCode
value={`ethereum:${this.props.selectedAddress}@${this.props.chainId}`}
size={Dimensions.get('window').width / 2}
color={colors.text.default}
backgroundColor={colors.background.default}
/>
</TouchableOpacity>
<Modal
Expand Down
24 changes: 14 additions & 10 deletions app/components/Views/AddressQRCode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
View,
Text,
} from 'react-native';
import { fontStyles } from '../../../styles/common';
import { fontStyles, colors as importedColors } from '../../../styles/common';
import { connect } from 'react-redux';
import QRCode from 'react-native-qrcode-svg';
import { strings } from '../../../../locales/i18n';
Expand All @@ -33,14 +33,18 @@ const createStyles = (colors) =>
flex: 1,
alignItems: 'center',
},
qrCode: {
qrCodeContainer: {
marginBottom: 16,
alignItems: 'center',
justifyContent: 'center',
padding: 36,
padding: 28,
backgroundColor: colors.background.default,
borderRadius: 8,
},
qrCode: {
padding: 8,
backgroundColor: importedColors.white,
},
addressWrapper: {
alignItems: 'center',
justifyContent: 'center',
Expand Down Expand Up @@ -146,13 +150,13 @@ class AddressQRCode extends PureComponent {
color={colors.overlay.inverse}
/>
</TouchableOpacity>
<View style={styles.qrCode}>
<QRCode
value={`ethereum:${this.props.selectedAddress}`}
size={Dimensions.get('window').width - 160}
color={colors.text.default}
backgroundColor={colors.background.default}
/>
<View style={styles.qrCodeContainer}>
<View style={styles.qrCode}>
<QRCode
value={`ethereum:${this.props.selectedAddress}`}
size={Dimensions.get('window').width - 160}
/>
</View>
</View>
<View style={styles.addressWrapper}>
<Text style={styles.addressTitle}>
Expand Down
18 changes: 11 additions & 7 deletions app/components/Views/RevealPrivateCredential/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { ThemeContext, mockTheme } from '../../../util/theme';
import Engine from '../../../core/Engine';
import PreventScreenshot from '../../../core/PreventScreenshot';
import SecureKeychain from '../../../core/SecureKeychain';
import { fontStyles } from '../../../styles/common';
import { fontStyles, colors as importedColors } from '../../../styles/common';
import AnalyticsV2 from '../../../util/analyticsV2';
import Device from '../../../util/device';
import { strings } from '../../../../locales/i18n';
Expand Down Expand Up @@ -145,6 +145,10 @@ const createStyles = (colors) =>
alignItems: 'center',
justifyContent: 'center',
},
qrCode: {
padding: 8,
backgroundColor: importedColors.white,
},
tabUnderlineStyle: {
height: 2,
backgroundColor: colors.primary.default,
Expand Down Expand Up @@ -487,12 +491,12 @@ class RevealPrivateCredential extends PureComponent {
style={styles.tabContent}
>
<View style={styles.qrCodeWrapper}>
<QRCode
value={clipboardPrivateCredential}
size={Dimensions.get('window').width - 160}
color={colors.text.default}
backgroundColor={colors.background.default}
/>
<View style={styles.qrCode}>
<QRCode
value={clipboardPrivateCredential}
size={Dimensions.get('window').width - 176}
/>
</View>
</View>
</View>
</ScrollableTabView>
Expand Down

0 comments on commit a0549ac

Please sign in to comment.