import React, { useContext } from 'react'; import Clipboard from '@react-native-clipboard/clipboard'; import { useNavigation } from '@react-navigation/native'; import { Alert, Image, Linking, Platform, ScrollView, StyleSheet, Text, TouchableOpacity, View, useWindowDimensions } from 'react-native'; import { getApplicationName, getBuildNumber, getBundleId, getUniqueIdSync, getVersion, hasGmsSync } from 'react-native-device-info'; import { Icon } from 'react-native-elements'; import Rate, { AndroidMarket } from 'react-native-rate'; import { BlueCard, BlueSpacing20, BlueTextCentered } from '../../BlueComponents'; import A from '../../blue_modules/analytics'; import { BlueStorageContext } from '../../blue_modules/storage-context'; import { HDSegwitBech32Wallet } from '../../class'; import presentAlert from '../../components/Alert'; import Button from '../../components/Button'; import ListItem from '../../components/ListItem'; import navigationStyle from '../../components/navigationStyle'; import { useTheme } from '../../components/themes'; import loc, { formatStringAddTwoWhiteSpaces } from '../../loc'; const branch = require('../../current-branch.json'); const About = () => { const { navigate } = useNavigation(); const { colors } = useTheme(); const { width, height } = useWindowDimensions(); const { isElectrumDisabled } = useContext(BlueStorageContext); const styles = StyleSheet.create({ copyToClipboard: { justifyContent: 'center', alignItems: 'center', }, copyToClipboardText: { fontSize: 13, fontWeight: '400', color: '#68bbe1', }, center: { justifyContent: 'center', alignItems: 'center', marginTop: 54, }, logo: { width: 102, height: 124, }, textFree: { maxWidth: 260, marginVertical: 24, color: '#9AA0AA', fontSize: 15, textAlign: 'center', fontWeight: '500', }, textBackup: { maxWidth: 260, marginBottom: 40, color: colors.foregroundColor, fontSize: 15, textAlign: 'center', fontWeight: '500', }, buildWith: { backgroundColor: colors.inputBackgroundColor, padding: 16, paddingTop: 0, borderRadius: 8, }, buttonLink: { backgroundColor: colors.lightButton, borderRadius: 12, justifyContent: 'center', padding: 8, flexDirection: 'row', }, textLink: { color: colors.foregroundColor, marginLeft: 8, fontWeight: '600', }, }); const handleOnReleaseNotesPress = () => { navigate('ReleaseNotes'); }; const handleOnSelfTestPress = () => { if (isElectrumDisabled) { presentAlert({ message: loc.settings.about_selftest_electrum_disabled }); } else { navigate('Selftest'); } }; const handleOnLicensingPress = () => { navigate('Licensing'); }; const handleOnTwitterPress = () => { Linking.openURL('https://twitter.com/bluewalletio'); }; const handleOnDiscordPress = () => { Linking.openURL('https://discord.gg/btWq2Aby2z'); }; const handleOnTelegramPress = () => { Linking.openURL('https://t.me/bluewallethat'); }; const handleOnGithubPress = () => { Linking.openURL('https://github.com/BlueWallet/BlueWallet'); }; const handleOnRatePress = () => { const options = { AppleAppID: '1376878040', GooglePackageName: 'io.bluewallet.bluewallet', preferredAndroidMarket: AndroidMarket.Google, preferInApp: Platform.OS !== 'android', openAppStoreIfInAppFails: true, fallbackPlatformURL: 'https://bluewallet.io', }; Rate.rate(options, success => { if (success) { console.log('User Rated.'); } }); }; return ( {loc.settings.about_free} {formatStringAddTwoWhiteSpaces(loc.settings.about_backup)} {((Platform.OS === 'android' && hasGmsSync()) || Platform.OS !== 'android') && (