Merge branch 'master' into kbtype

This commit is contained in:
marcosrdz 2021-04-28 10:21:26 -04:00
commit 17c647bd36
5 changed files with 122 additions and 136 deletions

View file

@ -153,6 +153,9 @@ class AmountInput extends Component {
}
text = rez;
}
if (text.startsWith('0') && !(text.includes('.') || text.includes(','))) {
text = text.replace(/^(0+)/g, '');
}
text = text.replace(/[^\d.,-]/g, ''); // remove all but numbers, dots & commas
text = text.replace(/(\..*)\./g, '$1');
}

6
package-lock.json generated
View file

@ -5832,9 +5832,9 @@
}
},
"@react-navigation/drawer": {
"version": "5.12.4",
"resolved": "https://registry.npmjs.org/@react-navigation/drawer/-/drawer-5.12.4.tgz",
"integrity": "sha512-0O6OCTgCVnThx0XFsHd/48i6FeV7vxNvJYxeucantcdCwQMWJb46cVMsYGFYt49VwE8VX4Yg/KMZXMPfPxn7Pg==",
"version": "5.12.5",
"resolved": "https://registry.npmjs.org/@react-navigation/drawer/-/drawer-5.12.5.tgz",
"integrity": "sha512-WMfz/tKg/K7QBb5rhjXW/pho4zXh3OoHXnHETk5SuVzHlDPM7r84uvAeC5l+ySp5jmipLrJn3zL+kfv9+KKHZQ==",
"requires": {
"color": "^3.1.3",
"react-native-iphone-x-helper": "^1.3.0"

View file

@ -76,7 +76,7 @@
"@react-native-community/blur": "3.6.0",
"@react-native-community/masked-view": "0.1.10",
"@react-native-community/push-notification-ios": "1.8.0",
"@react-navigation/drawer": "5.12.4",
"@react-navigation/drawer": "5.12.5",
"@react-navigation/native": "5.9.3",
"@react-navigation/stack": "5.14.3",
"@remobile/react-native-qrcode-local-image": "git+https://github.com/BlueWallet/react-native-qrcode-local-image.git",

View file

@ -5,15 +5,7 @@ import { Icon } from 'react-native-elements';
import { getApplicationName, getVersion, getBundleId, getBuildNumber, getUniqueId } from 'react-native-device-info';
import Rate, { AndroidMarket } from 'react-native-rate';
import {
BlueButton,
BlueCard,
BlueListItem,
BlueSpacing20,
BlueTextCentered,
SafeBlueArea,
BlueCopyToClipboardButton,
} from '../../BlueComponents';
import { BlueButton, BlueCard, BlueListItem, BlueSpacing20, BlueTextCentered, BlueCopyToClipboardButton } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import loc from '../../loc';
@ -114,113 +106,111 @@ const About = () => {
};
return (
<SafeBlueArea>
<ScrollView testID="AboutScrollView">
<BlueCard>
<View style={styles.center}>
<Image style={styles.logo} source={require('../../img/bluebeast.png')} />
<Text style={styles.textFree}>{loc.settings.about_free}</Text>
<Text style={styles.textBackup}>{loc.settings.about_backup}</Text>
<BlueButton onPress={handleOnRatePress} title={loc.settings.about_review + ' ⭐🙏'} />
</View>
</BlueCard>
<BlueListItem
leftIcon={{
name: 'twitter',
type: 'font-awesome',
color: '#1da1f2',
}}
onPress={handleOnTwitterPress}
title={loc.settings.about_sm_twitter}
/>
<BlueListItem
leftIcon={{
name: 'telegram',
type: 'font-awesome',
color: '#0088cc',
}}
onPress={handleOnTelegramPress}
title={loc.settings.about_sm_telegram}
/>
<BlueListItem
leftIcon={{
name: 'discord',
type: 'font-awesome-5',
color: '#7289da',
}}
onPress={handleOnDiscordPress}
title={loc.settings.about_sm_discord}
/>
<BlueCard>
<View style={styles.buildWith}>
<BlueSpacing20 />
<BlueTextCentered>{loc.settings.about_awesome} 👍</BlueTextCentered>
<BlueSpacing20 />
<BlueTextCentered>React Native</BlueTextCentered>
<BlueTextCentered>bitcoinjs-lib</BlueTextCentered>
<BlueTextCentered>Nodejs</BlueTextCentered>
<BlueTextCentered>Electrum server</BlueTextCentered>
<BlueSpacing20 />
<TouchableOpacity onPress={handleOnGithubPress} style={styles.buttonLink}>
<Icon size={22} name="github" type="font-awesome-5" color={colors.foregroundColor} />
<Text style={styles.textLink}>{loc.settings.about_sm_github}</Text>
</TouchableOpacity>
</View>
</BlueCard>
<BlueListItem
leftIcon={{
name: 'book',
type: 'font-awesome',
color: '#9AA0AA',
}}
chevron
onPress={handleOnReleaseNotesPress}
title={loc.settings.about_release_notes}
/>
<BlueListItem
leftIcon={{
name: 'law',
type: 'octicon',
color: colors.foregroundColor,
}}
chevron
onPress={handleOnLicensingPress}
title={loc.settings.about_license}
/>
<BlueListItem
leftIcon={{
name: 'flask',
type: 'font-awesome',
color: '#FC0D44',
}}
chevron
onPress={handleOnSelfTestPress}
testID="RunSelfTestButton"
title={loc.settings.about_selftest}
/>
<BlueSpacing20 />
<BlueSpacing20 />
<BlueTextCentered>
{getApplicationName()} ver {getVersion()} (build {getBuildNumber()})
</BlueTextCentered>
<BlueTextCentered>{new Date(getBuildNumber() * 1000).toGMTString()}</BlueTextCentered>
<BlueTextCentered>{getBundleId()}</BlueTextCentered>
<BlueTextCentered>
w, h = {width}, {height}
</BlueTextCentered>
<BlueTextCentered>Unique ID: {getUniqueId()}</BlueTextCentered>
<View style={styles.copyToClipboard}>
<BlueCopyToClipboardButton
stringToCopy={(Platform.OS === 'android' ? 'user.id:' : 'app.device:') + getUniqueId()}
displayText={loc.transactions.details_copy}
/>
<ScrollView testID="AboutScrollView" contentInsetAdjustmentBehavior="automatic">
<BlueCard>
<View style={styles.center}>
<Image style={styles.logo} source={require('../../img/bluebeast.png')} />
<Text style={styles.textFree}>{loc.settings.about_free}</Text>
<Text style={styles.textBackup}>{loc.settings.about_backup}</Text>
<BlueButton onPress={handleOnRatePress} title={loc.settings.about_review + ' ⭐🙏'} />
</View>
<BlueSpacing20 />
<BlueSpacing20 />
</ScrollView>
</SafeBlueArea>
</BlueCard>
<BlueListItem
leftIcon={{
name: 'twitter',
type: 'font-awesome',
color: '#1da1f2',
}}
onPress={handleOnTwitterPress}
title={loc.settings.about_sm_twitter}
/>
<BlueListItem
leftIcon={{
name: 'telegram',
type: 'font-awesome',
color: '#0088cc',
}}
onPress={handleOnTelegramPress}
title={loc.settings.about_sm_telegram}
/>
<BlueListItem
leftIcon={{
name: 'discord',
type: 'font-awesome-5',
color: '#7289da',
}}
onPress={handleOnDiscordPress}
title={loc.settings.about_sm_discord}
/>
<BlueCard>
<View style={styles.buildWith}>
<BlueSpacing20 />
<BlueTextCentered>{loc.settings.about_awesome} 👍</BlueTextCentered>
<BlueSpacing20 />
<BlueTextCentered>React Native</BlueTextCentered>
<BlueTextCentered>bitcoinjs-lib</BlueTextCentered>
<BlueTextCentered>Nodejs</BlueTextCentered>
<BlueTextCentered>Electrum server</BlueTextCentered>
<BlueSpacing20 />
<TouchableOpacity onPress={handleOnGithubPress} style={styles.buttonLink}>
<Icon size={22} name="github" type="font-awesome-5" color={colors.foregroundColor} />
<Text style={styles.textLink}>{loc.settings.about_sm_github}</Text>
</TouchableOpacity>
</View>
</BlueCard>
<BlueListItem
leftIcon={{
name: 'book',
type: 'font-awesome',
color: '#9AA0AA',
}}
chevron
onPress={handleOnReleaseNotesPress}
title={loc.settings.about_release_notes}
/>
<BlueListItem
leftIcon={{
name: 'law',
type: 'octicon',
color: colors.foregroundColor,
}}
chevron
onPress={handleOnLicensingPress}
title={loc.settings.about_license}
/>
<BlueListItem
leftIcon={{
name: 'flask',
type: 'font-awesome',
color: '#FC0D44',
}}
chevron
onPress={handleOnSelfTestPress}
testID="RunSelfTestButton"
title={loc.settings.about_selftest}
/>
<BlueSpacing20 />
<BlueSpacing20 />
<BlueTextCentered>
{getApplicationName()} ver {getVersion()} (build {getBuildNumber()})
</BlueTextCentered>
<BlueTextCentered>{new Date(getBuildNumber() * 1000).toGMTString()}</BlueTextCentered>
<BlueTextCentered>{getBundleId()}</BlueTextCentered>
<BlueTextCentered>
w, h = {width}, {height}
</BlueTextCentered>
<BlueTextCentered>Unique ID: {getUniqueId()}</BlueTextCentered>
<View style={styles.copyToClipboard}>
<BlueCopyToClipboardButton
stringToCopy={(Platform.OS === 'android' ? 'user.id:' : 'app.device:') + getUniqueId()}
displayText={loc.transactions.details_copy}
/>
</View>
<BlueSpacing20 />
<BlueSpacing20 />
</ScrollView>
);
};

View file

@ -4,7 +4,7 @@ import { FlatList, StyleSheet } from 'react-native';
import { useNavigation, useTheme } from '@react-navigation/native';
import navigationStyle from '../../components/navigationStyle';
import { SafeBlueArea, BlueListItem, BlueLoading } from '../../BlueComponents';
import { BlueListItem } from '../../BlueComponents';
import loc from '../../loc';
import { AvailableLanguages } from '../../loc/languages';
import { BlueStorageContext } from '../../blue_modules/storage-context';
@ -17,7 +17,6 @@ const styles = StyleSheet.create({
const Language = () => {
const { setLanguage, language } = useContext(BlueStorageContext);
const [isLoading, setIsLoading] = useState(true);
const [selectedLanguage, setSelectedLanguage] = useState(loc.getLanguage());
const { setOptions } = useNavigation();
const { colors } = useTheme();
@ -26,9 +25,6 @@ const Language = () => {
backgroundColor: colors.background,
},
});
useEffect(() => {
setIsLoading(false);
}, []);
useEffect(() => {
setOptions({ title: loc.settings.language });
@ -54,18 +50,15 @@ const Language = () => {
);
};
return isLoading ? (
<BlueLoading />
) : (
<SafeBlueArea>
<FlatList
style={[styles.flex, stylesHook.flex]}
keyExtractor={(_item, index) => `${index}`}
data={AvailableLanguages}
renderItem={renderItem}
initialNumToRender={25}
/>
</SafeBlueArea>
return (
<FlatList
style={[styles.flex, stylesHook.flex]}
keyExtractor={(_item, index) => `${index}`}
data={AvailableLanguages}
renderItem={renderItem}
initialNumToRender={25}
contentInsetAdjustmentBehavior="automatic"
/>
);
};