From 1b745c1ada1ea63ffc0c7e61b44173bb80a0851f Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Thu, 8 Apr 2021 13:30:31 +0300 Subject: [PATCH 001/110] Address modal ui2 design. --- src/components/modals/AddressModal.js | 263 ++++++++++++------------- src/components/themed/EdgeTextField.js | 5 +- src/components/themed/ModalParts.js | 23 ++- src/components/themed/ThemedButtons.js | 2 +- src/theme/variables/edgeDark.js | 2 +- 5 files changed, 150 insertions(+), 145 deletions(-) diff --git a/src/components/modals/AddressModal.js b/src/components/modals/AddressModal.js index 9762e733abe..e355e11813f 100644 --- a/src/components/modals/AddressModal.js +++ b/src/components/modals/AddressModal.js @@ -1,29 +1,31 @@ // @flow import Clipboard from '@react-native-community/clipboard' -import { FormField, MaterialInputStyle, TertiaryButton } from 'edge-components' +import { TertiaryButton } from 'edge-components' import type { EdgeAccount, EdgeCurrencyConfig, EdgeCurrencyWallet } from 'edge-core-js' import * as React from 'react' -import { ActivityIndicator, FlatList, Image, InputAccessoryView, Platform, StyleSheet, TouchableOpacity, TouchableWithoutFeedback, View } from 'react-native' -import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome' +import { ActivityIndicator, FlatList, Image, InputAccessoryView, Platform, TouchableOpacity, TouchableWithoutFeedback, View } from 'react-native' import { connect } from 'react-redux' import { sprintf } from 'sprintf-js' import ENS_LOGO from '../../assets/images/ens_logo.png' -import FIO_LOGO from '../../assets/images/fio_logo.png' +import FIO_LOGO from '../../assets/images/fio/fio_logo.png' import { CURRENCY_PLUGIN_NAMES } from '../../constants/indexConstants.js' import s from '../../locales/strings.js' import { refreshAllFioAddresses } from '../../modules/FioAddress/action' import { type FioAddresses, checkPubAddress, getFioAddressCache } from '../../modules/FioAddress/util.js' import Text from '../../modules/UI/components/FormattedText/FormattedText.ui.js' -import THEME from '../../theme/variables/airbitz.js' import { type Dispatch, type RootState } from '../../types/reduxTypes.js' import type { FioAddress, FlatListItem } from '../../types/types.js' import { KeyboardTracker } from '../common/KeyboardTracker.js' import ResolutionError, { ResolutionErrorCode } from '../common/ResolutionError.js' -import { type AirshipBridge, AirshipModal, dayText, IconCircle } from './modalParts.js' +import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../services/ThemeContext.js' +import { EdgeTextFieldOutlined } from '../themed/EdgeTextField' +import { ModalCloseArrow, ModalTitle } from '../themed/ModalParts.js' +import { SecondaryButton } from '../themed/ThemedButtons.js' +import { ThemedModal } from '../themed/ThemedModal.js' +import { type AirshipBridge } from './modalParts.js' -const MODAL_ICON = 'address-book-o' const inputAccessoryViewID: string = 'inputAccessoryViewID' type OwnProps = { @@ -31,7 +33,6 @@ type OwnProps = { walletId: string, currencyCode: string, title?: string, - subtitle?: string, showPasteButton?: boolean, isFioOnly?: boolean, useUserFioAddressesOnly?: boolean, @@ -57,13 +58,15 @@ type State = { fieldError: string, cryptoAddress?: string, fioAddresses: FioAddresses, - filteredFioAddresses: string[] + filteredFioAddresses: string[], + isFocused: boolean } -type Props = StateProps & OwnProps & DispatchProps +type Props = StateProps & OwnProps & DispatchProps & ThemeProps class AddressModalConnected extends React.Component { fioCheckQueue: number = 0 + textInput = React.createRef() constructor(props: Props) { super(props) @@ -75,13 +78,18 @@ class AddressModalConnected extends React.Component { cryptoAddress: undefined, fieldError: '', fioAddresses: { addresses: {} }, - filteredFioAddresses: [] + filteredFioAddresses: [], + isFocused: false } } componentDidMount() { this._setClipboard(this.props) this.getFioAddresses() + + if (this.textInput.current) { + this.textInput.current.focus() + } } componentDidUpdate(prevProps) { @@ -151,6 +159,21 @@ class AddressModalConnected extends React.Component { this.setState({ filteredFioAddresses: fioAddressesArray.sort() }) } + clearText = () => { + this.setState({ uri: '' }) + if (this.textInput.current) { + this.textInput.current.blur() + } + } + + fieldOnFocus = () => { + this.setState({ isFocused: true }) + } + + fieldOnBlur = () => { + this.setState({ isFocused: false }) + } + onChangeTextDelayed = (domain: string) => { const { currencyCode } = this.props if (this.checkIfDomain(domain)) { @@ -296,6 +319,7 @@ class AddressModalConnected extends React.Component { } renderFioAddressRow = ({ item }: FlatListItem) => { + const styles = getStyles(this.props.theme) let addressType if (this.checkIfDomain(item)) { addressType = ENS_LOGO @@ -306,7 +330,7 @@ class AddressModalConnected extends React.Component { } return ( this.onPressFioAddress(item)}> - + {item} @@ -323,80 +347,83 @@ class AddressModalConnected extends React.Component { handleClose = () => this.props.bridge.resolve(null) keyExtractor = (item: string, index: number) => index.toString() - render() { + + renderTracker = (keyboardAnimation, keyboardLayout) => { + const { showPasteButton } = this.props + const styles = getStyles(this.props.theme) const copyMessage = this.state.clipboard ? sprintf(s.strings.string_paste_address, this.state.clipboard) : null - const { uri, statusLabel, fieldError, filteredFioAddresses } = this.state - const { title, subtitle, showPasteButton, userFioAddressesLoading } = this.props + if (keyboardLayout === 0 && showPasteButton && copyMessage) { + return ( + + + {copyMessage} + + + ) + } + return null + } + + render() { + const { uri, statusLabel, fieldError, filteredFioAddresses, isFocused } = this.state + const { title, userFioAddressesLoading } = this.props + const styles = getStyles(this.props.theme) + return ( - - {gap => ( - <> - - - - - - {title || s.strings.address_modal_default_header} - {subtitle && {subtitle}} - - - {(keyboardAnimation, keyboardLayout) => { - if (keyboardLayout === 0 && showPasteButton && copyMessage) { - return ( - - - {copyMessage} - - - ) - } - return null - }} - - - {Platform.OS === 'ios' ? ( - - - - {s.strings.string_cancel_cap} - - - - ) : null} - + + + {title || s.strings.address_modal_default_header} + + + {this.renderTracker} + {Platform.OS === 'ios' ? ( + + + + {s.strings.string_cancel_cap} + - {!userFioAddressesLoading ? ( - - ) : ( - - - - )} + + ) : null} + + + {!userFioAddressesLoading ? ( + + ) : ( + + - - )} - + )} + + + + ) } } @@ -414,75 +441,38 @@ const AddressModal = connect( } }, (dispatch: Dispatch): DispatchProps => ({ refreshAllFioAddresses: () => dispatch(refreshAllFioAddresses()) }) -)(AddressModalConnected) +)(withTheme(AddressModalConnected)) export { AddressModal } -const { rem } = THEME - -const addressInputStyles = { - ...MaterialInputStyle, - container: { - ...MaterialInputStyle.container, - paddingTop: 0 - } -} - -const iconStyles = { - size: rem(1.5), - color: THEME.COLORS.SECONDARY -} - -const tileStyles = { - width: '100%', - backgroundColor: THEME.COLORS.WHITE, - borderBottomWidth: 1, - borderBottomColor: THEME.COLORS.GRAY_3, - padding: rem(0.75) -} - -const rawStyles = { +const getStyles = cacheStyles((theme: Theme) => ({ container: { flex: 1, width: '100%', flexDirection: 'column' }, - tileContainerHeader: { - ...tileStyles, - borderBottomWidth: 0, - paddingTop: rem(0.75), - paddingBottom: rem(0.375) - }, tileContainerButtons: { - ...tileStyles, - paddingTop: rem(0.375), - paddingBottom: 0, + paddingBottom: theme.rem(0.5), + paddingHorizontal: theme.rem(0.75), borderBottomWidth: 0, flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }, - tileContainerInput: { - ...tileStyles, - paddingVertical: 0, + rowContainer: { flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center' - }, - tileContainer: { - ...tileStyles, - flexDirection: 'row', - alignItems: 'center' + alignItems: 'center', + marginVertical: theme.rem(0.5) }, fioAddressAvatarContainer: { - width: rem(2.2), - height: rem(2.2), - borderRadius: rem(1.1), + width: theme.rem(1.25), + height: theme.rem(2.2), justifyContent: 'center', alignItems: 'center' }, fioAddressText: { - fontSize: rem(1), - paddingLeft: rem(0.75) + fontSize: theme.rem(1), + paddingLeft: theme.rem(0.75), + color: theme.primaryText }, addressModalButton: { width: '100%' @@ -498,14 +488,13 @@ const rawStyles = { flex: 1, flexDirection: 'row', justifyContent: 'space-between', - backgroundColor: THEME.COLORS.WHITE + backgroundColor: theme.tileBackground }, accessoryButton: { - padding: rem(0.5) + padding: theme.rem(0.5) }, accessoryText: { - color: THEME.COLORS.ACCENT_BLUE, - fontSize: rem(1) + color: theme.secondaryText, + fontSize: theme.rem(1) } -} -const styles: typeof rawStyles = StyleSheet.create(rawStyles) +})) diff --git a/src/components/themed/EdgeTextField.js b/src/components/themed/EdgeTextField.js index f4842f7217a..c8f26ed0f75 100644 --- a/src/components/themed/EdgeTextField.js +++ b/src/components/themed/EdgeTextField.js @@ -67,7 +67,7 @@ class EdgeTextFieldOutlinedComponent extends React.PureComponent {isClearable && ( - + )} @@ -91,7 +91,8 @@ const getStyles = cacheStyles((theme: Theme) => ({ outlinedTextFieldContainer: { flexDirection: 'row', alignItems: 'center', - height: theme.rem(4.5) + height: theme.rem(4.5), + position: 'relative' }, outlinedTextField: { flex: 1 diff --git a/src/components/themed/ModalParts.js b/src/components/themed/ModalParts.js index 10643d05f3e..3fb1fe16c64 100644 --- a/src/components/themed/ModalParts.js +++ b/src/components/themed/ModalParts.js @@ -3,15 +3,16 @@ import * as React from 'react' import { Text, TouchableOpacity } from 'react-native' import { cacheStyles } from 'react-native-patina' -import AntDesignIcon from 'react-native-vector-icons/AntDesign' +import FontAwesome5 from 'react-native-vector-icons/FontAwesome5' +import { unpackEdges } from '../../util/edges' import { type Theme, useTheme } from '../services/ThemeContext.js' -export function ModalTitle(props: { children: React.Node }) { +export function ModalTitle(props: { children: React.Node, center?: boolean, paddingRem?: number[] | number }) { const theme = useTheme() const styles = getStyles(theme) - return {props.children} + return {props.children} } export function ModalMessage(props: { children: React.Node }) { @@ -27,11 +28,22 @@ export function ModalCloseArrow(props: { onPress: () => void }) { return ( - + ) } +function paddingStyles(paddingRem: number[] | number, theme: Theme) { + const padding = unpackEdges(paddingRem ?? 1) + + return { + paddingBottom: theme.rem(padding.bottom), + paddingLeft: theme.rem(padding.left), + paddingRight: theme.rem(padding.right), + paddingTop: theme.rem(padding.top) + } +} + const getStyles = cacheStyles((theme: Theme) => ({ closeArrow: { alignItems: 'center', @@ -43,6 +55,9 @@ const getStyles = cacheStyles((theme: Theme) => ({ fontSize: theme.rem(1.25), margin: theme.rem(0.5) }, + titleCenter: { + textAlign: 'center' + }, messageText: { color: theme.primaryText, fontFamily: theme.fontFaceDefault, diff --git a/src/components/themed/ThemedButtons.js b/src/components/themed/ThemedButtons.js index 7620d906690..d1b509067a2 100644 --- a/src/components/themed/ThemedButtons.js +++ b/src/components/themed/ThemedButtons.js @@ -169,7 +169,7 @@ function spacingStyles(props: Props, theme: Theme) { const getStyles = cacheStyles((theme: Theme) => { const commonButton = { alignItems: 'center', - borderRadius: theme.rem(1.5), + borderRadius: theme.rem(0.25), borderWidth: theme.rem(0.1), flexDirection: 'row', justifyContent: 'center' diff --git a/src/theme/variables/edgeDark.js b/src/theme/variables/edgeDark.js index 2a47ab15ef3..2acd92c0d57 100644 --- a/src/theme/variables/edgeDark.js +++ b/src/theme/variables/edgeDark.js @@ -92,7 +92,7 @@ export const edgeDark: Theme = { backgroundGradientRight: palette.darkBlue, // Modal - modal: palette.royalBlue, + modal: palette.edgeNavy, modalBlurType: 'light', modalCloseIcon: palette.edgeMint, // modalFullGradientLeft: palette.darkBlue, From 9e323d4cb05a56fdd6f539f90135ed4ce4919c59 Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Thu, 8 Apr 2021 19:25:10 +0300 Subject: [PATCH 002/110] FIO Domain picker ui2 design. --- src/components/modals/AddressModal.js | 2 - .../scenes/FioAddressRegisterScene.js | 17 ++- .../scenes/FioDomainRegisterScene.js | 4 +- .../FioAddress/components/DomainListModal.js | 107 ++++++++++++------ .../FioAddress/components/EditNameModal.js | 63 ++++++++--- 5 files changed, 132 insertions(+), 61 deletions(-) diff --git a/src/components/modals/AddressModal.js b/src/components/modals/AddressModal.js index e355e11813f..59bf39186f1 100644 --- a/src/components/modals/AddressModal.js +++ b/src/components/modals/AddressModal.js @@ -404,8 +404,6 @@ class AddressModalConnected extends React.Component { error={fieldError} inputAccessoryViewID={inputAccessoryViewID} blurOnSubmit - // style={addressInputStyles} - // returnKeyType="done" /> {!userFioAddressesLoading ? ( { editAddressPressed = () => { this.handleFioAddressFocus() - Airship.show(bridge => ).then( - (response: string | null) => { - if (response) { - this.handleFioAddressChange(response) - } + Airship.show(bridge => ( + + )).then((response: string | null) => { + if (response) { + this.handleFioAddressChange(response) } - ) + }) } handleFioWalletChange = (walletId: string) => { diff --git a/src/components/scenes/FioDomainRegisterScene.js b/src/components/scenes/FioDomainRegisterScene.js index b7f84ded8fb..648f77ea376 100644 --- a/src/components/scenes/FioDomainRegisterScene.js +++ b/src/components/scenes/FioDomainRegisterScene.js @@ -180,7 +180,9 @@ class FioDomainRegister extends React.PureComponent { setDomain = async () => { this.handleFioDomainFocus() - const fioDomain = await Airship.show(bridge => ) + const fioDomain = await Airship.show(bridge => ( + + )) if (fioDomain) this.handleFioDomainChange(fioDomain) } diff --git a/src/modules/FioAddress/components/DomainListModal.js b/src/modules/FioAddress/components/DomainListModal.js index fb60df36985..052fa5f6972 100644 --- a/src/modules/FioAddress/components/DomainListModal.js +++ b/src/modules/FioAddress/components/DomainListModal.js @@ -1,18 +1,18 @@ // @flow -import { FormField, MaterialInputStyle } from 'edge-components' import type { EdgeCurrencyConfig, EdgeCurrencyWallet } from 'edge-core-js' import * as React from 'react' import { FlatList, TouchableHighlight, View } from 'react-native' import { type AirshipBridge } from 'react-native-airship' import { Actions } from 'react-native-router-flux' -import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome' import { connect } from 'react-redux' +import { Fontello } from '../../../assets/vector' import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../../../components/services/ThemeContext' import { EdgeText } from '../../../components/themed/EdgeText' +import { EdgeTextFieldOutlined } from '../../../components/themed/EdgeTextField' import { ModalCloseArrow, ModalTitle } from '../../../components/themed/ModalParts.js' -import { PrimaryButton } from '../../../components/themed/ThemedButtons.js' +import { SecondaryButton } from '../../../components/themed/ThemedButtons.js' import { ThemedModal } from '../../../components/themed/ThemedModal.js' import * as Constants from '../../../constants/indexConstants' import s from '../../../locales/strings.js' @@ -40,6 +40,7 @@ type OwnProps = { type State = { input: string, + isFocused: boolean, domains: Item[], prevDomainsJson: string } @@ -53,12 +54,14 @@ const newDomainItem = { } class DomainListModalComponent extends React.Component { + textInput = React.createRef() constructor(props: Props) { super(props) this.state = { input: '', domains: [], - prevDomainsJson: '' + prevDomainsJson: '', + isFocused: false } } @@ -83,6 +86,27 @@ class DomainListModalComponent extends React.Component { return { domains: [...domains, ...userDomainsConverted], prevDomainsJson } } + componentDidMount() { + if (this.textInput.current) { + this.textInput.current.focus() + } + } + + clearText = () => { + this.setState({ input: '' }) + if (this.textInput.current) { + this.textInput.current.blur() + } + } + + fieldOnFocus = () => { + this.setState({ isFocused: true }) + } + + fieldOnBlur = () => { + this.setState({ isFocused: false }) + } + getItems = () => { const { domains, input } = this.state @@ -106,8 +130,9 @@ class DomainListModalComponent extends React.Component { return filteredRecords } - selectCustom = (name: string) => { - const fioDomain = { ...Constants.FIO_DOMAIN_DEFAULT, name } + selectCustom = () => { + const { input } = this.state + const fioDomain = { ...Constants.FIO_DOMAIN_DEFAULT, name: input } this.props.bridge.resolve(fioDomain) } @@ -125,9 +150,9 @@ class DomainListModalComponent extends React.Component { if (createNew) { return ( - - {label} - + + + {s.strings.fio_address_list_domain_register} ) @@ -135,7 +160,7 @@ class DomainListModalComponent extends React.Component { if (value) { return ( this.selectItem(value)} underlayColor="transparent"> - + {label} {value.isFree ? s.strings.fio_domain_free : ''} @@ -149,32 +174,34 @@ class DomainListModalComponent extends React.Component { onSearchFilterChange = (input: string) => this.setState({ input }) render() { const { bridge, theme } = this.props - const { input } = this.state + const { input, isFocused } = this.state const items = this.getItems() - const formFieldStyles = { - ...MaterialInputStyle, - container: { - ...MaterialInputStyle.container, - paddingTop: theme.rem(0.25) - }, - textColor: theme.primaryText, - tintColor: theme.primaryButton - } return ( bridge.resolve(null)} paddingRem={0}> - {s.strings.fio_address_choose_domain_label} + + {s.strings.fio_address_choose_domain_label} + - this.selectCustom(input)} - style={formFieldStyles} + onSubmitEditing={this.selectCustom} + onFocus={this.fieldOnFocus} + onBlur={this.fieldOnBlur} value={input} + onClear={this.clearText} + isClearable={isFocused} + marginRem={[0, 1]} + ref={this.textInput} + blurOnSubmit /> - {!items.length && this.selectCustom(input)} marginRem={1} />} + {!items.length && } bridge.resolve(null)} /> @@ -185,14 +212,11 @@ class DomainListModalComponent extends React.Component { const getStyles = cacheStyles((theme: Theme) => ({ rowContainerTop: { width: '100%', - height: theme.rem(4.75), flexDirection: 'row', alignItems: 'center', - justifyContent: 'center', - paddingLeft: theme.rem(0.625), - paddingRight: theme.rem(0.625), - borderBottomWidth: theme.rem(0.05), - borderBottomColor: theme.secondaryButtonOutline + justifyContent: 'flex-start', + paddingHorizontal: theme.rem(1), + paddingVertical: theme.rem(1) }, domainListRowName: { flex: 1, @@ -206,11 +230,20 @@ const getStyles = cacheStyles((theme: Theme) => ({ color: theme.negativeText, textAlign: 'right' }, - domainListRowContainerTop: { - height: 'auto', - paddingLeft: theme.rem(0.75), - paddingRight: theme.rem(0.75), - paddingVertical: theme.rem(0.75) + registerDomainRow: { + paddingLeft: 0, + marginLeft: theme.rem(1), + marginTop: theme.rem(0.25), + paddingTop: theme.rem(1.25), + borderTopWidth: theme.rem(0.05), + borderTopColor: theme.lineDivider + }, + domainRegisterText: { + marginLeft: theme.rem(0.5), + color: theme.textLink + }, + domainRegisterIcon: { + marginTop: theme.rem(0.25) } })) diff --git a/src/modules/FioAddress/components/EditNameModal.js b/src/modules/FioAddress/components/EditNameModal.js index 48bdc50e5a5..0ff7671bfa7 100644 --- a/src/modules/FioAddress/components/EditNameModal.js +++ b/src/modules/FioAddress/components/EditNameModal.js @@ -7,9 +7,9 @@ import { type AirshipBridge } from 'react-native-airship' import { connect } from 'react-redux' import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../../../components/services/ThemeContext' -import { EdgeTextField } from '../../../components/themed/EdgeTextField.js' +import { EdgeTextFieldOutlined } from '../../../components/themed/EdgeTextField.js' import { ModalCloseArrow, ModalTitle } from '../../../components/themed/ModalParts.js' -import { PrimaryButton } from '../../../components/themed/ThemedButtons' +import { SecondaryButton } from '../../../components/themed/ThemedButtons' import { ThemedModal } from '../../../components/themed/ThemedModal.js' import * as Constants from '../../../constants/indexConstants' import s from '../../../locales/strings.js' @@ -24,54 +24,87 @@ type StateProps = { type OwnProps = { bridge: AirshipBridge, value: string, + label: string, title: string } type State = { - input: string + input: string, + isFocused: boolean } type Props = OwnProps & ThemeProps & StateProps class EditNameModalComponent extends React.PureComponent { + textInput = React.createRef() constructor(props: Props) { super(props) this.state = { - input: this.props.value || '' + input: this.props.value || '', + isFocused: false } } componentDidMount(): * { this.setState({ input: this.props.value }) + if (this.textInput.current) { + this.textInput.current.focus() + } } - onChange = input => this.setState({ input }) + clearText = () => { + this.setState({ input: '' }) + if (this.textInput.current) { + this.textInput.current.blur() + } + } + + fieldOnFocus = () => { + this.setState({ isFocused: true }) + } + + fieldOnBlur = () => { + this.setState({ isFocused: false }) + } + + onClose = () => this.props.bridge.resolve(null) + + onChange = (input: string) => this.setState({ input }) - selectItem = (value: any) => this.props.bridge.resolve(value) + selectItem = () => this.props.bridge.resolve(this.state.input) render() { - const { bridge, title, theme } = this.props - const { input } = this.state + const { bridge, title, label, theme } = this.props + const { input, isFocused } = this.state const styles = getStyles(theme) return ( - bridge.resolve(null)} paddingRem={0}> - {title} + + + {title} + - this.selectItem(input)} + onSubmitEditing={this.selectItem} value={input} autoCorrect={false} autoCapitalize="none" returnKeyType="next" + onFocus={this.fieldOnFocus} + onBlur={this.fieldOnBlur} + onClear={this.clearText} + isClearable={isFocused} + marginRem={[0, 1]} + ref={this.textInput} + blurOnSubmit /> - this.selectItem(input)} marginRem={1} /> - bridge.resolve(null)} /> + {!!input && } + ) } From d4e8eb4228be80b1c8a24bb37aca4523c3c55f68 Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Fri, 9 Apr 2021 14:11:15 +0300 Subject: [PATCH 003/110] Changed padding for modal title. --- src/__tests__/__snapshots__/SettingsScene.test.js.snap | 4 ++-- src/components/modals/AddressModal.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/__tests__/__snapshots__/SettingsScene.test.js.snap b/src/__tests__/__snapshots__/SettingsScene.test.js.snap index c9b4521751c..f974eb47989 100644 --- a/src/__tests__/__snapshots__/SettingsScene.test.js.snap +++ b/src/__tests__/__snapshots__/SettingsScene.test.js.snap @@ -1376,7 +1376,7 @@ exports[`MyComponent should render Locked SettingsOverview 1`] = ` "alignItems": "center", "backgroundColor": "#66EDA8", "borderColor": "rgba(255, 255, 255, 0)", - "borderRadius": 34, + "borderRadius": 6, "borderWidth": 2, "flexDirection": "row", "justifyContent": "center", @@ -2788,7 +2788,7 @@ exports[`MyComponent should render UnLocked SettingsOverview 1`] = ` "alignItems": "center", "backgroundColor": "#66EDA8", "borderColor": "rgba(255, 255, 255, 0)", - "borderRadius": 34, + "borderRadius": 6, "borderWidth": 2, "flexDirection": "row", "justifyContent": "center", diff --git a/src/components/modals/AddressModal.js b/src/components/modals/AddressModal.js index e355e11813f..2d15426bc85 100644 --- a/src/components/modals/AddressModal.js +++ b/src/components/modals/AddressModal.js @@ -371,7 +371,7 @@ class AddressModalConnected extends React.Component { return ( - + {title || s.strings.address_modal_default_header} From 0c5cd389aa1c716df00220613fb40aa56670d285 Mon Sep 17 00:00:00 2001 From: Art Manalili Date: Mon, 12 Apr 2021 23:10:32 +0800 Subject: [PATCH 004/110] Denomination Fixes - Made exchangeDenomination pull data from settings - Merge both denomination funciton into one function - Added new test on both getting display and exchange --- src/__tests__/fixtures.json | 25 +++++++++++++--- src/__tests__/utils.test.js | 16 ++++++++-- src/components/scenes/SendScene.js | 4 +-- src/components/themed/TransactionListRow.js | 8 ++--- src/components/themed/TransactionListTop.js | 4 +-- src/components/themed/WalletList.js | 8 ++--- src/util/utils.js | 33 +++++++++------------ 7 files changed, 61 insertions(+), 37 deletions(-) diff --git a/src/__tests__/fixtures.json b/src/__tests__/fixtures.json index 834b5ea1ee6..d52e47bb8e9 100644 --- a/src/__tests__/fixtures.json +++ b/src/__tests__/fixtures.json @@ -1,6 +1,6 @@ { - "getDisplayDenomination": { - "title": "Display Denomination of", + "getExchangeDenomination": { + "title": "Exchange Denomination of", "input": ["BTC", "ETH", "TKN"], "output": [{ "multiplier": "100000000", @@ -16,6 +16,23 @@ "symbol": "" }] }, + "getDisplayDenomination": { + "title": "Display Denomination of", + "input": ["BTC", "ETH", "TKN"], + "output": [{ + "multiplier": "1", + "name": "sats", + "symbol": "s" + }, { + "multiplier": "1000000000000000", + "name": "mETH", + "symbol": "mΞ" + }, { + "multiplier": "10000000000000000000000000000000000000000000000000", + "name": "TKN", + "symbol": "" + }] + }, "precisionAdjust": { "BTC for precision adjustment and max conversion decimal": { "input": { @@ -45,7 +62,7 @@ "settings": { "BTC": { "currencyCode": "BTC", - "denomination": "100000000", + "denomination": "1", "displayName": "Bitcoin", "denominations": [{ "multiplier": "100000000", @@ -69,7 +86,7 @@ }, "ETH": { "currencyCode": "ETH", - "denomination": "1000000000000000000", + "denomination": "1000000000000000", "denominations": [{ "multiplier": "1000000000000000000", "name": "ETH", diff --git a/src/__tests__/utils.test.js b/src/__tests__/utils.test.js index 46a46a3ecfa..ffd1d3f3f97 100644 --- a/src/__tests__/utils.test.js +++ b/src/__tests__/utils.test.js @@ -10,7 +10,8 @@ import { convertNativeToDisplay, convertNativeToExchange, daysBetween, - getDisplayDenomination, + DENOMINATION_TYPE, + getDenomination, getNewArrayWithItem, getNewArrayWithoutItem, getObjectDiff, @@ -689,7 +690,18 @@ describe('getDisplayDenomination', function () { input.forEach((currency, index) => { test(`${title} ${currency}`, function () { - expect(getDisplayDenomination(currency, fixtures.settings)).toMatchObject(output[index]) + expect(getDenomination(currency, fixtures.settings, DENOMINATION_TYPE.DISPLAY)).toMatchObject(output[index]) + }) + }) +}) + +describe('getExchangeDenomination', function () { + const tests = fixtures.getExchangeDenomination + const { title, input, output } = tests + + input.forEach((currency, index) => { + test(`${title} ${currency}`, function () { + expect(getDenomination(currency, fixtures.settings, DENOMINATION_TYPE.EXCHANGE)).toMatchObject(output[index]) }) }) }) diff --git a/src/components/scenes/SendScene.js b/src/components/scenes/SendScene.js index bef9a41bde9..59726b573c7 100644 --- a/src/components/scenes/SendScene.js +++ b/src/components/scenes/SendScene.js @@ -365,8 +365,8 @@ class SendComponent extends React.PureComponent { if (recipientAddress && !hiddenTilesMap.amount) { let cryptoAmountSyntax let fiatAmountSyntax - const cryptoDisplayDenomination = UTILS.getDisplayDenomination(selectedCurrencyCode, settings) - const cryptoExchangeDenomination = UTILS.getExchangeDenomination(guiWallet, selectedCurrencyCode, settings) + const cryptoDisplayDenomination = UTILS.getDenomination(selectedCurrencyCode, settings, UTILS.DENOMINATION_TYPE.DISPLAY) + const cryptoExchangeDenomination = UTILS.getDenomination(selectedCurrencyCode, settings, UTILS.DENOMINATION_TYPE.EXCHANGE) const fiatDenomination = UTILS.getDenomFromIsoCode(guiWallet.fiatCurrencyCode) const fiatSymbol = fiatDenomination.symbol ? fiatDenomination.symbol : '' if (nativeAmount && !bns.eq(nativeAmount, '0')) { diff --git a/src/components/themed/TransactionListRow.js b/src/components/themed/TransactionListRow.js index 7afc44a3d08..b5f92b8925d 100644 --- a/src/components/themed/TransactionListRow.js +++ b/src/components/themed/TransactionListRow.js @@ -12,10 +12,10 @@ import { type RootState } from '../../types/reduxTypes.js' import type { TransactionListTx } from '../../types/types.js' import * as UTILS from '../../util/utils' import { + DENOMINATION_TYPE, DIVIDE_PRECISION, getDenomFromIsoCode, - getDisplayDenomination, - getExchangeDenomination, + getDenomination, getFiatSymbol, maxPrimaryCurrencyConversionDecimals, precisionAdjust @@ -78,8 +78,8 @@ export const TransactionListRow = connect((state: RootState, ownProps: OwnProps) const guiWallet = state.ui.wallets.byId[walletId] const { fiatCurrencyCode } = guiWallet const { settings } = state.ui - const displayDenomination = getDisplayDenomination(currencyCode, settings) - const exchangeDenomination = getExchangeDenomination(guiWallet, currencyCode, settings) + const displayDenomination = getDenomination(currencyCode, settings, DENOMINATION_TYPE.DISPLAY) + const exchangeDenomination = getDenomination(currencyCode, settings, DENOMINATION_TYPE.EXCHANGE) const fiatDenomination = getDenomFromIsoCode(guiWallet.fiatCurrencyCode) // Required Confirmations diff --git a/src/components/themed/TransactionListTop.js b/src/components/themed/TransactionListTop.js index 10e9327521c..9a96cb91432 100644 --- a/src/components/themed/TransactionListTop.js +++ b/src/components/themed/TransactionListTop.js @@ -16,7 +16,7 @@ import * as intl from '../../locales/intl.js' import s from '../../locales/strings.js' import { convertCurrency } from '../../modules/UI/selectors.js' import { type Dispatch, type RootState } from '../../types/reduxTypes.js' -import { convertNativeToDenomination, getDefaultDenomination, getDisplayDenomination, getFiatSymbol } from '../../util/utils' +import { convertNativeToDenomination, DENOMINATION_TYPE, getDefaultDenomination, getDenomination, getFiatSymbol } from '../../util/utils' import { type WalletListResult, WalletListModal } from '../modals/WalletListModal.js' import { Airship } from '../services/AirshipInstance.js' import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../services/ThemeContext.js' @@ -335,7 +335,7 @@ export const TransactionListTop = connect( const balance = guiWallet.nativeBalances[selectedCurrencyCode] // Crypto Amount Formatting - const currencyDenomination = getDisplayDenomination(selectedCurrencyCode, state.ui.settings) + const currencyDenomination = getDenomination(selectedCurrencyCode, state.ui.settings, DENOMINATION_TYPE.DISPLAY) const cryptoAmount: string = convertNativeToDenomination(currencyDenomination.multiplier)(balance) // convert to correct denomination const cryptoAmountFormat = intl.formatNumber(bns.add(cryptoAmount, '0')) diff --git a/src/components/themed/WalletList.js b/src/components/themed/WalletList.js index 2d663a8cee6..3f4ec081ac8 100644 --- a/src/components/themed/WalletList.js +++ b/src/components/themed/WalletList.js @@ -18,9 +18,9 @@ import { alphabeticalSort, checkFilterWallet, decimalOrZero, + DENOMINATION_TYPE, getDenomFromIsoCode, - getDisplayDenomination, - getExchangeDenomination, + getDenomination, getFiatSymbol, getYesterdayDateRoundDownHour, maxPrimaryCurrencyConversionDecimals, @@ -216,8 +216,8 @@ class WalletListComponent extends React.PureComponent { const walletFiatSymbol = getFiatSymbol(guiWallet.isoFiatCurrencyCode) // Crypto Amount And Exchange Rate - const denomination = getDisplayDenomination(currencyCode, settings) - const exchangeDenomination = getExchangeDenomination(guiWallet, currencyCode, settings) + const denomination = getDenomination(currencyCode, settings, DENOMINATION_TYPE.DISPLAY) + const exchangeDenomination = getDenomination(currencyCode, settings, DENOMINATION_TYPE.EXCHANGE) const fiatDenomination = getDenomFromIsoCode(guiWallet.fiatCurrencyCode) const rateKey = `${currencyCode}_${guiWallet.isoFiatCurrencyCode}` const exchangeRate = exchangeRates[rateKey] ? exchangeRates[rateKey] : undefined diff --git a/src/util/utils.js b/src/util/utils.js index 5b52d3c8018..42e4e5fd36a 100644 --- a/src/util/utils.js +++ b/src/util/utils.js @@ -611,24 +611,19 @@ export function getCustomTokenDenomination(currencyCode: string, settings: Objec return customTokenCurrencyInfo ? customTokenCurrencyInfo.denominations[0] : emptyEdgeDenomination } -export function getDisplayDenomination(currencyCode: string, settings: Object): EdgeDenomination { +export const DENOMINATION_TYPE = { DISPLAY: 'display', EXCHANGE: 'exchange' } +export type DenominationType = typeof DENOMINATION_TYPE.DISPLAY | typeof DENOMINATION_TYPE.EXCHANGE +export function getDenomination(currencyCode: string, settings: Object, type: DenominationType) { const currencyInfo = settings[currencyCode] if (currencyInfo) { - const denominationMultiplier = currencyInfo.denomination - const denomination = currencyInfo.denominations.find(denomination => denomination.multiplier === denominationMultiplier) - return denomination || emptyEdgeDenomination - } - return getCustomTokenDenomination(currencyCode, settings) -} - -export function getExchangeDenomination(guiWallet: GuiWallet, currencyCode: string, settings: Object): EdgeDenomination { - const currencyExchangeInfo = guiWallet.allDenominations[currencyCode] - if (currencyExchangeInfo) { - for (const key in currencyExchangeInfo) { - if (currencyExchangeInfo[key] && currencyExchangeInfo[key].name === currencyCode) { - return currencyExchangeInfo[key] + const denomination = currencyInfo.denominations.find(denomination => { + if (type === DENOMINATION_TYPE.DISPLAY) { + return denomination.multiplier === currencyInfo.denomination + } else if (type === DENOMINATION_TYPE.EXCHANGE) { + return denomination.name === currencyInfo.currencyCode } - } + }) + return denomination ?? emptyEdgeDenomination } return getCustomTokenDenomination(currencyCode, settings) } @@ -714,8 +709,8 @@ export const convertTransactionFeeToDisplayFee = ( } } else if (parentNetworkFee && bns.gt(parentNetworkFee, '0')) { // if parentNetworkFee greater than zero - const parentDisplayDenomination = getDisplayDenomination(guiWallet.currencyCode, settings) - const parentExchangeDenomination = getExchangeDenomination(guiWallet, guiWallet.currencyCode, settings) + const parentDisplayDenomination = getDenomination(guiWallet.currencyCode, settings, DENOMINATION_TYPE.DISPLAY) + const parentExchangeDenomination = getDenomination(guiWallet.currencyCode, settings, DENOMINATION_TYPE.EXCHANGE) const cryptoFeeSymbol = parentDisplayDenomination && parentDisplayDenomination.symbol ? parentDisplayDenomination.symbol : '' const displayMultiplier = parentDisplayDenomination ? parentDisplayDenomination.multiplier : '' const exchangeMultiplier = parentExchangeDenomination ? parentExchangeDenomination.multiplier : '' @@ -730,8 +725,8 @@ export const convertTransactionFeeToDisplayFee = ( } } else if (networkFee && bns.gt(networkFee, '0')) { // if networkFee greater than zero - const primaryDisplayDenomination = getDisplayDenomination(currencyCode, settings) - const primaryExchangeDenomination = getExchangeDenomination(guiWallet, currencyCode, settings) + const primaryDisplayDenomination = getDenomination(currencyCode, settings, DENOMINATION_TYPE.DISPLAY) + const primaryExchangeDenomination = getDenomination(currencyCode, settings, DENOMINATION_TYPE.EXCHANGE) const cryptoFeeSymbol = primaryDisplayDenomination && primaryDisplayDenomination.symbol ? primaryDisplayDenomination.symbol : '' const displayMultiplier = primaryDisplayDenomination ? primaryDisplayDenomination.multiplier : '' const exchangeMultiplier = primaryExchangeDenomination ? primaryExchangeDenomination.multiplier : '' From 95c2bf486f6c5dd7b46ce3ae28a606faf4175397 Mon Sep 17 00:00:00 2001 From: Art Manalili Date: Mon, 12 Apr 2021 23:22:47 +0800 Subject: [PATCH 005/110] Use getDenomination on TransactionDetails walletDefaultDenomProps --- src/components/scenes/TransactionDetailsScene.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/scenes/TransactionDetailsScene.js b/src/components/scenes/TransactionDetailsScene.js index f31e1b23f67..a5900a8c2ce 100644 --- a/src/components/scenes/TransactionDetailsScene.js +++ b/src/components/scenes/TransactionDetailsScene.js @@ -593,8 +593,8 @@ export const TransactionDetailsScene = connect( const allCurrencyInfos = plugins.allCurrencyInfos const currencyInfo = UTILS.getCurrencyInfo(allCurrencyInfos, currencyCode) const walletDefaultDenomProps: EdgeDenomination = UTILS.isCryptoParentCurrency(wallet, edgeTransaction.currencyCode) - ? UTILS.getWalletDefaultDenomProps(wallet, settings) - : UTILS.getWalletDefaultDenomProps(wallet, settings, edgeTransaction.currencyCode) + ? UTILS.getDenomination(wallet.currencyCode, settings, UTILS.DENOMINATION_TYPE.EXCHANGE) + : UTILS.getDenomination(edgeTransaction.currencyCode, settings, UTILS.DENOMINATION_TYPE.EXCHANGE) const nativeAmount = edgeTransaction && edgeTransaction.nativeAmount ? bns.abs(edgeTransaction.nativeAmount) : '' const cryptoAmount = convertNativeToExchangeRateDenomination(settings, currencyCode, nativeAmount) From ac0b0a3dd1a46249fea5c5300b6344d5e5f55ed8 Mon Sep 17 00:00:00 2001 From: Art Manalili Date: Mon, 12 Apr 2021 23:25:44 +0800 Subject: [PATCH 006/110] Remove getWalletDefaultDenomProps function --- src/util/utils.js | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/util/utils.js b/src/util/utils.js index 42e4e5fd36a..922ab6f1351 100644 --- a/src/util/utils.js +++ b/src/util/utils.js @@ -62,31 +62,6 @@ export const getSettingsTokenMultiplier = (currencyCode: string, settings: Objec return multiplier } -export function getWalletDefaultDenomProps( - wallet: GuiWallet, - settingsState: Object, - currencyCode?: string // for metaTokens -): EdgeDenomination { - const allWalletDenoms = wallet.allDenominations - let walletCurrencyCode - if (currencyCode) { - // if metaToken - walletCurrencyCode = currencyCode - } else { - // if not a metaToken - walletCurrencyCode = wallet.currencyCode - } - const currencySettings = settingsState[walletCurrencyCode] // includes 'denomination', currencyName, and currencyCode - let denomProperties: EdgeDenomination - if (allWalletDenoms[walletCurrencyCode] != null && allWalletDenoms[walletCurrencyCode][currencySettings.denomination] != null) { - denomProperties = allWalletDenoms[walletCurrencyCode][currencySettings.denomination] // includes name, multiplier, and symbol - } else { - // This is likely a custom token which has no denom setup in allWalletDenominations - denomProperties = currencySettings.denominations[0] - } - return denomProperties -} - export const getFiatSymbol = (code: string) => { code = code.replace('iso:', '') return getSymbolFromCurrency(code) From dceb19b0e344e54693a8a983dd6924a38d026e9b Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Tue, 13 Apr 2021 15:03:06 +0300 Subject: [PATCH 007/110] Removed paste button. Search icon on field. --- src/components/modals/AddressModal.js | 95 +------------------------- src/components/scenes/ScanScene.js | 9 +-- src/components/themed/EdgeTextField.js | 29 +++++++- src/theme/variables/edgeDark.js | 1 + src/theme/variables/edgeLight.js | 1 + src/types/Theme.js | 1 + 6 files changed, 34 insertions(+), 102 deletions(-) diff --git a/src/components/modals/AddressModal.js b/src/components/modals/AddressModal.js index 2d15426bc85..ecf45574fa4 100644 --- a/src/components/modals/AddressModal.js +++ b/src/components/modals/AddressModal.js @@ -1,10 +1,8 @@ // @flow -import Clipboard from '@react-native-community/clipboard' -import { TertiaryButton } from 'edge-components' import type { EdgeAccount, EdgeCurrencyConfig, EdgeCurrencyWallet } from 'edge-core-js' import * as React from 'react' -import { ActivityIndicator, FlatList, Image, InputAccessoryView, Platform, TouchableOpacity, TouchableWithoutFeedback, View } from 'react-native' +import { ActivityIndicator, FlatList, Image, TouchableWithoutFeedback, View } from 'react-native' import { connect } from 'react-redux' import { sprintf } from 'sprintf-js' @@ -17,7 +15,6 @@ import { type FioAddresses, checkPubAddress, getFioAddressCache } from '../../mo import Text from '../../modules/UI/components/FormattedText/FormattedText.ui.js' import { type Dispatch, type RootState } from '../../types/reduxTypes.js' import type { FioAddress, FlatListItem } from '../../types/types.js' -import { KeyboardTracker } from '../common/KeyboardTracker.js' import ResolutionError, { ResolutionErrorCode } from '../common/ResolutionError.js' import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../services/ThemeContext.js' import { EdgeTextFieldOutlined } from '../themed/EdgeTextField' @@ -26,14 +23,11 @@ import { SecondaryButton } from '../themed/ThemedButtons.js' import { ThemedModal } from '../themed/ThemedModal.js' import { type AirshipBridge } from './modalParts.js' -const inputAccessoryViewID: string = 'inputAccessoryViewID' - type OwnProps = { bridge: AirshipBridge, walletId: string, currencyCode: string, title?: string, - showPasteButton?: boolean, isFioOnly?: boolean, useUserFioAddressesOnly?: boolean, checkAddressConnected?: boolean @@ -52,7 +46,6 @@ type DispatchProps = { } type State = { - clipboard: string, uri: string, statusLabel: string, fieldError: string, @@ -72,7 +65,6 @@ class AddressModalConnected extends React.Component { super(props) this.fioCheckQueue = 0 this.state = { - clipboard: '', uri: '', statusLabel: s.strings.fragment_send_address, cryptoAddress: undefined, @@ -84,7 +76,6 @@ class AddressModalConnected extends React.Component { } componentDidMount() { - this._setClipboard(this.props) this.getFioAddresses() if (this.textInput.current) { @@ -98,23 +89,6 @@ class AddressModalConnected extends React.Component { } } - _setClipboard = async props => { - const coreWallet = props.coreWallet - - try { - const uri = await Clipboard.getString() - - // Will throw in case uri is invalid - await coreWallet.parseUri(uri) - - this.setState({ - clipboard: uri - }) - } catch (e) { - // Failure is acceptable - } - } - getFioAddresses = async () => { const { useUserFioAddressesOnly, refreshAllFioAddresses, account } = this.props if (useUserFioAddressesOnly) { @@ -299,16 +273,6 @@ class AddressModalConnected extends React.Component { this.filterFioAddresses(uri) } - onPasteFromClipboard = () => { - const { clipboard } = this.state - this.setState({ uri: clipboard }, async () => { - if (await this.isFioAddressValid(clipboard)) { - await this.checkIfFioAddress(clipboard) - } - this.handleSubmit() - }) - } - onPressFioAddress = (address: string) => { this.setState({ uri: address }, async () => { if (await this.isFioAddressValid(address)) { @@ -348,22 +312,6 @@ class AddressModalConnected extends React.Component { handleClose = () => this.props.bridge.resolve(null) keyExtractor = (item: string, index: number) => index.toString() - renderTracker = (keyboardAnimation, keyboardLayout) => { - const { showPasteButton } = this.props - const styles = getStyles(this.props.theme) - const copyMessage = this.state.clipboard ? sprintf(s.strings.string_paste_address, this.state.clipboard) : null - if (keyboardLayout === 0 && showPasteButton && copyMessage) { - return ( - - - {copyMessage} - - - ) - } - return null - } - render() { const { uri, statusLabel, fieldError, filteredFioAddresses, isFocused } = this.state const { title, userFioAddressesLoading } = this.props @@ -375,18 +323,8 @@ class AddressModalConnected extends React.Component { {title || s.strings.address_modal_default_header} - {this.renderTracker} - {Platform.OS === 'ios' ? ( - - - - {s.strings.string_cancel_cap} - - - - ) : null} - { marginRem={[0, 1]} ref={this.textInput} error={fieldError} - inputAccessoryViewID={inputAccessoryViewID} blurOnSubmit - // style={addressInputStyles} - // returnKeyType="done" /> {!userFioAddressesLoading ? ( ({ width: '100%', flexDirection: 'column' }, - tileContainerButtons: { - paddingBottom: theme.rem(0.5), - paddingHorizontal: theme.rem(0.75), - borderBottomWidth: 0, - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center' - }, rowContainer: { flexDirection: 'row', alignItems: 'center', @@ -474,27 +401,9 @@ const getStyles = cacheStyles((theme: Theme) => ({ paddingLeft: theme.rem(0.75), color: theme.primaryText }, - addressModalButton: { - width: '100%' - }, loaderContainer: { flex: 1, justifyContent: 'center', alignItems: 'center' - }, - - // Accessory Input - accessoryView: { - flex: 1, - flexDirection: 'row', - justifyContent: 'space-between', - backgroundColor: theme.tileBackground - }, - accessoryButton: { - padding: theme.rem(0.5) - }, - accessoryText: { - color: theme.secondaryText, - fontSize: theme.rem(1) } })) diff --git a/src/components/scenes/ScanScene.js b/src/components/scenes/ScanScene.js index 1fdfe0ae74e..4e176282119 100644 --- a/src/components/scenes/ScanScene.js +++ b/src/components/scenes/ScanScene.js @@ -65,14 +65,7 @@ export class Scan extends React.Component { _onToggleAddressModal = async () => { const { walletId, currencyCode } = this.props const uri = await Airship.show(bridge => ( - + )) if (uri) { this.props.parseScannedUri(uri) diff --git a/src/components/themed/EdgeTextField.js b/src/components/themed/EdgeTextField.js index c8f26ed0f75..31e323b8242 100644 --- a/src/components/themed/EdgeTextField.js +++ b/src/components/themed/EdgeTextField.js @@ -17,6 +17,7 @@ type EdgeOutlinedTextFieldProps = { fieldRef?: ?React.ElementRef, marginRem?: number | number[], isClearable: boolean, + small?: boolean, onClear: () => void } @@ -51,14 +52,31 @@ class EdgeTextFieldOutlinedComponent extends React.PureComponent { + const { fieldRef, value } = this.props + if (fieldRef && fieldRef.current) { + if (fieldRef.current.focused) return false + } + return !value + } + render() { - const { isClearable, marginRem = 0.5, theme, ...rest } = this.props + const { isClearable, marginRem = 0.5, small, theme, ...rest } = this.props const spacings = spacingStyles(marginRem, theme) const styles = getStyles(theme) + const searchContentInset = this.showSearchIcon() ? { left: theme.rem(2.25) } : null + const contentInset = small ? { input: theme.rem(0.75), label: 0, ...searchContentInset } : searchContentInset + return ( + {this.showSearchIcon() ? ( + + + + ) : null} ({ outlinedTextField: { flex: 1 }, + outlinedTextInput: { + paddingLeft: theme.rem(2) + }, outlinedTextFieldClearContainer: { position: 'absolute', right: 0, paddingHorizontal: theme.rem(0.75), justifyContent: 'center', paddingBottom: theme.rem(0.25) // This is needed because the OutlinedTextField also has innate padding/margin/height on the bottom + }, + search: { + position: 'absolute', + left: 0, + paddingHorizontal: theme.rem(0.75), + paddingBottom: theme.rem(0.5) } })) export const EdgeTextField = withTheme(EdgeTextFieldComponent) diff --git a/src/theme/variables/edgeDark.js b/src/theme/variables/edgeDark.js index 2acd92c0d57..39d288bd748 100644 --- a/src/theme/variables/edgeDark.js +++ b/src/theme/variables/edgeDark.js @@ -82,6 +82,7 @@ export const edgeDark: Theme = { // Icons icon: palette.white, iconTappable: palette.edgeMint, + iconDeactivated: palette.whiteOp75, warningIcon: palette.accentOrange, iconLoadingOverlay: palette.whiteOp75, transactionListIconBackground: palette.darkBlue, diff --git a/src/theme/variables/edgeLight.js b/src/theme/variables/edgeLight.js index 3b493a7cef5..f2cd3a4b0f2 100644 --- a/src/theme/variables/edgeLight.js +++ b/src/theme/variables/edgeLight.js @@ -80,6 +80,7 @@ export const edgeLight: Theme = { // Icons icon: palette.black, iconTappable: palette.edgeBlue, + iconDeactivated: palette.whiteOp75, warningIcon: palette.accentOrange, iconLoadingOverlay: palette.whiteOp75, transactionListIconBackground: palette.white, diff --git a/src/types/Theme.js b/src/types/Theme.js index 3e7ee149478..205d66888a4 100644 --- a/src/types/Theme.js +++ b/src/types/Theme.js @@ -8,6 +8,7 @@ export type Theme = { // Icons icon: string, iconTappable: string, + iconDeactivated: string, warningIcon: string, iconLoadingOverlay: string, transactionListIconBackground: string, From 1b87a67846ab625854245ed9465b746a57bbcc0b Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 18 Mar 2021 21:47:56 -0700 Subject: [PATCH 008/110] Pass Bugsnag as a core `crashReporter` --- src/components/services/EdgeCoreManager.js | 32 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/components/services/EdgeCoreManager.js b/src/components/services/EdgeCoreManager.js index 2e832bc2c6c..e9f53d6daad 100644 --- a/src/components/services/EdgeCoreManager.js +++ b/src/components/services/EdgeCoreManager.js @@ -1,7 +1,8 @@ // @flow +import Bugsnag from '@bugsnag/react-native' import detectBundler from 'detect-bundler' -import { type EdgeContext, type EdgeContextOptions, type EdgeFakeWorld, MakeEdgeContext, MakeFakeEdgeWorld } from 'edge-core-js' +import { type EdgeContext, type EdgeContextOptions, type EdgeCrashReporter, type EdgeFakeWorld, MakeEdgeContext, MakeFakeEdgeWorld } from 'edge-core-js' import makeAccountbasedIo from 'edge-currency-accountbased/lib/react-native-io.js' import makeBitcoinIo from 'edge-currency-bitcoin/lib/react-native-io.js' import makeMoneroIo from 'edge-currency-monero/lib/react-native-io.js' @@ -51,6 +52,17 @@ const nativeIo = isReactNative } : {} +const crashReporter: EdgeCrashReporter = { + logBreadcrumb(event) { + return Bugsnag.leaveBreadcrumb(event.message, event.metadata) + }, + logCrash(event) { + return Bugsnag.notify(event.error, report => { + report.addMetadata(event.source, event.metadata) + }) + } +} + /** * Mounts the edge-core-js WebView, and then mounts the rest of the app * once the core context is ready. @@ -120,9 +132,23 @@ export class EdgeCoreManager extends React.PureComponent { renderCore() { return ENV.USE_FAKE_CORE ? ( - + ) : ( - + ) } From 26a8b3311e772691e4de3f1bb410da944fae32c5 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Wed, 7 Apr 2021 10:27:27 -0700 Subject: [PATCH 009/110] Pass the core options correctly --- src/components/services/EdgeCoreManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/services/EdgeCoreManager.js b/src/components/services/EdgeCoreManager.js index e9f53d6daad..695619c52b4 100644 --- a/src/components/services/EdgeCoreManager.js +++ b/src/components/services/EdgeCoreManager.js @@ -144,10 +144,10 @@ export class EdgeCoreManager extends React.PureComponent { ) } From ba2f45ce7dc0019e41e1bf9d9b6056ca5a9c14dd Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Tue, 13 Apr 2021 21:03:02 +0300 Subject: [PATCH 010/110] Changed touchable to use CliackableText --- .../FioAddress/components/DomainListModal.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/modules/FioAddress/components/DomainListModal.js b/src/modules/FioAddress/components/DomainListModal.js index 052fa5f6972..4ab89d441a0 100644 --- a/src/modules/FioAddress/components/DomainListModal.js +++ b/src/modules/FioAddress/components/DomainListModal.js @@ -2,7 +2,7 @@ import type { EdgeCurrencyConfig, EdgeCurrencyWallet } from 'edge-core-js' import * as React from 'react' -import { FlatList, TouchableHighlight, View } from 'react-native' +import { FlatList, View } from 'react-native' import { type AirshipBridge } from 'react-native-airship' import { Actions } from 'react-native-router-flux' import { connect } from 'react-redux' @@ -12,7 +12,7 @@ import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../../../co import { EdgeText } from '../../../components/themed/EdgeText' import { EdgeTextFieldOutlined } from '../../../components/themed/EdgeTextField' import { ModalCloseArrow, ModalTitle } from '../../../components/themed/ModalParts.js' -import { SecondaryButton } from '../../../components/themed/ThemedButtons.js' +import { ClickableText, SecondaryButton } from '../../../components/themed/ThemedButtons' import { ThemedModal } from '../../../components/themed/ThemedModal.js' import * as Constants from '../../../constants/indexConstants' import s from '../../../locales/strings.js' @@ -149,22 +149,22 @@ class DomainListModalComponent extends React.Component { const styles = getStyles(theme) if (createNew) { return ( - + {s.strings.fio_address_list_domain_register} - + ) } if (value) { return ( - this.selectItem(value)} underlayColor="transparent"> + this.selectItem(value)} paddingRem={0}> {label} {value.isFree ? s.strings.fio_domain_free : ''} - + ) } return null @@ -215,8 +215,7 @@ const getStyles = cacheStyles((theme: Theme) => ({ flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', - paddingHorizontal: theme.rem(1), - paddingVertical: theme.rem(1) + padding: theme.rem(1) }, domainListRowName: { flex: 1, From 5431c5cf1d32a58a39a1133270b19d1de0d2f052 Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Tue, 13 Apr 2021 22:08:14 +0300 Subject: [PATCH 011/110] Changed value check in text field. --- src/components/themed/EdgeTextField.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/themed/EdgeTextField.js b/src/components/themed/EdgeTextField.js index 31e323b8242..fff459dc35e 100644 --- a/src/components/themed/EdgeTextField.js +++ b/src/components/themed/EdgeTextField.js @@ -55,9 +55,9 @@ class EdgeTextFieldOutlinedComponent extends React.PureComponent { const { fieldRef, value } = this.props if (fieldRef && fieldRef.current) { - if (fieldRef.current.focused) return false + return !fieldRef.current.focused } - return !value + return value == null } render() { From 905d8be0b94df6df4e1cb73034e599d0f32d9266 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 14 Apr 2021 17:58:45 -0700 Subject: [PATCH 012/110] Add staging branch to jenkins build --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index a8c0ef66259..e29f6b81255 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -86,6 +86,7 @@ pipeline { when { anyOf { branch 'develop' + branch 'staging' branch 'master' branch 'test-feta' branch 'test-gouda' From 93f592b7a8e88eea16999ba0517288c915bd823e Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Tue, 13 Apr 2021 20:43:16 +0300 Subject: [PATCH 013/110] Create Wallet scenes redesign. --- src/components/Main.ui.js | 9 +- src/components/navigation/BackButton.js | 4 +- .../scenes/CreateWalletNameScene.js | 134 ++++--------- .../scenes/CreateWalletSelectCryptoScene.js | 169 +++++++--------- .../scenes/CreateWalletSelectFiatScene.js | 145 +++++++------- src/components/themed/SelectableRow.js | 68 +++++++ src/constants/CountryConstants.js | 182 +++++++++++++++++- src/locales/en_US.js | 2 +- src/locales/strings/enUS.json | 2 +- 9 files changed, 435 insertions(+), 280 deletions(-) create mode 100644 src/components/themed/SelectableRow.js diff --git a/src/components/Main.ui.js b/src/components/Main.ui.js index 970bc9d2306..10279cd0954 100644 --- a/src/components/Main.ui.js +++ b/src/components/Main.ui.js @@ -209,8 +209,7 @@ export class MainComponent extends React.Component { key={Constants.CREATE_WALLET_SELECT_CRYPTO} navTransparent component={ifLoggedIn(CreateWalletSelectCryptoScene)} - renderTitle={} - renderLeftButton={} + renderLeftButton={} renderRightButton={this.renderEmptyButton()} /> @@ -218,8 +217,7 @@ export class MainComponent extends React.Component { key={Constants.CREATE_WALLET_NAME} navTransparent component={ifLoggedIn(CreateWalletName)} - renderTitle={} - renderLeftButton={} + renderLeftButton={} renderRightButton={this.renderEmptyButton()} /> @@ -227,8 +225,7 @@ export class MainComponent extends React.Component { key={Constants.CREATE_WALLET_SELECT_FIAT} navTransparent component={ifLoggedIn(CreateWalletSelectFiatScene)} - renderTitle={} - renderLeftButton={} + renderLeftButton={} renderRightButton={this.renderEmptyButton()} /> diff --git a/src/components/navigation/BackButton.js b/src/components/navigation/BackButton.js index 6108593889e..7d8d28dad51 100644 --- a/src/components/navigation/BackButton.js +++ b/src/components/navigation/BackButton.js @@ -25,7 +25,7 @@ class BackButtonComponent extends React.PureComponent { const { theme } = this.props const styles = getStyles(theme) return isIos ? ( - + ) : ( ) @@ -47,7 +47,7 @@ const getStyles = cacheStyles((theme: Theme) => ({ container: { flexDirection: 'row', alignItems: 'center', - paddingLeft: theme.rem(1) + paddingLeft: theme.rem(0.5) }, backIconStyle: { paddingRight: theme.rem(0.25) diff --git a/src/components/scenes/CreateWalletNameScene.js b/src/components/scenes/CreateWalletNameScene.js index d2f4356ec29..c07f3d610ef 100644 --- a/src/components/scenes/CreateWalletNameScene.js +++ b/src/components/scenes/CreateWalletNameScene.js @@ -1,21 +1,17 @@ // @flow import * as React from 'react' -import { Alert, StyleSheet, View } from 'react-native' +import { Alert } from 'react-native' import { Actions } from 'react-native-router-flux' import { sprintf } from 'sprintf-js' import * as Constants from '../../constants/indexConstants' import s from '../../locales/strings.js' -import { PrimaryButton } from '../../modules/UI/components/Buttons/PrimaryButton.ui.js' -import { SecondaryButton } from '../../modules/UI/components/Buttons/SecondaryButton.ui.js' -import Gradient from '../../modules/UI/components/Gradient/Gradient.ui' -import SafeAreaView from '../../modules/UI/components/SafeAreaView/SafeAreaView.ui.js' -import { THEME } from '../../theme/variables/airbitz.js' -import { PLATFORM } from '../../theme/variables/platform.js' import type { CreateWalletType, GuiFiatType } from '../../types/types.js' -import { scale } from '../../util/scaling.js' -import { FormField, MaterialInputOnWhite } from '../common/FormField.js' +import { SceneWrapper } from '../common/SceneWrapper' +import { EdgeTextFieldOutlined } from '../themed/EdgeTextField' +import { SecondaryButton } from '../themed/ThemedButtons' +import { UnderlinedHeader } from '../themed/UnderlinedHeader' export type CreateWalletNameOwnProps = { selectedFiat: GuiFiatType, @@ -24,10 +20,13 @@ export type CreateWalletNameOwnProps = { } type Props = CreateWalletNameOwnProps type State = { - walletName: string + walletName: string, + isFocused: boolean } export class CreateWalletName extends React.Component { + textInput = React.createRef() + constructor(props: Props) { super(props) let walletName = '' @@ -37,7 +36,7 @@ export class CreateWalletName extends React.Component { } else { walletName = sprintf(s.strings.my_crypto_wallet_name, this.props.selectedWalletType.currencyName) } - this.state = { walletName } + this.state = { walletName, isFocused: true } } isValidWalletName = () => { @@ -47,6 +46,21 @@ export class CreateWalletName extends React.Component { return isValid } + clearText = () => { + this.setState({ walletName: '' }) + if (this.textInput.current) { + this.textInput.current.blur() + } + } + + handleOnFocus = () => { + this.setState({ isFocused: true }) + } + + handleOnBlur = () => { + this.setState({ isFocused: false }) + } + onNext = () => { const { cleanedPrivateKey, selectedFiat, selectedWalletType } = this.props if (this.isValidWalletName()) { @@ -61,98 +75,34 @@ export class CreateWalletName extends React.Component { } } - onBack = () => { - Actions.pop() - } - handleChangeWalletName = (walletName: string) => { this.setState({ walletName }) } render() { return ( - - - - - - - - {s.strings.title_back} - - - - {s.strings.string_next_capitalized} - - - - - - ) - } -} - -// //////////////////////////// WalletNameInput ///////////////////////////////// + + -export type WalletNameInputProps = { - value: string, - onChangeText: (walletName: string) => void, - onNext: () => void -} - -class WalletNameInput extends React.Component { - render() { - return ( - - - + + ) } } - -const rawStyles = { - scene: { - flex: 1, - backgroundColor: THEME.COLORS.WHITE - }, - gradient: { - height: THEME.HEADER, - width: '100%', - position: 'absolute' - }, - view: { - position: 'relative', - top: THEME.HEADER, - paddingHorizontal: 20, - height: PLATFORM.usableHeight - }, - pickerView: { - marginBottom: scale(15) - }, - buttons: { - marginTop: scale(24), - flexDirection: 'row' - }, - next: { - marginLeft: scale(1), - flex: 1 - }, - back: { - marginRight: scale(1), - flex: 1 - } -} -const styles: typeof rawStyles = StyleSheet.create(rawStyles) diff --git a/src/components/scenes/CreateWalletSelectCryptoScene.js b/src/components/scenes/CreateWalletSelectCryptoScene.js index da19fdb7eae..338d0221b9d 100644 --- a/src/components/scenes/CreateWalletSelectCryptoScene.js +++ b/src/components/scenes/CreateWalletSelectCryptoScene.js @@ -2,37 +2,41 @@ import { type EdgeAccount } from 'edge-core-js' import * as React from 'react' -import { Alert, FlatList, Image, Keyboard, StyleSheet, TouchableHighlight, View } from 'react-native' +import { Alert, FlatList, Image, View } from 'react-native' import { Actions } from 'react-native-router-flux' import { connect } from 'react-redux' import { CREATE_WALLET_CHOICE, CREATE_WALLET_SELECT_FIAT, getSpecialCurrencyInfo, SPECIAL_CURRENCY_INFO } from '../../constants/indexConstants.js' import s from '../../locales/strings.js' -import Text from '../../modules/UI/components/FormattedText/FormattedText.ui.js' -import { THEME } from '../../theme/variables/airbitz.js' import { type Dispatch, type RootState } from '../../types/reduxTypes.js' import { type CreateWalletType, type FlatListItem } from '../../types/types.js' import { getCreateWalletTypes } from '../../util/CurrencyInfoHelpers.js' -import { scale } from '../../util/scaling.js' -import { FormField } from '../common/FormField.js' import { SceneWrapper } from '../common/SceneWrapper.js' +import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../services/ThemeContext.js' +import { EdgeTextFieldOutlined } from '../themed/EdgeTextField' +import { SelectableRow } from '../themed/SelectableRow' +import { UnderlinedHeader } from '../themed/UnderlinedHeader' type StateProps = { account: EdgeAccount } -type Props = StateProps +type Props = StateProps & ThemeProps type State = { selectedWalletType: string, - searchTerm: string + searchTerm: string, + isFocused: boolean } class CreateWalletSelectCryptoComponent extends React.Component { + textInput = React.createRef() + constructor(props: Props) { super(props) this.state = { selectedWalletType: '', - searchTerm: '' + searchTerm: '', + isFocused: true } } @@ -67,11 +71,6 @@ class CreateWalletSelectCryptoComponent extends React.Component { } } - onBack = () => { - Keyboard.dismiss() - Actions.pop() // redirect to the list of wallets - } - handleSearchTermChange = (searchTerm: string): void => { this.setState({ searchTerm @@ -82,14 +81,50 @@ class CreateWalletSelectCryptoComponent extends React.Component { this.setState({ selectedWalletType: item.walletType }, this.onNext) } - handleOnFocus = () => {} + clearText = () => { + this.setState({ searchTerm: '' }) + if (this.textInput.current) { + this.textInput.current.blur() + } + } - handleOnBlur = () => {} + handleOnFocus = () => { + this.setState({ isFocused: true }) + } + + handleOnBlur = () => { + this.setState({ isFocused: false }) + } + + renderWalletTypeResult = (data: FlatListItem) => { + const { theme } = this.props + const { walletType, symbolImageDarkMono, currencyCode } = data.item + const styles = getStyles(theme) + + // Ripple hack: + let { currencyName } = data.item + if (currencyCode.toLowerCase() === 'xrp') currencyName = 'Ripple' + + return ( + this.handleSelectWalletType(data.item)} + icon={symbolImageDarkMono ? : } + title={currencyCode} + subTitle={currencyName} + selected={walletType === this.state.selectedWalletType} + /> + ) + } + + keyExtractor = (item: CreateWalletType, index: number): string => { + return item.walletType + } render() { const { account } = this.props - const { searchTerm } = this.state + const { searchTerm, isFocused } = this.state const lowerSearch = searchTerm.toLowerCase() + const styles = getStyles(this.props.theme) // Sort and filter the available types: const sortedArray = getCreateWalletTypes(account) @@ -100,10 +135,11 @@ class CreateWalletSelectCryptoComponent extends React.Component { ) return ( - + {gap => ( - + { value={this.state.searchTerm} label={s.strings.create_wallet_choose_crypto} returnKeyType="search" + small + onClear={this.clearText} + isClearable={isFocused} + marginRem={[0, 1.75]} + ref={this.textInput} + blurOnSubmit /> { ) } - - renderWalletTypeResult = (data: FlatListItem) => { - const { walletType, symbolImageDarkMono, currencyCode } = data.item - - // Ripple hack: - let { currencyName } = data.item - if (currencyCode.toLowerCase() === 'xrp') currencyName = 'Ripple' - - return ( - - this.handleSelectWalletType(data.item)} underlayColor={THEME.COLORS.GRAY_4}> - - - - {symbolImageDarkMono ? ( - - ) : ( - - )} - - - - {currencyName} - {currencyCode} - - - - - - - ) - } - - keyExtractor = (item: CreateWalletType, index: number): string => { - return item.walletType - } } -const rawStyles = { +const getStyles = cacheStyles((theme: Theme) => ({ content: { - backgroundColor: THEME.COLORS.WHITE, - flex: 1, - paddingHorizontal: scale(20) - }, - resultList: { - backgroundColor: THEME.COLORS.WHITE, - borderTopColor: THEME.COLORS.GRAY_3, - borderTopWidth: 1, flex: 1 }, - selectedItem: { - backgroundColor: THEME.COLORS.GRAY_4, - borderLeftWidth: scale(1), - borderLeftColor: THEME.COLORS.GRAY_3, - borderRightWidth: scale(1), - borderRightColor: THEME.COLORS.GRAY_3 - }, - singleCryptoType: { - height: scale(60), - borderBottomWidth: scale(1), - borderBottomColor: THEME.COLORS.GRAY_3, - paddingVertical: scale(10), - paddingHorizontal: scale(15) - }, - singleCryptoTypeWrap: { - flexDirection: 'column', + resultList: { flex: 1 }, - cryptoTypeInfoWrap: { - flexDirection: 'row', - height: scale(40), - flex: 1, - justifyContent: 'space-between' - }, - cryptoTypeLeft: { - flexDirection: 'row' - }, cryptoTypeLogo: { - width: scale(40), - height: scale(40), - marginRight: scale(10) - }, - cryptoTypeLeftTextWrap: { - justifyContent: 'center' - }, - cryptoTypeName: { - fontSize: scale(16), - color: THEME.COLORS.GRAY_1, - textAlignVertical: 'center' + width: theme.rem(2), + height: theme.rem(2), + borderRadius: theme.rem(1), + marginLeft: theme.rem(0.25) } -} -const styles: typeof rawStyles = StyleSheet.create(rawStyles) +})) export const CreateWalletSelectCryptoScene = connect( (state: RootState): StateProps => ({ account: state.core.account }), (dispatch: Dispatch) => ({}) -)(CreateWalletSelectCryptoComponent) +)(withTheme(CreateWalletSelectCryptoComponent)) diff --git a/src/components/scenes/CreateWalletSelectFiatScene.js b/src/components/scenes/CreateWalletSelectFiatScene.js index 32c639dd564..d8dce6c04eb 100644 --- a/src/components/scenes/CreateWalletSelectFiatScene.js +++ b/src/components/scenes/CreateWalletSelectFiatScene.js @@ -1,21 +1,22 @@ // @flow import * as React from 'react' -import { Alert, FlatList, StyleSheet, TouchableHighlight, View } from 'react-native' +import { Alert, FlatList, Image, View } from 'react-native' import { Actions } from 'react-native-router-flux' import { connect } from 'react-redux' +import { FIAT_COUNTRY } from '../../constants/CountryConstants' import * as Constants from '../../constants/indexConstants.js' import s from '../../locales/strings.js' import { getDefaultFiat } from '../../modules/Settings/selectors.js' -import Text from '../../modules/UI/components/FormattedText/FormattedText.ui.js' -import { THEME } from '../../theme/variables/airbitz.js' import { type Dispatch, type RootState } from '../../types/reduxTypes.js' import type { CreateWalletType, FlatListItem, GuiFiatType } from '../../types/types.js' -import { scale } from '../../util/scaling.js' import { getSupportedFiats } from '../../util/utils' -import { FormField } from '../common/FormField.js' import { SceneWrapper } from '../common/SceneWrapper.js' +import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../services/ThemeContext.js' +import { EdgeTextFieldOutlined } from '../themed/EdgeTextField' +import { SelectableRow } from '../themed/SelectableRow' +import { UnderlinedHeader } from '../themed/UnderlinedHeader' type OwnProps = { selectedWalletType: CreateWalletType, @@ -24,19 +25,23 @@ type OwnProps = { type StateProps = { supportedFiats: GuiFiatType[] } -type Props = OwnProps & StateProps +type Props = OwnProps & StateProps & ThemeProps type State = { searchTerm: string, - selectedFiat: string + selectedFiat: string, + isFocused: boolean } class CreateWalletSelectFiatComponent extends React.Component { + textInput = React.createRef() + constructor(props: Props) { super(props) this.state = { searchTerm: '', - selectedFiat: '' + selectedFiat: '', + isFocused: true } } @@ -95,20 +100,56 @@ class CreateWalletSelectFiatComponent extends React.Component { } } - handleOnFocus = () => {} + clearText = () => { + this.setState({ searchTerm: '' }) + if (this.textInput.current) { + this.textInput.current.blur() + } + } + + handleOnFocus = () => { + this.setState({ isFocused: true }) + } + + handleOnBlur = () => { + this.setState({ isFocused: false }) + } + + renderFiatTypeResult = (data: FlatListItem) => { + const styles = getStyles(this.props.theme) + const fiatCountry = FIAT_COUNTRY[data.item.value] + if (!fiatCountry) { + return null + } + + return ( + this.handleSelectFiatType(data.item)} + icon={fiatCountry.logoUrl ? : } + title={data.item.value} + subTitle={fiatCountry.fiatName} + selected={data.item.value === this.state.selectedFiat} + /> + ) + } - handleOnBlur = () => {} + keyExtractor = (item: GuiFiatType, index: string) => { + return item.value + } render() { + const { isFocused } = this.state + const styles = getStyles(this.props.theme) const filteredArray = this.props.supportedFiats.filter(entry => { return entry.label.toLowerCase().indexOf(this.state.searchTerm.toLowerCase()) >= 0 }) return ( - + {gap => ( - + { value={this.state.searchTerm} label={s.strings.fragment_wallets_addwallet_fiat_hint} returnKeyType="search" + small + onClear={this.clearText} + isClearable={isFocused} + marginRem={[0, 1.75]} + ref={this.textInput} + blurOnSubmit /> { ) } - - renderFiatTypeResult = (data: FlatListItem) => { - return ( - - this.handleSelectFiatType(data.item)} underlayColor={THEME.COLORS.GRAY_4}> - - - - {data.item.label} - - - - - - ) - } - - keyExtractor = (item: GuiFiatType, index: string) => { - return item.value - } } -const rawStyles = { +const getStyles = cacheStyles((theme: Theme) => ({ content: { - backgroundColor: THEME.COLORS.WHITE, - flex: 1, - paddingHorizontal: scale(20) - }, - resultList: { - backgroundColor: THEME.COLORS.WHITE, - borderTopColor: THEME.COLORS.GRAY_3, - borderTopWidth: 1, flex: 1 }, - selectedItem: { - backgroundColor: THEME.COLORS.GRAY_4, - borderLeftWidth: scale(1), - borderLeftColor: THEME.COLORS.GRAY_3, - borderRightWidth: scale(1), - borderRightColor: THEME.COLORS.GRAY_3 - }, - singleCryptoType: { - height: scale(60), - borderBottomWidth: scale(1), - borderBottomColor: THEME.COLORS.GRAY_3, - paddingVertical: scale(10), - paddingHorizontal: scale(15) - }, - singleCryptoTypeWrap: { - flexDirection: 'column', + resultList: { flex: 1 }, - cryptoTypeInfoWrap: { - flexDirection: 'row', - height: scale(40), - flex: 1, - justifyContent: 'space-between' - }, - cryptoTypeLeft: { - flexDirection: 'row' - }, - cryptoTypeLeftTextWrap: { - justifyContent: 'center' - }, - cryptoTypeName: { - fontSize: scale(16), - color: THEME.COLORS.GRAY_1, - textAlignVertical: 'center' + cryptoTypeLogo: { + width: theme.rem(2), + height: theme.rem(2), + borderRadius: theme.rem(1), + marginLeft: theme.rem(0.25), + backgroundColor: theme.backgroundGradientRight } -} -const styles: typeof rawStyles = StyleSheet.create(rawStyles) +})) export const CreateWalletSelectFiatScene = connect( (state: RootState): StateProps => ({ supportedFiats: getSupportedFiats(getDefaultFiat(state)) }), (dispatch: Dispatch) => ({}) -)(CreateWalletSelectFiatComponent) +)(withTheme(CreateWalletSelectFiatComponent)) diff --git a/src/components/themed/SelectableRow.js b/src/components/themed/SelectableRow.js new file mode 100644 index 00000000000..143419d5d4c --- /dev/null +++ b/src/components/themed/SelectableRow.js @@ -0,0 +1,68 @@ +// @flow + +import * as React from 'react' +import { View } from 'react-native' +import IonIcon from 'react-native-vector-icons/Ionicons' + +import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../services/ThemeContext.js' +import { ClickableRow } from './ClickableRow' +import { EdgeText } from './EdgeText' + +type Props = { + onPress: () => void | (() => Promise), + title: string, + subTitle: string, + icon?: React.Node, + selected: boolean +} + +class SelectableRowComponent extends React.PureComponent { + render() { + const { icon, title, subTitle, onPress, theme } = this.props + const styles = getStyles(theme) + + return ( + + + + {icon} + + {title} + {subTitle} + + + + + + ) + } +} + +const getStyles = cacheStyles((theme: Theme) => ({ + rowContainer: { + width: '100%', + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between' + }, + iconTitleContainer: { + flexDirection: 'row', + alignItems: 'center' + }, + title: { + flexDirection: 'column', + marginLeft: theme.rem(1.25) + }, + subTitle: { + color: theme.deactivatedText, + fontSize: theme.rem(0.75), + marginTop: theme.rem(0.25) + }, + iconStyle: { + marginRight: theme.rem(-0.5) + // position: 'absolute', + // paddingHorizontal: theme.rem(0.75) + } +})) + +export const SelectableRow = withTheme(SelectableRowComponent) diff --git a/src/constants/CountryConstants.js b/src/constants/CountryConstants.js index 29ccb8ab669..9a357e3d00c 100644 --- a/src/constants/CountryConstants.js +++ b/src/constants/CountryConstants.js @@ -6,7 +6,7 @@ import { imageServerUrl } from './WalletAndCurrencyConstants.js' export const FLAG_LOGO_URL = `${imageServerUrl}/country-logos` export const COUNTRY_CODES: CountryData[] = [ - { name: 'Afghanistan', 'alpha-2': 'AF' }, + { name: 'Afghanistan', 'alpha-2': 'AF', fiat: '' }, { name: 'Åland Islands', filename: 'aland-islands', 'alpha-2': 'AX' }, { name: 'Albania', 'alpha-2': 'AL' }, { name: 'Algeria', 'alpha-2': 'DZ' }, @@ -240,6 +240,186 @@ export const COUNTRY_CODES: CountryData[] = [ { name: 'Zimbabwe', 'alpha-2': 'ZW' } ] +export const FIAT_COUNTRY: { [string]: { countryName: string, fiatName: string, logoUrl: string } } = { + AFN: { countryName: 'AFGHANISTAN', logoUrl: `${FLAG_LOGO_URL}/afghanistan.png`, fiatName: 'Afghani' }, + ALL: { countryName: 'ALBANIA', logoUrl: `${FLAG_LOGO_URL}/albania.png`, fiatName: 'Lek' }, + DZD: { countryName: 'ALGERIA', logoUrl: `${FLAG_LOGO_URL}/algeria.png`, fiatName: 'Algerian Dinar' }, + USD: { countryName: 'United States of America', logoUrl: `${FLAG_LOGO_URL}/united-states-of-america.png`, fiatName: 'United States Dollar' }, + EUR: { countryName: 'European Union', logoUrl: `${FLAG_LOGO_URL}/european-union.png`, fiatName: 'Euro' }, + AOA: { countryName: 'ANGOLA', logoUrl: `${FLAG_LOGO_URL}/angola.png`, fiatName: 'Kwanza' }, + XCD: { + countryName: 'SAINT VINCENT AND THE GRENADINES', + logoUrl: `${FLAG_LOGO_URL}/st-vincent-and-the-grenadines.png`, + fiatName: 'East Caribbean Dollar' + }, + '': { countryName: '-', logoUrl: '', fiatName: 'No universal currency' }, + ARS: { countryName: 'ARGENTINA', logoUrl: `${FLAG_LOGO_URL}/argentina.png`, fiatName: 'Argentine Peso' }, + AMD: { countryName: 'ARMENIA', logoUrl: `${FLAG_LOGO_URL}/armenia.png`, fiatName: 'Armenian Dram' }, + AWG: { countryName: 'ARUBA', logoUrl: `${FLAG_LOGO_URL}/aruba.png`, fiatName: 'Aruban Florin' }, + AUD: { countryName: 'TUVALU', logoUrl: `${FLAG_LOGO_URL}/tuvalu.png`, fiatName: 'Australian Dollar' }, + AZN: { countryName: 'AZERBAIJAN', logoUrl: `${FLAG_LOGO_URL}/azerbaijan.png`, fiatName: 'Azerbaijanian Manat' }, + BSD: { countryName: '-', logoUrl: '', fiatName: 'Bahamian Dollar' }, + BHD: { countryName: 'BAHRAIN', logoUrl: `${FLAG_LOGO_URL}/bahrain.png`, fiatName: 'Bahraini Dinar' }, + BDT: { countryName: 'BANGLADESH', logoUrl: `${FLAG_LOGO_URL}/bangladesh.png`, fiatName: 'Taka' }, + BBD: { countryName: 'BARBADOS', logoUrl: `${FLAG_LOGO_URL}/barbados.png`, fiatName: 'Barbados Dollar' }, + BYN: { countryName: 'BELARUS', logoUrl: `${FLAG_LOGO_URL}/belarus.png`, fiatName: 'Belarussian Ruble' }, + BZD: { countryName: 'BELIZE', logoUrl: `${FLAG_LOGO_URL}/belize.png`, fiatName: 'Belize Dollar' }, + XOF: { countryName: 'TOGO', logoUrl: `${FLAG_LOGO_URL}/togo.png`, fiatName: 'CFA Franc BCEAO' }, + BMD: { countryName: 'BERMUDA', logoUrl: `${FLAG_LOGO_URL}/bermuda.png`, fiatName: 'Bermudian Dollar' }, + BTN: { countryName: 'BHUTAN', logoUrl: `${FLAG_LOGO_URL}/bhutan.png`, fiatName: 'Ngultrum' }, + INR: { countryName: 'INDIA', logoUrl: `${FLAG_LOGO_URL}/india.png`, fiatName: 'Indian Rupee' }, + BOB: { countryName: 'BOLIVIA (PLURINATIONAL STATE OF)', logoUrl: `${FLAG_LOGO_URL}/bolivia.png`, fiatName: 'Boliviano' }, + BOV: { countryName: 'BOLIVIA (PLURINATIONAL STATE OF)', logoUrl: `${FLAG_LOGO_URL}/bolivia.png`, fiatName: 'Mvdol' }, + BAM: { countryName: 'BOSNIA AND HERZEGOVINA', logoUrl: `${FLAG_LOGO_URL}/bosnia-and-herzegovina.png`, fiatName: 'Convertible Mark' }, + BWP: { countryName: 'BOTSWANA', logoUrl: `${FLAG_LOGO_URL}/botswana.png`, fiatName: 'Pula' }, + NOK: { countryName: '-', logoUrl: '', fiatName: 'Norwegian Krone' }, + BRL: { countryName: 'BRAZIL', logoUrl: `${FLAG_LOGO_URL}/brazil.png`, fiatName: 'Brazilian Real' }, + BND: { countryName: 'BRUNEI DARUSSALAM', logoUrl: `${FLAG_LOGO_URL}/brunei.png`, fiatName: 'Brunei Dollar' }, + BGN: { countryName: 'BULGARIA', logoUrl: `${FLAG_LOGO_URL}/bulgaria.png`, fiatName: 'Bulgarian Lev' }, + BIF: { countryName: 'BURUNDI', logoUrl: `${FLAG_LOGO_URL}/burundi.png`, fiatName: 'Burundi Franc' }, + CVE: { countryName: 'CABO VERDE', logoUrl: `${FLAG_LOGO_URL}/cape-verde.png`, fiatName: 'Cabo Verde Escudo' }, + KHR: { countryName: 'CAMBODIA', logoUrl: `${FLAG_LOGO_URL}/cambodia.png`, fiatName: 'Riel' }, + XAF: { countryName: 'GABON', logoUrl: `${FLAG_LOGO_URL}/gabon.png`, fiatName: 'CFA Franc BEAC' }, + CAD: { countryName: 'CANADA', logoUrl: `${FLAG_LOGO_URL}/canada.png`, fiatName: 'Canadian Dollar' }, + KYD: { countryName: '-', logoUrl: '', fiatName: 'Cayman Islands Dollar' }, + CLF: { countryName: 'CHILE', logoUrl: `${FLAG_LOGO_URL}/chile.png`, fiatName: 'Unidad de Fomento' }, + CLP: { countryName: 'CHILE', logoUrl: `${FLAG_LOGO_URL}/chile.png`, fiatName: 'Chilean Peso' }, + CNY: { countryName: 'CHINA', logoUrl: `${FLAG_LOGO_URL}/china.png`, fiatName: 'Yuan Renminbi' }, + COP: { countryName: 'COLOMBIA', logoUrl: `${FLAG_LOGO_URL}/colombia.png`, fiatName: 'Colombian Peso' }, + COU: { countryName: 'COLOMBIA', logoUrl: `${FLAG_LOGO_URL}/colombia.png`, fiatName: 'Unidad de Valor Real' }, + KMF: { countryName: '-', logoUrl: '', fiatName: 'Comoro Franc' }, + CDF: { countryName: '-', logoUrl: '', fiatName: 'Congolese Franc' }, + NZD: { countryName: 'TOKELAU', logoUrl: `${FLAG_LOGO_URL}/tokelau.png`, fiatName: 'New Zealand Dollar' }, + CRC: { countryName: 'COSTA RICA', logoUrl: `${FLAG_LOGO_URL}/costa-rica.png`, fiatName: 'Costa Rican Colon' }, + HRK: { countryName: 'CROATIA', logoUrl: `${FLAG_LOGO_URL}/croatia.png`, fiatName: 'Kuna' }, + CUC: { countryName: 'CUBA', logoUrl: `${FLAG_LOGO_URL}/cuba.png`, fiatName: 'Peso Convertible' }, + CUP: { countryName: 'CUBA', logoUrl: `${FLAG_LOGO_URL}/cuba.png`, fiatName: 'Cuban Peso' }, + ANG: { countryName: '-', logoUrl: '', fiatName: 'Netherlands Antillean Guilder' }, + CZK: { countryName: '-', logoUrl: '', fiatName: 'Czech Koruna' }, + DKK: { countryName: 'GREENLAND', logoUrl: `${FLAG_LOGO_URL}/greenland.png`, fiatName: 'Danish Krone' }, + DJF: { countryName: 'DJIBOUTI', logoUrl: `${FLAG_LOGO_URL}/djibouti.png`, fiatName: 'Djibouti Franc' }, + DOP: { countryName: '-', logoUrl: '', fiatName: 'Dominican Peso' }, + EGP: { countryName: 'EGYPT', logoUrl: `${FLAG_LOGO_URL}/egypt.png`, fiatName: 'Egyptian Pound' }, + SVC: { countryName: 'EL SALVADOR', logoUrl: `${FLAG_LOGO_URL}/salvador.png`, fiatName: 'El Salvador Colon' }, + ERN: { countryName: 'ERITREA', logoUrl: `${FLAG_LOGO_URL}/eritrea.png`, fiatName: 'Nakfa' }, + ETB: { countryName: 'ETHIOPIA', logoUrl: `${FLAG_LOGO_URL}/ethiopia.png`, fiatName: 'Ethiopian Birr' }, + FKP: { countryName: '-', logoUrl: '', fiatName: 'Falkland Islands Pound' }, + FJD: { countryName: 'FIJI', logoUrl: `${FLAG_LOGO_URL}/fiji.png`, fiatName: 'Fiji Dollar' }, + XPF: { countryName: '-', logoUrl: '', fiatName: 'CFP Franc' }, + GMD: { countryName: '-', logoUrl: '', fiatName: 'Dalasi' }, + GEL: { countryName: 'GEORGIA', logoUrl: `${FLAG_LOGO_URL}/georgia.png`, fiatName: 'Lari' }, + GHS: { countryName: 'GHANA', logoUrl: `${FLAG_LOGO_URL}/ghana.png`, fiatName: 'Ghana Cedi' }, + GIP: { countryName: 'GIBRALTAR', logoUrl: `${FLAG_LOGO_URL}/gibraltar.png`, fiatName: 'Gibraltar Pound' }, + GTQ: { countryName: 'GUATEMALA', logoUrl: `${FLAG_LOGO_URL}/guatemala.png`, fiatName: 'Quetzal' }, + GBP: { countryName: '-', logoUrl: `${FLAG_LOGO_URL}/united-kingdom.png`, fiatName: 'Pound Sterling' }, + GNF: { countryName: 'GUINEA', logoUrl: `${FLAG_LOGO_URL}/guinea.png`, fiatName: 'Guinea Franc' }, + GYD: { countryName: 'GUYANA', logoUrl: `${FLAG_LOGO_URL}/guyana.png`, fiatName: 'Guyana Dollar' }, + HTG: { countryName: 'HAITI', logoUrl: `${FLAG_LOGO_URL}/haiti.png`, fiatName: 'Gourde' }, + HNL: { countryName: 'HONDURAS', logoUrl: `${FLAG_LOGO_URL}/honduras.png`, fiatName: 'Lempira' }, + HKD: { countryName: 'HONG KONG', logoUrl: `${FLAG_LOGO_URL}/hong-kong.png`, fiatName: 'Hong Kong Dollar' }, + HUF: { countryName: 'HUNGARY', logoUrl: `${FLAG_LOGO_URL}/hungary.png`, fiatName: 'Forint' }, + ISK: { countryName: 'ICELAND', logoUrl: `${FLAG_LOGO_URL}/iceland.png`, fiatName: 'Iceland Krona' }, + IDR: { countryName: 'INDONESIA', logoUrl: `${FLAG_LOGO_URL}/indonesia.png`, fiatName: 'Rupiah' }, + XDR: { countryName: '-', logoUrl: '', fiatName: 'SDR (Special Drawing Right)' }, + IRR: { countryName: 'IRAN (ISLAMIC REPUBLIC OF)', logoUrl: `${FLAG_LOGO_URL}/iran.png`, fiatName: 'Iranian Rial' }, + IQD: { countryName: 'IRAQ', logoUrl: `${FLAG_LOGO_URL}/iraq.png`, fiatName: 'Iraqi Dinar' }, + ILS: { countryName: 'ISRAEL', logoUrl: `${FLAG_LOGO_URL}/israel.png`, fiatName: 'New Israeli Sheqel' }, + JMD: { countryName: 'JAMAICA', logoUrl: `${FLAG_LOGO_URL}/jamaica.png`, fiatName: 'Jamaican Dollar' }, + JPY: { countryName: 'JAPAN', logoUrl: `${FLAG_LOGO_URL}/japan.png`, fiatName: 'Yen' }, + JOD: { countryName: 'JORDAN', logoUrl: `${FLAG_LOGO_URL}/jordan.png`, fiatName: 'Jordanian Dinar' }, + KZT: { countryName: 'KAZAKHSTAN', logoUrl: `${FLAG_LOGO_URL}/kazakhstan.png`, fiatName: 'Tenge' }, + KES: { countryName: 'KENYA', logoUrl: `${FLAG_LOGO_URL}/kenya.png`, fiatName: 'Kenyan Shilling' }, + KPW: { countryName: '-', logoUrl: '', fiatName: 'North Korean Won' }, + KRW: { countryName: '-', logoUrl: '', fiatName: 'Won' }, + KWD: { countryName: 'KUWAIT', logoUrl: `${FLAG_LOGO_URL}/kuwait.png`, fiatName: 'Kuwaiti Dinar' }, + KGS: { countryName: 'KYRGYZSTAN', logoUrl: `${FLAG_LOGO_URL}/kyrgyzstan.png`, fiatName: 'Som' }, + LAK: { countryName: '-', logoUrl: '', fiatName: 'Kip' }, + LBP: { countryName: 'LEBANON', logoUrl: `${FLAG_LOGO_URL}/lebanon.png`, fiatName: 'Lebanese Pound' }, + LSL: { countryName: 'LESOTHO', logoUrl: `${FLAG_LOGO_URL}/lesotho.png`, fiatName: 'Loti' }, + ZAR: { countryName: 'SOUTH AFRICA', logoUrl: `${FLAG_LOGO_URL}/south-africa.png`, fiatName: 'Rand' }, + LRD: { countryName: 'LIBERIA', logoUrl: `${FLAG_LOGO_URL}/liberia.png`, fiatName: 'Liberian Dollar' }, + LYD: { countryName: 'LIBYA', logoUrl: `${FLAG_LOGO_URL}/libya.png`, fiatName: 'Libyan Dinar' }, + CHF: { countryName: 'SWITZERLAND', logoUrl: `${FLAG_LOGO_URL}/switzerland.png`, fiatName: 'Swiss Franc' }, + MOP: { countryName: 'MACAO', logoUrl: `${FLAG_LOGO_URL}/macao.png`, fiatName: 'Pataca' }, + MGA: { countryName: 'MADAGASCAR', logoUrl: `${FLAG_LOGO_URL}/madagascar.png`, fiatName: 'Malagasy Ariary' }, + MWK: { countryName: 'MALAWI', logoUrl: `${FLAG_LOGO_URL}/malawi.png`, fiatName: 'Kwacha' }, + MYR: { countryName: 'MALAYSIA', logoUrl: `${FLAG_LOGO_URL}/malaysia.png`, fiatName: 'Malaysian Ringgit' }, + MVR: { countryName: 'MALDIVES', logoUrl: `${FLAG_LOGO_URL}/maldives.png`, fiatName: 'Rufiyaa' }, + MRU: { countryName: 'MAURITANIA', logoUrl: `${FLAG_LOGO_URL}/mauritania.png`, fiatName: 'Ouguiya' }, + MUR: { countryName: 'MAURITIUS', logoUrl: `${FLAG_LOGO_URL}/mauritius.png`, fiatName: 'Mauritius Rupee' }, + XUA: { countryName: '-', logoUrl: '', fiatName: 'ADB Unit of Account' }, + MXN: { countryName: 'MEXICO', logoUrl: `${FLAG_LOGO_URL}/mexico.png`, fiatName: 'Mexican Peso' }, + MXV: { countryName: 'MEXICO', logoUrl: `${FLAG_LOGO_URL}/mexico.png`, fiatName: 'Mexican Unidad de Inversion (UDI)' }, + MDL: { countryName: '-', logoUrl: '', fiatName: 'Moldovan Leu' }, + MNT: { countryName: 'MONGOLIA', logoUrl: `${FLAG_LOGO_URL}/mongolia.png`, fiatName: 'Tugrik' }, + MAD: { countryName: 'WESTERN SAHARA', logoUrl: `${FLAG_LOGO_URL}/western-sahara.png`, fiatName: 'Moroccan Dirham' }, + MZN: { countryName: 'MOZAMBIQUE', logoUrl: `${FLAG_LOGO_URL}/mozambique.png`, fiatName: 'Mozambique Metical' }, + MMK: { countryName: 'MYANMAR', logoUrl: `${FLAG_LOGO_URL}/myanmar.png`, fiatName: 'Kyat' }, + NAD: { countryName: 'NAMIBIA', logoUrl: `${FLAG_LOGO_URL}/namibia.png`, fiatName: 'Namibia Dollar' }, + NPR: { countryName: 'NEPAL', logoUrl: `${FLAG_LOGO_URL}/nepal.png`, fiatName: 'Nepalese Rupee' }, + NIO: { countryName: 'NICARAGUA', logoUrl: `${FLAG_LOGO_URL}/nicaragua.png`, fiatName: 'Cordoba Oro' }, + NGN: { countryName: 'NIGERIA', logoUrl: `${FLAG_LOGO_URL}/nigeria.png`, fiatName: 'Naira' }, + OMR: { countryName: 'OMAN', logoUrl: `${FLAG_LOGO_URL}/oman.png`, fiatName: 'Rial Omani' }, + PKR: { countryName: 'PAKISTAN', logoUrl: `${FLAG_LOGO_URL}/pakistan.png`, fiatName: 'Pakistan Rupee' }, + PAB: { countryName: 'PANAMA', logoUrl: `${FLAG_LOGO_URL}/panama.png`, fiatName: 'Balboa' }, + PGK: { countryName: 'PAPUA NEW GUINEA', logoUrl: `${FLAG_LOGO_URL}/papua-new-guinea.png`, fiatName: 'Kina' }, + PYG: { countryName: 'PARAGUAY', logoUrl: `${FLAG_LOGO_URL}/paraguay.png`, fiatName: 'Guarani' }, + PEN: { countryName: 'PERU', logoUrl: `${FLAG_LOGO_URL}/peru.png`, fiatName: 'Nuevo Sol' }, + PHP: { countryName: '-', logoUrl: '', fiatName: 'Philippine Peso' }, + PLN: { countryName: 'POLAND', logoUrl: `${FLAG_LOGO_URL}/republic-of-poland.png`, fiatName: 'Zloty' }, + QAR: { countryName: 'QATAR', logoUrl: `${FLAG_LOGO_URL}/qatar.png`, fiatName: 'Qatari Rial' }, + MKD: { countryName: '-', logoUrl: '', fiatName: 'Denar' }, + RON: { countryName: 'ROMANIA', logoUrl: `${FLAG_LOGO_URL}/romania.png`, fiatName: 'Romanian Leu' }, + RUB: { countryName: '-', logoUrl: '', fiatName: 'Russian Ruble' }, + RWF: { countryName: 'RWANDA', logoUrl: `${FLAG_LOGO_URL}/rwanda.png`, fiatName: 'Rwanda Franc' }, + SHP: { countryName: '-', logoUrl: '', fiatName: 'Saint Helena Pound' }, + WST: { countryName: 'SAMOA', logoUrl: `${FLAG_LOGO_URL}/samoa.png`, fiatName: 'Tala' }, + STN: { countryName: 'SAO TOME AND PRINCIPE', logoUrl: `${FLAG_LOGO_URL}/sao-tome-and-principe.png`, fiatName: 'Dobra' }, + SAR: { countryName: 'SAUDI ARABIA', logoUrl: `${FLAG_LOGO_URL}/saudi-arabia.png`, fiatName: 'Saudi Riyal' }, + RSD: { countryName: 'SERBIA', logoUrl: `${FLAG_LOGO_URL}/serbia.png`, fiatName: 'Serbian Dinar' }, + SCR: { countryName: 'SEYCHELLES', logoUrl: `${FLAG_LOGO_URL}/seychelles.png`, fiatName: 'Seychelles Rupee' }, + SLL: { countryName: 'SIERRA LEONE', logoUrl: `${FLAG_LOGO_URL}/sierra-leone.png`, fiatName: 'Leone' }, + SGD: { countryName: 'SINGAPORE', logoUrl: `${FLAG_LOGO_URL}/singapore.png`, fiatName: 'Singapore Dollar' }, + XSU: { countryName: '-', logoUrl: '', fiatName: 'Sucre' }, + SBD: { countryName: 'SOLOMON ISLANDS', logoUrl: `${FLAG_LOGO_URL}/solomon-islands.png`, fiatName: 'Solomon Islands Dollar' }, + SOS: { countryName: 'SOMALIA', logoUrl: `${FLAG_LOGO_URL}/somalia.png`, fiatName: 'Somali Shilling' }, + SSP: { countryName: 'SOUTH SUDAN', logoUrl: `${FLAG_LOGO_URL}/south-sudan.png`, fiatName: 'South Sudanese Pound' }, + LKR: { countryName: 'SRI LANKA', logoUrl: `${FLAG_LOGO_URL}/sri-lanka.png`, fiatName: 'Sri Lanka Rupee' }, + SDG: { countryName: '-', logoUrl: '', fiatName: 'Sudanese Pound' }, + SRD: { countryName: 'SURINAME', logoUrl: `${FLAG_LOGO_URL}/suriname.png`, fiatName: 'Surinam Dollar' }, + SZL: { countryName: '-', logoUrl: '', fiatName: 'Lilangeni' }, + SEK: { countryName: 'SWEDEN', logoUrl: `${FLAG_LOGO_URL}/sweden.png`, fiatName: 'Swedish Krona' }, + CHE: { countryName: 'SWITZERLAND', logoUrl: `${FLAG_LOGO_URL}/switzerland.png`, fiatName: 'WIR Euro' }, + CHW: { countryName: 'SWITZERLAND', logoUrl: `${FLAG_LOGO_URL}/switzerland.png`, fiatName: 'WIR Franc' }, + SYP: { countryName: 'SYRIAN ARAB REPUBLIC', logoUrl: `${FLAG_LOGO_URL}/syria.png`, fiatName: 'Syrian Pound' }, + TWD: { countryName: '-', logoUrl: '', fiatName: 'New Taiwan Dollar' }, + TJS: { countryName: 'TAJIKISTAN', logoUrl: `${FLAG_LOGO_URL}/tajikistan.png`, fiatName: 'Somoni' }, + TZS: { countryName: 'TANZANIA, UNITED REPUBLIC OF', logoUrl: `${FLAG_LOGO_URL}/tanzania.png`, fiatName: 'Tanzanian Shilling' }, + THB: { countryName: 'THAILAND', logoUrl: `${FLAG_LOGO_URL}/thailand.png`, fiatName: 'Baht' }, + TOP: { countryName: 'TONGA', logoUrl: `${FLAG_LOGO_URL}/tonga.png`, fiatName: 'Pa’anga' }, + TTD: { + countryName: 'TRINIDAD AND TOBAGO', + logoUrl: `${FLAG_LOGO_URL}/trinidad-and-tobago.png`, + fiatName: 'Trinidad and Tobago Dollar' + }, + TND: { countryName: 'TUNISIA', logoUrl: `${FLAG_LOGO_URL}/tunisia.png`, fiatName: 'Tunisian Dinar' }, + TRY: { countryName: 'TURKEY', logoUrl: `${FLAG_LOGO_URL}/turkey.png`, fiatName: 'Turkish Lira' }, + TMT: { countryName: 'TURKMENISTAN', logoUrl: `${FLAG_LOGO_URL}/turkmenistan.png`, fiatName: 'Turkmenistan New Manat' }, + UGX: { countryName: 'UGANDA', logoUrl: `${FLAG_LOGO_URL}/uganda.png`, fiatName: 'Uganda Shilling' }, + UAH: { countryName: 'UKRAINE', logoUrl: `${FLAG_LOGO_URL}/ukraine.png`, fiatName: 'Hryvnia' }, + AED: { countryName: '-', logoUrl: '', fiatName: 'UAE Dirham' }, + USN: { countryName: '-', logoUrl: '', fiatName: 'United States Dollar (Next day)' }, + UYI: { countryName: 'URUGUAY', logoUrl: `${FLAG_LOGO_URL}/uruguay.png`, fiatName: 'Uruguay Peso en Unidades Indexadas (URUIURUI)' }, + UYU: { countryName: 'URUGUAY', logoUrl: `${FLAG_LOGO_URL}/uruguay.png`, fiatName: 'Peso Uruguayo' }, + UZS: { countryName: 'UZBEKISTAN', logoUrl: `${FLAG_LOGO_URL}/uzbekistn.png`, fiatName: 'Uzbekistan Sum' }, + VUV: { countryName: 'VANUATU', logoUrl: `${FLAG_LOGO_URL}/vanuatu.png`, fiatName: 'Vatu' }, + VEF: { countryName: 'VENEZUELA (BOLIVARIAN REPUBLIC OF)', logoUrl: `${FLAG_LOGO_URL}/venezuela.png`, fiatName: 'Bolivar' }, + VND: { countryName: 'VIET NAM', logoUrl: `${FLAG_LOGO_URL}/vietnam.png`, fiatName: 'Dong' }, + YER: { countryName: 'YEMEN', logoUrl: `${FLAG_LOGO_URL}/yemen.png`, fiatName: 'Yemeni Rial' }, + ZMW: { countryName: 'ZAMBIA', logoUrl: `${FLAG_LOGO_URL}/zambia.png`, fiatName: 'Zambian Kwacha' }, + ZWL: { countryName: 'ZIMBABWE', logoUrl: `${FLAG_LOGO_URL}/zimbabwe.png`, fiatName: 'Zimbabwe Dollar' } +} + // utility for recreating list from https://raw.githubusercontent.com/lukes/ISO-3166-Countries-with-Regional-Codes/master/all/all.json /* const modifiedCountryCodes = COUNTRY_CODES.map(country => { return { diff --git a/src/locales/en_US.js b/src/locales/en_US.js index 3114fad101a..61c76004525 100644 --- a/src/locales/en_US.js +++ b/src/locales/en_US.js @@ -351,7 +351,7 @@ const strings = { string_add_edit_tokens: 'Add / Edit Tokens', string_get_raw_keys: 'Get Raw Keys', string_raw_keys: 'Raw Keys', - title_create_wallet_select_crypto: 'Select Type', + title_create_wallet_select_crypto: 'Select Wallet Type', title_create_wallet_select_fiat: 'Select Fiat', title_back: 'Back', title_change_mining_fee: 'Change Mining Fee', diff --git a/src/locales/strings/enUS.json b/src/locales/strings/enUS.json index 768df6e1ea7..b3290a71fe4 100644 --- a/src/locales/strings/enUS.json +++ b/src/locales/strings/enUS.json @@ -330,7 +330,7 @@ "string_add_edit_tokens": "Add / Edit Tokens", "string_get_raw_keys": "Get Raw Keys", "string_raw_keys": "Raw Keys", - "title_create_wallet_select_crypto": "Select Type", + "title_create_wallet_select_crypto": "Select Wallet Type", "title_create_wallet_select_fiat": "Select Fiat", "title_back": "Back", "title_change_mining_fee": "Change Mining Fee", From 55623630bc915dda4c02a429090f719b6916c2cc Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Wed, 14 Apr 2021 17:33:40 +0300 Subject: [PATCH 014/110] SceneHeader. Currency labels localized. --- .../scenes/CreateWalletNameScene.js | 4 +- .../scenes/CreateWalletSelectCryptoScene.js | 4 +- .../scenes/CreateWalletSelectFiatScene.js | 6 +- src/components/themed/SceneHeader.js | 49 +++ src/constants/CountryConstants.js | 348 +++++++++--------- src/locales/en_US.js | 173 ++++++++- src/locales/strings/enUS.json | 171 ++++++++- 7 files changed, 568 insertions(+), 187 deletions(-) create mode 100644 src/components/themed/SceneHeader.js diff --git a/src/components/scenes/CreateWalletNameScene.js b/src/components/scenes/CreateWalletNameScene.js index c07f3d610ef..6db7fef00a0 100644 --- a/src/components/scenes/CreateWalletNameScene.js +++ b/src/components/scenes/CreateWalletNameScene.js @@ -10,8 +10,8 @@ import s from '../../locales/strings.js' import type { CreateWalletType, GuiFiatType } from '../../types/types.js' import { SceneWrapper } from '../common/SceneWrapper' import { EdgeTextFieldOutlined } from '../themed/EdgeTextField' +import { SceneHeader } from '../themed/SceneHeader' import { SecondaryButton } from '../themed/ThemedButtons' -import { UnderlinedHeader } from '../themed/UnderlinedHeader' export type CreateWalletNameOwnProps = { selectedFiat: GuiFiatType, @@ -82,7 +82,7 @@ export class CreateWalletName extends React.Component { render() { return ( - + { {gap => ( - + { onPress={() => this.handleSelectFiatType(data.item)} icon={fiatCountry.logoUrl ? : } title={data.item.value} - subTitle={fiatCountry.fiatName} + subTitle={s.strings[`currency_label_${data.item.value}`]} selected={data.item.value === this.state.selectedFiat} /> ) @@ -148,7 +148,7 @@ class CreateWalletSelectFiatComponent extends React.Component { {gap => ( - + { + render() { + const { title, underline, withTopMargin, children, theme } = this.props + const styles = getStyles(theme) + return ( + + {title ? {title} : null} + {children} + + ) + } +} + +const getStyles = cacheStyles((theme: Theme) => ({ + container: { + justifyContent: 'center', + marginLeft: theme.rem(1), + marginBottom: theme.rem(0.5), + paddingBottom: theme.rem(1) + }, + underline: { + borderBottomWidth: theme.thinLineWidth, + borderBottomColor: theme.lineDivider + }, + topMargin: { + marginTop: theme.rem(1) + }, + title: { + fontSize: theme.rem(1.25), + fontWeight: '600' + } +})) + +export const SceneHeader = withTheme(SceneHeaderComponent) diff --git a/src/constants/CountryConstants.js b/src/constants/CountryConstants.js index 9a357e3d00c..92f9d389330 100644 --- a/src/constants/CountryConstants.js +++ b/src/constants/CountryConstants.js @@ -240,184 +240,176 @@ export const COUNTRY_CODES: CountryData[] = [ { name: 'Zimbabwe', 'alpha-2': 'ZW' } ] -export const FIAT_COUNTRY: { [string]: { countryName: string, fiatName: string, logoUrl: string } } = { - AFN: { countryName: 'AFGHANISTAN', logoUrl: `${FLAG_LOGO_URL}/afghanistan.png`, fiatName: 'Afghani' }, - ALL: { countryName: 'ALBANIA', logoUrl: `${FLAG_LOGO_URL}/albania.png`, fiatName: 'Lek' }, - DZD: { countryName: 'ALGERIA', logoUrl: `${FLAG_LOGO_URL}/algeria.png`, fiatName: 'Algerian Dinar' }, - USD: { countryName: 'United States of America', logoUrl: `${FLAG_LOGO_URL}/united-states-of-america.png`, fiatName: 'United States Dollar' }, - EUR: { countryName: 'European Union', logoUrl: `${FLAG_LOGO_URL}/european-union.png`, fiatName: 'Euro' }, - AOA: { countryName: 'ANGOLA', logoUrl: `${FLAG_LOGO_URL}/angola.png`, fiatName: 'Kwanza' }, - XCD: { - countryName: 'SAINT VINCENT AND THE GRENADINES', - logoUrl: `${FLAG_LOGO_URL}/st-vincent-and-the-grenadines.png`, - fiatName: 'East Caribbean Dollar' - }, - '': { countryName: '-', logoUrl: '', fiatName: 'No universal currency' }, - ARS: { countryName: 'ARGENTINA', logoUrl: `${FLAG_LOGO_URL}/argentina.png`, fiatName: 'Argentine Peso' }, - AMD: { countryName: 'ARMENIA', logoUrl: `${FLAG_LOGO_URL}/armenia.png`, fiatName: 'Armenian Dram' }, - AWG: { countryName: 'ARUBA', logoUrl: `${FLAG_LOGO_URL}/aruba.png`, fiatName: 'Aruban Florin' }, - AUD: { countryName: 'TUVALU', logoUrl: `${FLAG_LOGO_URL}/tuvalu.png`, fiatName: 'Australian Dollar' }, - AZN: { countryName: 'AZERBAIJAN', logoUrl: `${FLAG_LOGO_URL}/azerbaijan.png`, fiatName: 'Azerbaijanian Manat' }, - BSD: { countryName: '-', logoUrl: '', fiatName: 'Bahamian Dollar' }, - BHD: { countryName: 'BAHRAIN', logoUrl: `${FLAG_LOGO_URL}/bahrain.png`, fiatName: 'Bahraini Dinar' }, - BDT: { countryName: 'BANGLADESH', logoUrl: `${FLAG_LOGO_URL}/bangladesh.png`, fiatName: 'Taka' }, - BBD: { countryName: 'BARBADOS', logoUrl: `${FLAG_LOGO_URL}/barbados.png`, fiatName: 'Barbados Dollar' }, - BYN: { countryName: 'BELARUS', logoUrl: `${FLAG_LOGO_URL}/belarus.png`, fiatName: 'Belarussian Ruble' }, - BZD: { countryName: 'BELIZE', logoUrl: `${FLAG_LOGO_URL}/belize.png`, fiatName: 'Belize Dollar' }, - XOF: { countryName: 'TOGO', logoUrl: `${FLAG_LOGO_URL}/togo.png`, fiatName: 'CFA Franc BCEAO' }, - BMD: { countryName: 'BERMUDA', logoUrl: `${FLAG_LOGO_URL}/bermuda.png`, fiatName: 'Bermudian Dollar' }, - BTN: { countryName: 'BHUTAN', logoUrl: `${FLAG_LOGO_URL}/bhutan.png`, fiatName: 'Ngultrum' }, - INR: { countryName: 'INDIA', logoUrl: `${FLAG_LOGO_URL}/india.png`, fiatName: 'Indian Rupee' }, - BOB: { countryName: 'BOLIVIA (PLURINATIONAL STATE OF)', logoUrl: `${FLAG_LOGO_URL}/bolivia.png`, fiatName: 'Boliviano' }, - BOV: { countryName: 'BOLIVIA (PLURINATIONAL STATE OF)', logoUrl: `${FLAG_LOGO_URL}/bolivia.png`, fiatName: 'Mvdol' }, - BAM: { countryName: 'BOSNIA AND HERZEGOVINA', logoUrl: `${FLAG_LOGO_URL}/bosnia-and-herzegovina.png`, fiatName: 'Convertible Mark' }, - BWP: { countryName: 'BOTSWANA', logoUrl: `${FLAG_LOGO_URL}/botswana.png`, fiatName: 'Pula' }, - NOK: { countryName: '-', logoUrl: '', fiatName: 'Norwegian Krone' }, - BRL: { countryName: 'BRAZIL', logoUrl: `${FLAG_LOGO_URL}/brazil.png`, fiatName: 'Brazilian Real' }, - BND: { countryName: 'BRUNEI DARUSSALAM', logoUrl: `${FLAG_LOGO_URL}/brunei.png`, fiatName: 'Brunei Dollar' }, - BGN: { countryName: 'BULGARIA', logoUrl: `${FLAG_LOGO_URL}/bulgaria.png`, fiatName: 'Bulgarian Lev' }, - BIF: { countryName: 'BURUNDI', logoUrl: `${FLAG_LOGO_URL}/burundi.png`, fiatName: 'Burundi Franc' }, - CVE: { countryName: 'CABO VERDE', logoUrl: `${FLAG_LOGO_URL}/cape-verde.png`, fiatName: 'Cabo Verde Escudo' }, - KHR: { countryName: 'CAMBODIA', logoUrl: `${FLAG_LOGO_URL}/cambodia.png`, fiatName: 'Riel' }, - XAF: { countryName: 'GABON', logoUrl: `${FLAG_LOGO_URL}/gabon.png`, fiatName: 'CFA Franc BEAC' }, - CAD: { countryName: 'CANADA', logoUrl: `${FLAG_LOGO_URL}/canada.png`, fiatName: 'Canadian Dollar' }, - KYD: { countryName: '-', logoUrl: '', fiatName: 'Cayman Islands Dollar' }, - CLF: { countryName: 'CHILE', logoUrl: `${FLAG_LOGO_URL}/chile.png`, fiatName: 'Unidad de Fomento' }, - CLP: { countryName: 'CHILE', logoUrl: `${FLAG_LOGO_URL}/chile.png`, fiatName: 'Chilean Peso' }, - CNY: { countryName: 'CHINA', logoUrl: `${FLAG_LOGO_URL}/china.png`, fiatName: 'Yuan Renminbi' }, - COP: { countryName: 'COLOMBIA', logoUrl: `${FLAG_LOGO_URL}/colombia.png`, fiatName: 'Colombian Peso' }, - COU: { countryName: 'COLOMBIA', logoUrl: `${FLAG_LOGO_URL}/colombia.png`, fiatName: 'Unidad de Valor Real' }, - KMF: { countryName: '-', logoUrl: '', fiatName: 'Comoro Franc' }, - CDF: { countryName: '-', logoUrl: '', fiatName: 'Congolese Franc' }, - NZD: { countryName: 'TOKELAU', logoUrl: `${FLAG_LOGO_URL}/tokelau.png`, fiatName: 'New Zealand Dollar' }, - CRC: { countryName: 'COSTA RICA', logoUrl: `${FLAG_LOGO_URL}/costa-rica.png`, fiatName: 'Costa Rican Colon' }, - HRK: { countryName: 'CROATIA', logoUrl: `${FLAG_LOGO_URL}/croatia.png`, fiatName: 'Kuna' }, - CUC: { countryName: 'CUBA', logoUrl: `${FLAG_LOGO_URL}/cuba.png`, fiatName: 'Peso Convertible' }, - CUP: { countryName: 'CUBA', logoUrl: `${FLAG_LOGO_URL}/cuba.png`, fiatName: 'Cuban Peso' }, - ANG: { countryName: '-', logoUrl: '', fiatName: 'Netherlands Antillean Guilder' }, - CZK: { countryName: '-', logoUrl: '', fiatName: 'Czech Koruna' }, - DKK: { countryName: 'GREENLAND', logoUrl: `${FLAG_LOGO_URL}/greenland.png`, fiatName: 'Danish Krone' }, - DJF: { countryName: 'DJIBOUTI', logoUrl: `${FLAG_LOGO_URL}/djibouti.png`, fiatName: 'Djibouti Franc' }, - DOP: { countryName: '-', logoUrl: '', fiatName: 'Dominican Peso' }, - EGP: { countryName: 'EGYPT', logoUrl: `${FLAG_LOGO_URL}/egypt.png`, fiatName: 'Egyptian Pound' }, - SVC: { countryName: 'EL SALVADOR', logoUrl: `${FLAG_LOGO_URL}/salvador.png`, fiatName: 'El Salvador Colon' }, - ERN: { countryName: 'ERITREA', logoUrl: `${FLAG_LOGO_URL}/eritrea.png`, fiatName: 'Nakfa' }, - ETB: { countryName: 'ETHIOPIA', logoUrl: `${FLAG_LOGO_URL}/ethiopia.png`, fiatName: 'Ethiopian Birr' }, - FKP: { countryName: '-', logoUrl: '', fiatName: 'Falkland Islands Pound' }, - FJD: { countryName: 'FIJI', logoUrl: `${FLAG_LOGO_URL}/fiji.png`, fiatName: 'Fiji Dollar' }, - XPF: { countryName: '-', logoUrl: '', fiatName: 'CFP Franc' }, - GMD: { countryName: '-', logoUrl: '', fiatName: 'Dalasi' }, - GEL: { countryName: 'GEORGIA', logoUrl: `${FLAG_LOGO_URL}/georgia.png`, fiatName: 'Lari' }, - GHS: { countryName: 'GHANA', logoUrl: `${FLAG_LOGO_URL}/ghana.png`, fiatName: 'Ghana Cedi' }, - GIP: { countryName: 'GIBRALTAR', logoUrl: `${FLAG_LOGO_URL}/gibraltar.png`, fiatName: 'Gibraltar Pound' }, - GTQ: { countryName: 'GUATEMALA', logoUrl: `${FLAG_LOGO_URL}/guatemala.png`, fiatName: 'Quetzal' }, - GBP: { countryName: '-', logoUrl: `${FLAG_LOGO_URL}/united-kingdom.png`, fiatName: 'Pound Sterling' }, - GNF: { countryName: 'GUINEA', logoUrl: `${FLAG_LOGO_URL}/guinea.png`, fiatName: 'Guinea Franc' }, - GYD: { countryName: 'GUYANA', logoUrl: `${FLAG_LOGO_URL}/guyana.png`, fiatName: 'Guyana Dollar' }, - HTG: { countryName: 'HAITI', logoUrl: `${FLAG_LOGO_URL}/haiti.png`, fiatName: 'Gourde' }, - HNL: { countryName: 'HONDURAS', logoUrl: `${FLAG_LOGO_URL}/honduras.png`, fiatName: 'Lempira' }, - HKD: { countryName: 'HONG KONG', logoUrl: `${FLAG_LOGO_URL}/hong-kong.png`, fiatName: 'Hong Kong Dollar' }, - HUF: { countryName: 'HUNGARY', logoUrl: `${FLAG_LOGO_URL}/hungary.png`, fiatName: 'Forint' }, - ISK: { countryName: 'ICELAND', logoUrl: `${FLAG_LOGO_URL}/iceland.png`, fiatName: 'Iceland Krona' }, - IDR: { countryName: 'INDONESIA', logoUrl: `${FLAG_LOGO_URL}/indonesia.png`, fiatName: 'Rupiah' }, - XDR: { countryName: '-', logoUrl: '', fiatName: 'SDR (Special Drawing Right)' }, - IRR: { countryName: 'IRAN (ISLAMIC REPUBLIC OF)', logoUrl: `${FLAG_LOGO_URL}/iran.png`, fiatName: 'Iranian Rial' }, - IQD: { countryName: 'IRAQ', logoUrl: `${FLAG_LOGO_URL}/iraq.png`, fiatName: 'Iraqi Dinar' }, - ILS: { countryName: 'ISRAEL', logoUrl: `${FLAG_LOGO_URL}/israel.png`, fiatName: 'New Israeli Sheqel' }, - JMD: { countryName: 'JAMAICA', logoUrl: `${FLAG_LOGO_URL}/jamaica.png`, fiatName: 'Jamaican Dollar' }, - JPY: { countryName: 'JAPAN', logoUrl: `${FLAG_LOGO_URL}/japan.png`, fiatName: 'Yen' }, - JOD: { countryName: 'JORDAN', logoUrl: `${FLAG_LOGO_URL}/jordan.png`, fiatName: 'Jordanian Dinar' }, - KZT: { countryName: 'KAZAKHSTAN', logoUrl: `${FLAG_LOGO_URL}/kazakhstan.png`, fiatName: 'Tenge' }, - KES: { countryName: 'KENYA', logoUrl: `${FLAG_LOGO_URL}/kenya.png`, fiatName: 'Kenyan Shilling' }, - KPW: { countryName: '-', logoUrl: '', fiatName: 'North Korean Won' }, - KRW: { countryName: '-', logoUrl: '', fiatName: 'Won' }, - KWD: { countryName: 'KUWAIT', logoUrl: `${FLAG_LOGO_URL}/kuwait.png`, fiatName: 'Kuwaiti Dinar' }, - KGS: { countryName: 'KYRGYZSTAN', logoUrl: `${FLAG_LOGO_URL}/kyrgyzstan.png`, fiatName: 'Som' }, - LAK: { countryName: '-', logoUrl: '', fiatName: 'Kip' }, - LBP: { countryName: 'LEBANON', logoUrl: `${FLAG_LOGO_URL}/lebanon.png`, fiatName: 'Lebanese Pound' }, - LSL: { countryName: 'LESOTHO', logoUrl: `${FLAG_LOGO_URL}/lesotho.png`, fiatName: 'Loti' }, - ZAR: { countryName: 'SOUTH AFRICA', logoUrl: `${FLAG_LOGO_URL}/south-africa.png`, fiatName: 'Rand' }, - LRD: { countryName: 'LIBERIA', logoUrl: `${FLAG_LOGO_URL}/liberia.png`, fiatName: 'Liberian Dollar' }, - LYD: { countryName: 'LIBYA', logoUrl: `${FLAG_LOGO_URL}/libya.png`, fiatName: 'Libyan Dinar' }, - CHF: { countryName: 'SWITZERLAND', logoUrl: `${FLAG_LOGO_URL}/switzerland.png`, fiatName: 'Swiss Franc' }, - MOP: { countryName: 'MACAO', logoUrl: `${FLAG_LOGO_URL}/macao.png`, fiatName: 'Pataca' }, - MGA: { countryName: 'MADAGASCAR', logoUrl: `${FLAG_LOGO_URL}/madagascar.png`, fiatName: 'Malagasy Ariary' }, - MWK: { countryName: 'MALAWI', logoUrl: `${FLAG_LOGO_URL}/malawi.png`, fiatName: 'Kwacha' }, - MYR: { countryName: 'MALAYSIA', logoUrl: `${FLAG_LOGO_URL}/malaysia.png`, fiatName: 'Malaysian Ringgit' }, - MVR: { countryName: 'MALDIVES', logoUrl: `${FLAG_LOGO_URL}/maldives.png`, fiatName: 'Rufiyaa' }, - MRU: { countryName: 'MAURITANIA', logoUrl: `${FLAG_LOGO_URL}/mauritania.png`, fiatName: 'Ouguiya' }, - MUR: { countryName: 'MAURITIUS', logoUrl: `${FLAG_LOGO_URL}/mauritius.png`, fiatName: 'Mauritius Rupee' }, - XUA: { countryName: '-', logoUrl: '', fiatName: 'ADB Unit of Account' }, - MXN: { countryName: 'MEXICO', logoUrl: `${FLAG_LOGO_URL}/mexico.png`, fiatName: 'Mexican Peso' }, - MXV: { countryName: 'MEXICO', logoUrl: `${FLAG_LOGO_URL}/mexico.png`, fiatName: 'Mexican Unidad de Inversion (UDI)' }, - MDL: { countryName: '-', logoUrl: '', fiatName: 'Moldovan Leu' }, - MNT: { countryName: 'MONGOLIA', logoUrl: `${FLAG_LOGO_URL}/mongolia.png`, fiatName: 'Tugrik' }, - MAD: { countryName: 'WESTERN SAHARA', logoUrl: `${FLAG_LOGO_URL}/western-sahara.png`, fiatName: 'Moroccan Dirham' }, - MZN: { countryName: 'MOZAMBIQUE', logoUrl: `${FLAG_LOGO_URL}/mozambique.png`, fiatName: 'Mozambique Metical' }, - MMK: { countryName: 'MYANMAR', logoUrl: `${FLAG_LOGO_URL}/myanmar.png`, fiatName: 'Kyat' }, - NAD: { countryName: 'NAMIBIA', logoUrl: `${FLAG_LOGO_URL}/namibia.png`, fiatName: 'Namibia Dollar' }, - NPR: { countryName: 'NEPAL', logoUrl: `${FLAG_LOGO_URL}/nepal.png`, fiatName: 'Nepalese Rupee' }, - NIO: { countryName: 'NICARAGUA', logoUrl: `${FLAG_LOGO_URL}/nicaragua.png`, fiatName: 'Cordoba Oro' }, - NGN: { countryName: 'NIGERIA', logoUrl: `${FLAG_LOGO_URL}/nigeria.png`, fiatName: 'Naira' }, - OMR: { countryName: 'OMAN', logoUrl: `${FLAG_LOGO_URL}/oman.png`, fiatName: 'Rial Omani' }, - PKR: { countryName: 'PAKISTAN', logoUrl: `${FLAG_LOGO_URL}/pakistan.png`, fiatName: 'Pakistan Rupee' }, - PAB: { countryName: 'PANAMA', logoUrl: `${FLAG_LOGO_URL}/panama.png`, fiatName: 'Balboa' }, - PGK: { countryName: 'PAPUA NEW GUINEA', logoUrl: `${FLAG_LOGO_URL}/papua-new-guinea.png`, fiatName: 'Kina' }, - PYG: { countryName: 'PARAGUAY', logoUrl: `${FLAG_LOGO_URL}/paraguay.png`, fiatName: 'Guarani' }, - PEN: { countryName: 'PERU', logoUrl: `${FLAG_LOGO_URL}/peru.png`, fiatName: 'Nuevo Sol' }, - PHP: { countryName: '-', logoUrl: '', fiatName: 'Philippine Peso' }, - PLN: { countryName: 'POLAND', logoUrl: `${FLAG_LOGO_URL}/republic-of-poland.png`, fiatName: 'Zloty' }, - QAR: { countryName: 'QATAR', logoUrl: `${FLAG_LOGO_URL}/qatar.png`, fiatName: 'Qatari Rial' }, - MKD: { countryName: '-', logoUrl: '', fiatName: 'Denar' }, - RON: { countryName: 'ROMANIA', logoUrl: `${FLAG_LOGO_URL}/romania.png`, fiatName: 'Romanian Leu' }, - RUB: { countryName: '-', logoUrl: '', fiatName: 'Russian Ruble' }, - RWF: { countryName: 'RWANDA', logoUrl: `${FLAG_LOGO_URL}/rwanda.png`, fiatName: 'Rwanda Franc' }, - SHP: { countryName: '-', logoUrl: '', fiatName: 'Saint Helena Pound' }, - WST: { countryName: 'SAMOA', logoUrl: `${FLAG_LOGO_URL}/samoa.png`, fiatName: 'Tala' }, - STN: { countryName: 'SAO TOME AND PRINCIPE', logoUrl: `${FLAG_LOGO_URL}/sao-tome-and-principe.png`, fiatName: 'Dobra' }, - SAR: { countryName: 'SAUDI ARABIA', logoUrl: `${FLAG_LOGO_URL}/saudi-arabia.png`, fiatName: 'Saudi Riyal' }, - RSD: { countryName: 'SERBIA', logoUrl: `${FLAG_LOGO_URL}/serbia.png`, fiatName: 'Serbian Dinar' }, - SCR: { countryName: 'SEYCHELLES', logoUrl: `${FLAG_LOGO_URL}/seychelles.png`, fiatName: 'Seychelles Rupee' }, - SLL: { countryName: 'SIERRA LEONE', logoUrl: `${FLAG_LOGO_URL}/sierra-leone.png`, fiatName: 'Leone' }, - SGD: { countryName: 'SINGAPORE', logoUrl: `${FLAG_LOGO_URL}/singapore.png`, fiatName: 'Singapore Dollar' }, - XSU: { countryName: '-', logoUrl: '', fiatName: 'Sucre' }, - SBD: { countryName: 'SOLOMON ISLANDS', logoUrl: `${FLAG_LOGO_URL}/solomon-islands.png`, fiatName: 'Solomon Islands Dollar' }, - SOS: { countryName: 'SOMALIA', logoUrl: `${FLAG_LOGO_URL}/somalia.png`, fiatName: 'Somali Shilling' }, - SSP: { countryName: 'SOUTH SUDAN', logoUrl: `${FLAG_LOGO_URL}/south-sudan.png`, fiatName: 'South Sudanese Pound' }, - LKR: { countryName: 'SRI LANKA', logoUrl: `${FLAG_LOGO_URL}/sri-lanka.png`, fiatName: 'Sri Lanka Rupee' }, - SDG: { countryName: '-', logoUrl: '', fiatName: 'Sudanese Pound' }, - SRD: { countryName: 'SURINAME', logoUrl: `${FLAG_LOGO_URL}/suriname.png`, fiatName: 'Surinam Dollar' }, - SZL: { countryName: '-', logoUrl: '', fiatName: 'Lilangeni' }, - SEK: { countryName: 'SWEDEN', logoUrl: `${FLAG_LOGO_URL}/sweden.png`, fiatName: 'Swedish Krona' }, - CHE: { countryName: 'SWITZERLAND', logoUrl: `${FLAG_LOGO_URL}/switzerland.png`, fiatName: 'WIR Euro' }, - CHW: { countryName: 'SWITZERLAND', logoUrl: `${FLAG_LOGO_URL}/switzerland.png`, fiatName: 'WIR Franc' }, - SYP: { countryName: 'SYRIAN ARAB REPUBLIC', logoUrl: `${FLAG_LOGO_URL}/syria.png`, fiatName: 'Syrian Pound' }, - TWD: { countryName: '-', logoUrl: '', fiatName: 'New Taiwan Dollar' }, - TJS: { countryName: 'TAJIKISTAN', logoUrl: `${FLAG_LOGO_URL}/tajikistan.png`, fiatName: 'Somoni' }, - TZS: { countryName: 'TANZANIA, UNITED REPUBLIC OF', logoUrl: `${FLAG_LOGO_URL}/tanzania.png`, fiatName: 'Tanzanian Shilling' }, - THB: { countryName: 'THAILAND', logoUrl: `${FLAG_LOGO_URL}/thailand.png`, fiatName: 'Baht' }, - TOP: { countryName: 'TONGA', logoUrl: `${FLAG_LOGO_URL}/tonga.png`, fiatName: 'Pa’anga' }, - TTD: { - countryName: 'TRINIDAD AND TOBAGO', - logoUrl: `${FLAG_LOGO_URL}/trinidad-and-tobago.png`, - fiatName: 'Trinidad and Tobago Dollar' - }, - TND: { countryName: 'TUNISIA', logoUrl: `${FLAG_LOGO_URL}/tunisia.png`, fiatName: 'Tunisian Dinar' }, - TRY: { countryName: 'TURKEY', logoUrl: `${FLAG_LOGO_URL}/turkey.png`, fiatName: 'Turkish Lira' }, - TMT: { countryName: 'TURKMENISTAN', logoUrl: `${FLAG_LOGO_URL}/turkmenistan.png`, fiatName: 'Turkmenistan New Manat' }, - UGX: { countryName: 'UGANDA', logoUrl: `${FLAG_LOGO_URL}/uganda.png`, fiatName: 'Uganda Shilling' }, - UAH: { countryName: 'UKRAINE', logoUrl: `${FLAG_LOGO_URL}/ukraine.png`, fiatName: 'Hryvnia' }, - AED: { countryName: '-', logoUrl: '', fiatName: 'UAE Dirham' }, - USN: { countryName: '-', logoUrl: '', fiatName: 'United States Dollar (Next day)' }, - UYI: { countryName: 'URUGUAY', logoUrl: `${FLAG_LOGO_URL}/uruguay.png`, fiatName: 'Uruguay Peso en Unidades Indexadas (URUIURUI)' }, - UYU: { countryName: 'URUGUAY', logoUrl: `${FLAG_LOGO_URL}/uruguay.png`, fiatName: 'Peso Uruguayo' }, - UZS: { countryName: 'UZBEKISTAN', logoUrl: `${FLAG_LOGO_URL}/uzbekistn.png`, fiatName: 'Uzbekistan Sum' }, - VUV: { countryName: 'VANUATU', logoUrl: `${FLAG_LOGO_URL}/vanuatu.png`, fiatName: 'Vatu' }, - VEF: { countryName: 'VENEZUELA (BOLIVARIAN REPUBLIC OF)', logoUrl: `${FLAG_LOGO_URL}/venezuela.png`, fiatName: 'Bolivar' }, - VND: { countryName: 'VIET NAM', logoUrl: `${FLAG_LOGO_URL}/vietnam.png`, fiatName: 'Dong' }, - YER: { countryName: 'YEMEN', logoUrl: `${FLAG_LOGO_URL}/yemen.png`, fiatName: 'Yemeni Rial' }, - ZMW: { countryName: 'ZAMBIA', logoUrl: `${FLAG_LOGO_URL}/zambia.png`, fiatName: 'Zambian Kwacha' }, - ZWL: { countryName: 'ZIMBABWE', logoUrl: `${FLAG_LOGO_URL}/zimbabwe.png`, fiatName: 'Zimbabwe Dollar' } +export const FIAT_COUNTRY: { [string]: { countryName: string, logoUrl: string } } = { + AFN: { countryName: 'AFGHANISTAN', logoUrl: `${FLAG_LOGO_URL}/afghanistan.png` }, + ALL: { countryName: 'ALBANIA', logoUrl: `${FLAG_LOGO_URL}/albania.png` }, + DZD: { countryName: 'ALGERIA', logoUrl: `${FLAG_LOGO_URL}/algeria.png` }, + USD: { countryName: 'United States of America', logoUrl: `${FLAG_LOGO_URL}/united-states-of-america.png` }, + EUR: { countryName: 'European Union', logoUrl: `${FLAG_LOGO_URL}/european-union.png` }, + AOA: { countryName: 'ANGOLA', logoUrl: `${FLAG_LOGO_URL}/angola.png` }, + XCD: { countryName: 'SAINT VINCENT AND THE GRENADINES', logoUrl: `${FLAG_LOGO_URL}/st-vincent-and-the-grenadines.png` }, + '': { countryName: '-', logoUrl: '' }, + ARS: { countryName: 'ARGENTINA', logoUrl: `${FLAG_LOGO_URL}/argentina.png` }, + AMD: { countryName: 'ARMENIA', logoUrl: `${FLAG_LOGO_URL}/armenia.png` }, + AWG: { countryName: 'ARUBA', logoUrl: `${FLAG_LOGO_URL}/aruba.png` }, + AUD: { countryName: 'TUVALU', logoUrl: `${FLAG_LOGO_URL}/tuvalu.png` }, + AZN: { countryName: 'AZERBAIJAN', logoUrl: `${FLAG_LOGO_URL}/azerbaijan.png` }, + BSD: { countryName: '-', logoUrl: '' }, + BHD: { countryName: 'BAHRAIN', logoUrl: `${FLAG_LOGO_URL}/bahrain.png` }, + BDT: { countryName: 'BANGLADESH', logoUrl: `${FLAG_LOGO_URL}/bangladesh.png` }, + BBD: { countryName: 'BARBADOS', logoUrl: `${FLAG_LOGO_URL}/barbados.png` }, + BYN: { countryName: 'BELARUS', logoUrl: `${FLAG_LOGO_URL}/belarus.png` }, + BZD: { countryName: 'BELIZE', logoUrl: `${FLAG_LOGO_URL}/belize.png` }, + XOF: { countryName: 'TOGO', logoUrl: `${FLAG_LOGO_URL}/togo.png` }, + BMD: { countryName: 'BERMUDA', logoUrl: `${FLAG_LOGO_URL}/bermuda.png` }, + BTN: { countryName: 'BHUTAN', logoUrl: `${FLAG_LOGO_URL}/bhutan.png` }, + INR: { countryName: 'INDIA', logoUrl: `${FLAG_LOGO_URL}/india.png` }, + BOB: { countryName: 'BOLIVIA (PLURINATIONAL STATE OF)', logoUrl: `${FLAG_LOGO_URL}/bolivia.png` }, + BOV: { countryName: 'BOLIVIA (PLURINATIONAL STATE OF)', logoUrl: `${FLAG_LOGO_URL}/bolivia.png` }, + BAM: { countryName: 'BOSNIA AND HERZEGOVINA', logoUrl: `${FLAG_LOGO_URL}/bosnia-and-herzegovina.png` }, + BWP: { countryName: 'BOTSWANA', logoUrl: `${FLAG_LOGO_URL}/botswana.png` }, + NOK: { countryName: '-', logoUrl: '' }, + BRL: { countryName: 'BRAZIL', logoUrl: `${FLAG_LOGO_URL}/brazil.png` }, + BND: { countryName: 'BRUNEI DARUSSALAM', logoUrl: `${FLAG_LOGO_URL}/brunei.png` }, + BGN: { countryName: 'BULGARIA', logoUrl: `${FLAG_LOGO_URL}/bulgaria.png` }, + BIF: { countryName: 'BURUNDI', logoUrl: `${FLAG_LOGO_URL}/burundi.png` }, + CVE: { countryName: 'CABO VERDE', logoUrl: `${FLAG_LOGO_URL}/cape-verde.png` }, + KHR: { countryName: 'CAMBODIA', logoUrl: `${FLAG_LOGO_URL}/cambodia.png` }, + XAF: { countryName: 'GABON', logoUrl: `${FLAG_LOGO_URL}/gabon.png` }, + CAD: { countryName: 'CANADA', logoUrl: `${FLAG_LOGO_URL}/canada.png` }, + KYD: { countryName: '-', logoUrl: '' }, + CLF: { countryName: 'CHILE', logoUrl: `${FLAG_LOGO_URL}/chile.png` }, + CLP: { countryName: 'CHILE', logoUrl: `${FLAG_LOGO_URL}/chile.png` }, + CNY: { countryName: 'CHINA', logoUrl: `${FLAG_LOGO_URL}/china.png` }, + COP: { countryName: 'COLOMBIA', logoUrl: `${FLAG_LOGO_URL}/colombia.png` }, + COU: { countryName: 'COLOMBIA', logoUrl: `${FLAG_LOGO_URL}/colombia.png` }, + KMF: { countryName: '-', logoUrl: '' }, + CDF: { countryName: '-', logoUrl: '' }, + NZD: { countryName: 'TOKELAU', logoUrl: `${FLAG_LOGO_URL}/tokelau.png` }, + CRC: { countryName: 'COSTA RICA', logoUrl: `${FLAG_LOGO_URL}/costa-rica.png` }, + HRK: { countryName: 'CROATIA', logoUrl: `${FLAG_LOGO_URL}/croatia.png` }, + CUC: { countryName: 'CUBA', logoUrl: `${FLAG_LOGO_URL}/cuba.png` }, + CUP: { countryName: 'CUBA', logoUrl: `${FLAG_LOGO_URL}/cuba.png` }, + ANG: { countryName: '-', logoUrl: '' }, + CZK: { countryName: '-', logoUrl: '' }, + DKK: { countryName: 'GREENLAND', logoUrl: `${FLAG_LOGO_URL}/greenland.png` }, + DJF: { countryName: 'DJIBOUTI', logoUrl: `${FLAG_LOGO_URL}/djibouti.png` }, + DOP: { countryName: '-', logoUrl: '' }, + EGP: { countryName: 'EGYPT', logoUrl: `${FLAG_LOGO_URL}/egypt.png` }, + SVC: { countryName: 'EL SALVADOR', logoUrl: `${FLAG_LOGO_URL}/salvador.png` }, + ERN: { countryName: 'ERITREA', logoUrl: `${FLAG_LOGO_URL}/eritrea.png` }, + ETB: { countryName: 'ETHIOPIA', logoUrl: `${FLAG_LOGO_URL}/ethiopia.png` }, + FKP: { countryName: '-', logoUrl: '' }, + FJD: { countryName: 'FIJI', logoUrl: `${FLAG_LOGO_URL}/fiji.png` }, + XPF: { countryName: '-', logoUrl: '' }, + GMD: { countryName: '-', logoUrl: '' }, + GEL: { countryName: 'GEORGIA', logoUrl: `${FLAG_LOGO_URL}/georgia.png` }, + GHS: { countryName: 'GHANA', logoUrl: `${FLAG_LOGO_URL}/ghana.png` }, + GIP: { countryName: 'GIBRALTAR', logoUrl: `${FLAG_LOGO_URL}/gibraltar.png` }, + GTQ: { countryName: 'GUATEMALA', logoUrl: `${FLAG_LOGO_URL}/guatemala.png` }, + GBP: { countryName: '-', logoUrl: `${FLAG_LOGO_URL}/united-kingdom.png` }, + GNF: { countryName: 'GUINEA', logoUrl: `${FLAG_LOGO_URL}/guinea.png` }, + GYD: { countryName: 'GUYANA', logoUrl: `${FLAG_LOGO_URL}/guyana.png` }, + HTG: { countryName: 'HAITI', logoUrl: `${FLAG_LOGO_URL}/haiti.png` }, + HNL: { countryName: 'HONDURAS', logoUrl: `${FLAG_LOGO_URL}/honduras.png` }, + HKD: { countryName: 'HONG KONG', logoUrl: `${FLAG_LOGO_URL}/hong-kong.png` }, + HUF: { countryName: 'HUNGARY', logoUrl: `${FLAG_LOGO_URL}/hungary.png` }, + ISK: { countryName: 'ICELAND', logoUrl: `${FLAG_LOGO_URL}/iceland.png` }, + IDR: { countryName: 'INDONESIA', logoUrl: `${FLAG_LOGO_URL}/indonesia.png` }, + XDR: { countryName: '-', logoUrl: '' }, + IRR: { countryName: 'IRAN (ISLAMIC REPUBLIC OF)', logoUrl: `${FLAG_LOGO_URL}/iran.png` }, + IQD: { countryName: 'IRAQ', logoUrl: `${FLAG_LOGO_URL}/iraq.png` }, + ILS: { countryName: 'ISRAEL', logoUrl: `${FLAG_LOGO_URL}/israel.png` }, + JMD: { countryName: 'JAMAICA', logoUrl: `${FLAG_LOGO_URL}/jamaica.png` }, + JPY: { countryName: 'JAPAN', logoUrl: `${FLAG_LOGO_URL}/japan.png` }, + JOD: { countryName: 'JORDAN', logoUrl: `${FLAG_LOGO_URL}/jordan.png` }, + KZT: { countryName: 'KAZAKHSTAN', logoUrl: `${FLAG_LOGO_URL}/kazakhstan.png` }, + KES: { countryName: 'KENYA', logoUrl: `${FLAG_LOGO_URL}/kenya.png` }, + KPW: { countryName: '-', logoUrl: '' }, + KRW: { countryName: '-', logoUrl: '' }, + KWD: { countryName: 'KUWAIT', logoUrl: `${FLAG_LOGO_URL}/kuwait.png` }, + KGS: { countryName: 'KYRGYZSTAN', logoUrl: `${FLAG_LOGO_URL}/kyrgyzstan.png` }, + LAK: { countryName: '-', logoUrl: '' }, + LBP: { countryName: 'LEBANON', logoUrl: `${FLAG_LOGO_URL}/lebanon.png` }, + LSL: { countryName: 'LESOTHO', logoUrl: `${FLAG_LOGO_URL}/lesotho.png` }, + ZAR: { countryName: 'SOUTH AFRICA', logoUrl: `${FLAG_LOGO_URL}/south-africa.png` }, + LRD: { countryName: 'LIBERIA', logoUrl: `${FLAG_LOGO_URL}/liberia.png` }, + LYD: { countryName: 'LIBYA', logoUrl: `${FLAG_LOGO_URL}/libya.png` }, + CHF: { countryName: 'SWITZERLAND', logoUrl: `${FLAG_LOGO_URL}/switzerland.png` }, + MOP: { countryName: 'MACAO', logoUrl: `${FLAG_LOGO_URL}/macao.png` }, + MGA: { countryName: 'MADAGASCAR', logoUrl: `${FLAG_LOGO_URL}/madagascar.png` }, + MWK: { countryName: 'MALAWI', logoUrl: `${FLAG_LOGO_URL}/malawi.png` }, + MYR: { countryName: 'MALAYSIA', logoUrl: `${FLAG_LOGO_URL}/malaysia.png` }, + MVR: { countryName: 'MALDIVES', logoUrl: `${FLAG_LOGO_URL}/maldives.png` }, + MRU: { countryName: 'MAURITANIA', logoUrl: `${FLAG_LOGO_URL}/mauritania.png` }, + MUR: { countryName: 'MAURITIUS', logoUrl: `${FLAG_LOGO_URL}/mauritius.png` }, + XUA: { countryName: '-', logoUrl: '' }, + MXN: { countryName: 'MEXICO', logoUrl: `${FLAG_LOGO_URL}/mexico.png` }, + MXV: { countryName: 'MEXICO', logoUrl: `${FLAG_LOGO_URL}/mexico.png` }, + MDL: { countryName: '-', logoUrl: '' }, + MNT: { countryName: 'MONGOLIA', logoUrl: `${FLAG_LOGO_URL}/mongolia.png` }, + MAD: { countryName: 'WESTERN SAHARA', logoUrl: `${FLAG_LOGO_URL}/western-sahara.png` }, + MZN: { countryName: 'MOZAMBIQUE', logoUrl: `${FLAG_LOGO_URL}/mozambique.png` }, + MMK: { countryName: 'MYANMAR', logoUrl: `${FLAG_LOGO_URL}/myanmar.png` }, + NAD: { countryName: 'NAMIBIA', logoUrl: `${FLAG_LOGO_URL}/namibia.png` }, + NPR: { countryName: 'NEPAL', logoUrl: `${FLAG_LOGO_URL}/nepal.png` }, + NIO: { countryName: 'NICARAGUA', logoUrl: `${FLAG_LOGO_URL}/nicaragua.png` }, + NGN: { countryName: 'NIGERIA', logoUrl: `${FLAG_LOGO_URL}/nigeria.png` }, + OMR: { countryName: 'OMAN', logoUrl: `${FLAG_LOGO_URL}/oman.png` }, + PKR: { countryName: 'PAKISTAN', logoUrl: `${FLAG_LOGO_URL}/pakistan.png` }, + PAB: { countryName: 'PANAMA', logoUrl: `${FLAG_LOGO_URL}/panama.png` }, + PGK: { countryName: 'PAPUA NEW GUINEA', logoUrl: `${FLAG_LOGO_URL}/papua-new-guinea.png` }, + PYG: { countryName: 'PARAGUAY', logoUrl: `${FLAG_LOGO_URL}/paraguay.png` }, + PEN: { countryName: 'PERU', logoUrl: `${FLAG_LOGO_URL}/peru.png` }, + PHP: { countryName: '-', logoUrl: '' }, + PLN: { countryName: 'POLAND', logoUrl: `${FLAG_LOGO_URL}/republic-of-poland.png` }, + QAR: { countryName: 'QATAR', logoUrl: `${FLAG_LOGO_URL}/qatar.png` }, + MKD: { countryName: '-', logoUrl: '' }, + RON: { countryName: 'ROMANIA', logoUrl: `${FLAG_LOGO_URL}/romania.png` }, + RUB: { countryName: '-', logoUrl: '' }, + RWF: { countryName: 'RWANDA', logoUrl: `${FLAG_LOGO_URL}/rwanda.png` }, + SHP: { countryName: '-', logoUrl: '' }, + WST: { countryName: 'SAMOA', logoUrl: `${FLAG_LOGO_URL}/samoa.png` }, + STN: { countryName: 'SAO TOME AND PRINCIPE', logoUrl: `${FLAG_LOGO_URL}/sao-tome-and-principe.png` }, + SAR: { countryName: 'SAUDI ARABIA', logoUrl: `${FLAG_LOGO_URL}/saudi-arabia.png` }, + RSD: { countryName: 'SERBIA', logoUrl: `${FLAG_LOGO_URL}/serbia.png` }, + SCR: { countryName: 'SEYCHELLES', logoUrl: `${FLAG_LOGO_URL}/seychelles.png` }, + SLL: { countryName: 'SIERRA LEONE', logoUrl: `${FLAG_LOGO_URL}/sierra-leone.png` }, + SGD: { countryName: 'SINGAPORE', logoUrl: `${FLAG_LOGO_URL}/singapore.png` }, + XSU: { countryName: '-', logoUrl: '' }, + SBD: { countryName: 'SOLOMON ISLANDS', logoUrl: `${FLAG_LOGO_URL}/solomon-islands.png` }, + SOS: { countryName: 'SOMALIA', logoUrl: `${FLAG_LOGO_URL}/somalia.png` }, + SSP: { countryName: 'SOUTH SUDAN', logoUrl: `${FLAG_LOGO_URL}/south-sudan.png` }, + LKR: { countryName: 'SRI LANKA', logoUrl: `${FLAG_LOGO_URL}/sri-lanka.png` }, + SDG: { countryName: '-', logoUrl: '' }, + SRD: { countryName: 'SURINAME', logoUrl: `${FLAG_LOGO_URL}/suriname.png` }, + SZL: { countryName: '-', logoUrl: '' }, + SEK: { countryName: 'SWEDEN', logoUrl: `${FLAG_LOGO_URL}/sweden.png` }, + CHE: { countryName: 'SWITZERLAND', logoUrl: `${FLAG_LOGO_URL}/switzerland.png` }, + CHW: { countryName: 'SWITZERLAND', logoUrl: `${FLAG_LOGO_URL}/switzerland.png` }, + SYP: { countryName: 'SYRIAN ARAB REPUBLIC', logoUrl: `${FLAG_LOGO_URL}/syria.png` }, + TWD: { countryName: '-', logoUrl: '' }, + TJS: { countryName: 'TAJIKISTAN', logoUrl: `${FLAG_LOGO_URL}/tajikistan.png` }, + TZS: { countryName: 'TANZANIA, UNITED REPUBLIC OF', logoUrl: `${FLAG_LOGO_URL}/tanzania.png` }, + THB: { countryName: 'THAILAND', logoUrl: `${FLAG_LOGO_URL}/thailand.png` }, + TOP: { countryName: 'TONGA', logoUrl: `${FLAG_LOGO_URL}/tonga.png` }, + TTD: { countryName: 'TRINIDAD AND TOBAGO', logoUrl: `${FLAG_LOGO_URL}/trinidad-and-tobago.png` }, + TND: { countryName: 'TUNISIA', logoUrl: `${FLAG_LOGO_URL}/tunisia.png` }, + TRY: { countryName: 'TURKEY', logoUrl: `${FLAG_LOGO_URL}/turkey.png` }, + TMT: { countryName: 'TURKMENISTAN', logoUrl: `${FLAG_LOGO_URL}/turkmenistan.png` }, + UGX: { countryName: 'UGANDA', logoUrl: `${FLAG_LOGO_URL}/uganda.png` }, + UAH: { countryName: 'UKRAINE', logoUrl: `${FLAG_LOGO_URL}/ukraine.png` }, + AED: { countryName: '-', logoUrl: '' }, + USN: { countryName: '-', logoUrl: '' }, + UYI: { countryName: 'URUGUAY', logoUrl: `${FLAG_LOGO_URL}/uruguay.png` }, + UYU: { countryName: 'URUGUAY', logoUrl: `${FLAG_LOGO_URL}/uruguay.png` }, + UZS: { countryName: 'UZBEKISTAN', logoUrl: `${FLAG_LOGO_URL}/uzbekistn.png` }, + VUV: { countryName: 'VANUATU', logoUrl: `${FLAG_LOGO_URL}/vanuatu.png` }, + VEF: { countryName: 'VENEZUELA (BOLIVARIAN REPUBLIC OF)', logoUrl: `${FLAG_LOGO_URL}/venezuela.png` }, + VND: { countryName: 'VIET NAM', logoUrl: `${FLAG_LOGO_URL}/vietnam.png` }, + YER: { countryName: 'YEMEN', logoUrl: `${FLAG_LOGO_URL}/yemen.png` }, + ZMW: { countryName: 'ZAMBIA', logoUrl: `${FLAG_LOGO_URL}/zambia.png` }, + ZWL: { countryName: 'ZIMBABWE', logoUrl: `${FLAG_LOGO_URL}/zimbabwe.png` } } // utility for recreating list from https://raw.githubusercontent.com/lukes/ISO-3166-Countries-with-Regional-Codes/master/all/all.json diff --git a/src/locales/en_US.js b/src/locales/en_US.js index 61c76004525..471db4b0ae7 100644 --- a/src/locales/en_US.js +++ b/src/locales/en_US.js @@ -783,7 +783,178 @@ const strings = { send_scene_metadata_name_title: 'Payee', // Request Scene - request_balance: 'You have %s' + request_balance: 'You have %s', + + // Currency Labels + currency_label_AFN: 'Afghani', + currency_label_ALL: 'Lek', + currency_label_DZD: 'Algerian Dinar', + currency_label_USD: 'United States Dollar', + currency_label_EUR: 'Euro', + currency_label_AOA: 'Kwanza', + currency_label_XCD: 'East Caribbean Dollar', + currency_label_: 'No universal currency', + currency_label_ARS: 'Argentine Peso', + currency_label_AMD: 'Armenian Dram', + currency_label_AWG: 'Aruban Florin', + currency_label_AUD: 'Australian Dollar', + currency_label_AZN: 'Azerbaijanian Manat', + currency_label_BSD: 'Bahamian Dollar', + currency_label_BHD: 'Bahraini Dinar', + currency_label_BDT: 'Taka', + currency_label_BBD: 'Barbados Dollar', + currency_label_BYN: 'Belarussian Ruble', + currency_label_BZD: 'Belize Dollar', + currency_label_XOF: 'CFA Franc BCEAO', + currency_label_BMD: 'Bermudian Dollar', + currency_label_BTN: 'Ngultrum', + currency_label_INR: 'Indian Rupee', + currency_label_BOB: 'Boliviano', + currency_label_BOV: 'Mvdol', + currency_label_BAM: 'Convertible Mark', + currency_label_BWP: 'Pula', + currency_label_NOK: 'Norwegian Krone', + currency_label_BRL: 'Brazilian Real', + currency_label_BND: 'Brunei Dollar', + currency_label_BGN: 'Bulgarian Lev', + currency_label_BIF: 'Burundi Franc', + currency_label_CVE: 'Cabo Verde Escudo', + currency_label_KHR: 'Riel', + currency_label_XAF: 'CFA Franc BEAC', + currency_label_CAD: 'Canadian Dollar', + currency_label_KYD: 'Cayman Islands Dollar', + currency_label_CLF: 'Unidad de Fomento', + currency_label_CLP: 'Chilean Peso', + currency_label_CNY: 'Yuan Renminbi', + currency_label_COP: 'Colombian Peso', + currency_label_COU: 'Unidad de Valor Real', + currency_label_KMF: 'Comoro Franc', + currency_label_CDF: 'Congolese Franc', + currency_label_NZD: 'New Zealand Dollar', + currency_label_CRC: 'Costa Rican Colon', + currency_label_HRK: 'Kuna', + currency_label_CUC: 'Peso Convertible', + currency_label_CUP: 'Cuban Peso', + currency_label_ANG: 'Netherlands Antillean Guilder', + currency_label_CZK: 'Czech Koruna', + currency_label_DKK: 'Danish Krone', + currency_label_DJF: 'Djibouti Franc', + currency_label_DOP: 'Dominican Peso', + currency_label_EGP: 'Egyptian Pound', + currency_label_SVC: 'El Salvador Colon', + currency_label_ERN: 'Nakfa', + currency_label_ETB: 'Ethiopian Birr', + currency_label_FKP: 'Falkland Islands Pound', + currency_label_FJD: 'Fiji Dollar', + currency_label_XPF: 'CFP Franc', + currency_label_GMD: 'Dalasi', + currency_label_GEL: 'Lari', + currency_label_GHS: 'Ghana Cedi', + currency_label_GIP: 'Gibraltar Pound', + currency_label_GTQ: 'Quetzal', + currency_label_GBP: 'Pound Sterling', + currency_label_GNF: 'Guinea Franc', + currency_label_GYD: 'Guyana Dollar', + currency_label_HTG: 'Gourde', + currency_label_HNL: 'Lempira', + currency_label_HKD: 'Hong Kong Dollar', + currency_label_HUF: 'Forint', + currency_label_ISK: 'Iceland Krona', + currency_label_IDR: 'Rupiah', + currency_label_XDR: 'SDR (Special Drawing Right)', + currency_label_IRR: 'Iranian Rial', + currency_label_IQD: 'Iraqi Dinar', + currency_label_ILS: 'New Israeli Sheqel', + currency_label_JMD: 'Jamaican Dollar', + currency_label_JPY: 'Yen', + currency_label_JOD: 'Jordanian Dinar', + currency_label_KZT: 'Tenge', + currency_label_KES: 'Kenyan Shilling', + currency_label_KPW: 'North Korean Won', + currency_label_KRW: 'Won', + currency_label_KWD: 'Kuwaiti Dinar', + currency_label_KGS: 'Som', + currency_label_LAK: 'Kip', + currency_label_LBP: 'Lebanese Pound', + currency_label_LSL: 'Loti', + currency_label_ZAR: 'Rand', + currency_label_LRD: 'Liberian Dollar', + currency_label_LYD: 'Libyan Dinar', + currency_label_CHF: 'Swiss Franc', + currency_label_MOP: 'Pataca', + currency_label_MGA: 'Malagasy Ariary', + currency_label_MWK: 'Kwacha', + currency_label_MYR: 'Malaysian Ringgit', + currency_label_MVR: 'Rufiyaa', + currency_label_MRU: 'Ouguiya', + currency_label_MUR: 'Mauritius Rupee', + currency_label_XUA: 'ADB Unit of Account', + currency_label_MXN: 'Mexican Peso', + currency_label_MXV: 'Mexican Unidad de Inversion (UDI)', + currency_label_MDL: 'Moldovan Leu', + currency_label_MNT: 'Tugrik', + currency_label_MAD: 'Moroccan Dirham', + currency_label_MZN: 'Mozambique Metical', + currency_label_MMK: 'Kyat', + currency_label_NAD: 'Namibia Dollar', + currency_label_NPR: 'Nepalese Rupee', + currency_label_NIO: 'Cordoba Oro', + currency_label_NGN: 'Naira', + currency_label_OMR: 'Rial Omani', + currency_label_PKR: 'Pakistan Rupee', + currency_label_PAB: 'Balboa', + currency_label_PGK: 'Kina', + currency_label_PYG: 'Guarani', + currency_label_PEN: 'Nuevo Sol', + currency_label_PHP: 'Philippine Peso', + currency_label_PLN: 'Zloty', + currency_label_QAR: 'Qatari Rial', + currency_label_MKD: 'Denar', + currency_label_RON: 'Romanian Leu', + currency_label_RUB: 'Russian Ruble', + currency_label_RWF: 'Rwanda Franc', + currency_label_SHP: 'Saint Helena Pound', + currency_label_WST: 'Tala', + currency_label_STN: 'Dobra', + currency_label_SAR: 'Saudi Riyal', + currency_label_RSD: 'Serbian Dinar', + currency_label_SCR: 'Seychelles Rupee', + currency_label_SLL: 'Leone', + currency_label_SGD: 'Singapore Dollar', + currency_label_XSU: 'Sucre', + currency_label_SBD: 'Solomon Islands Dollar', + currency_label_SOS: 'Somali Shilling', + currency_label_SSP: 'South Sudanese Pound', + currency_label_LKR: 'Sri Lanka Rupee', + currency_label_SDG: 'Sudanese Pound', + currency_label_SRD: 'Surinam Dollar', + currency_label_SZL: 'Lilangeni', + currency_label_SEK: 'Swedish Krona', + currency_label_CHE: 'WIR Euro', + currency_label_CHW: 'WIR Franc', + currency_label_SYP: 'Syrian Pound', + currency_label_TWD: 'New Taiwan Dollar', + currency_label_TJS: 'Somoni', + currency_label_TZS: 'Tanzanian Shilling', + currency_label_THB: 'Baht', + currency_label_TOP: 'Pa’anga', + currency_label_TTD: 'Trinidad and Tobago Dollar', + currency_label_TND: 'Tunisian Dinar', + currency_label_TRY: 'Turkish Lira', + currency_label_TMT: 'Turkmenistan New Manat', + currency_label_UGX: 'Uganda Shilling', + currency_label_UAH: 'Hryvnia', + currency_label_AED: 'UAE Dirham', + currency_label_USN: 'United States Dollar (Next day)', + currency_label_UYI: 'Uruguay Peso en Unidades Indexadas (URUIURUI)', + currency_label_UYU: 'Peso Uruguayo', + currency_label_UZS: 'Uzbekistan Sum', + currency_label_VUV: 'Vatu', + currency_label_VEF: 'Bolivar', + currency_label_VND: 'Dong', + currency_label_YER: 'Yemeni Rial', + currency_label_ZMW: 'Zambian Kwacha', + currency_label_ZWL: 'Zimbabwe Dollar' } // export default strings diff --git a/src/locales/strings/enUS.json b/src/locales/strings/enUS.json index b3290a71fe4..d0bb2b71fe2 100644 --- a/src/locales/strings/enUS.json +++ b/src/locales/strings/enUS.json @@ -720,5 +720,174 @@ "send_scene_send_to_address": "Send to Address", "send_scene_error_title": "Error", "send_scene_metadata_name_title": "Payee", - "request_balance": "You have %s" + "request_balance": "You have %s", + "currency_label_AFN": "Afghani", + "currency_label_ALL": "Lek", + "currency_label_DZD": "Algerian Dinar", + "currency_label_USD": "United States Dollar", + "currency_label_EUR": "Euro", + "currency_label_AOA": "Kwanza", + "currency_label_XCD": "East Caribbean Dollar", + "currency_label_": "No universal currency", + "currency_label_ARS": "Argentine Peso", + "currency_label_AMD": "Armenian Dram", + "currency_label_AWG": "Aruban Florin", + "currency_label_AUD": "Australian Dollar", + "currency_label_AZN": "Azerbaijanian Manat", + "currency_label_BSD": "Bahamian Dollar", + "currency_label_BHD": "Bahraini Dinar", + "currency_label_BDT": "Taka", + "currency_label_BBD": "Barbados Dollar", + "currency_label_BYN": "Belarussian Ruble", + "currency_label_BZD": "Belize Dollar", + "currency_label_XOF": "CFA Franc BCEAO", + "currency_label_BMD": "Bermudian Dollar", + "currency_label_BTN": "Ngultrum", + "currency_label_INR": "Indian Rupee", + "currency_label_BOB": "Boliviano", + "currency_label_BOV": "Mvdol", + "currency_label_BAM": "Convertible Mark", + "currency_label_BWP": "Pula", + "currency_label_NOK": "Norwegian Krone", + "currency_label_BRL": "Brazilian Real", + "currency_label_BND": "Brunei Dollar", + "currency_label_BGN": "Bulgarian Lev", + "currency_label_BIF": "Burundi Franc", + "currency_label_CVE": "Cabo Verde Escudo", + "currency_label_KHR": "Riel", + "currency_label_XAF": "CFA Franc BEAC", + "currency_label_CAD": "Canadian Dollar", + "currency_label_KYD": "Cayman Islands Dollar", + "currency_label_CLF": "Unidad de Fomento", + "currency_label_CLP": "Chilean Peso", + "currency_label_CNY": "Yuan Renminbi", + "currency_label_COP": "Colombian Peso", + "currency_label_COU": "Unidad de Valor Real", + "currency_label_KMF": "Comoro Franc", + "currency_label_CDF": "Congolese Franc", + "currency_label_NZD": "New Zealand Dollar", + "currency_label_CRC": "Costa Rican Colon", + "currency_label_HRK": "Kuna", + "currency_label_CUC": "Peso Convertible", + "currency_label_CUP": "Cuban Peso", + "currency_label_ANG": "Netherlands Antillean Guilder", + "currency_label_CZK": "Czech Koruna", + "currency_label_DKK": "Danish Krone", + "currency_label_DJF": "Djibouti Franc", + "currency_label_DOP": "Dominican Peso", + "currency_label_EGP": "Egyptian Pound", + "currency_label_SVC": "El Salvador Colon", + "currency_label_ERN": "Nakfa", + "currency_label_ETB": "Ethiopian Birr", + "currency_label_FKP": "Falkland Islands Pound", + "currency_label_FJD": "Fiji Dollar", + "currency_label_XPF": "CFP Franc", + "currency_label_GMD": "Dalasi", + "currency_label_GEL": "Lari", + "currency_label_GHS": "Ghana Cedi", + "currency_label_GIP": "Gibraltar Pound", + "currency_label_GTQ": "Quetzal", + "currency_label_GBP": "Pound Sterling", + "currency_label_GNF": "Guinea Franc", + "currency_label_GYD": "Guyana Dollar", + "currency_label_HTG": "Gourde", + "currency_label_HNL": "Lempira", + "currency_label_HKD": "Hong Kong Dollar", + "currency_label_HUF": "Forint", + "currency_label_ISK": "Iceland Krona", + "currency_label_IDR": "Rupiah", + "currency_label_XDR": "SDR (Special Drawing Right)", + "currency_label_IRR": "Iranian Rial", + "currency_label_IQD": "Iraqi Dinar", + "currency_label_ILS": "New Israeli Sheqel", + "currency_label_JMD": "Jamaican Dollar", + "currency_label_JPY": "Yen", + "currency_label_JOD": "Jordanian Dinar", + "currency_label_KZT": "Tenge", + "currency_label_KES": "Kenyan Shilling", + "currency_label_KPW": "North Korean Won", + "currency_label_KRW": "Won", + "currency_label_KWD": "Kuwaiti Dinar", + "currency_label_KGS": "Som", + "currency_label_LAK": "Kip", + "currency_label_LBP": "Lebanese Pound", + "currency_label_LSL": "Loti", + "currency_label_ZAR": "Rand", + "currency_label_LRD": "Liberian Dollar", + "currency_label_LYD": "Libyan Dinar", + "currency_label_CHF": "Swiss Franc", + "currency_label_MOP": "Pataca", + "currency_label_MGA": "Malagasy Ariary", + "currency_label_MWK": "Kwacha", + "currency_label_MYR": "Malaysian Ringgit", + "currency_label_MVR": "Rufiyaa", + "currency_label_MRU": "Ouguiya", + "currency_label_MUR": "Mauritius Rupee", + "currency_label_XUA": "ADB Unit of Account", + "currency_label_MXN": "Mexican Peso", + "currency_label_MXV": "Mexican Unidad de Inversion (UDI)", + "currency_label_MDL": "Moldovan Leu", + "currency_label_MNT": "Tugrik", + "currency_label_MAD": "Moroccan Dirham", + "currency_label_MZN": "Mozambique Metical", + "currency_label_MMK": "Kyat", + "currency_label_NAD": "Namibia Dollar", + "currency_label_NPR": "Nepalese Rupee", + "currency_label_NIO": "Cordoba Oro", + "currency_label_NGN": "Naira", + "currency_label_OMR": "Rial Omani", + "currency_label_PKR": "Pakistan Rupee", + "currency_label_PAB": "Balboa", + "currency_label_PGK": "Kina", + "currency_label_PYG": "Guarani", + "currency_label_PEN": "Nuevo Sol", + "currency_label_PHP": "Philippine Peso", + "currency_label_PLN": "Zloty", + "currency_label_QAR": "Qatari Rial", + "currency_label_MKD": "Denar", + "currency_label_RON": "Romanian Leu", + "currency_label_RUB": "Russian Ruble", + "currency_label_RWF": "Rwanda Franc", + "currency_label_SHP": "Saint Helena Pound", + "currency_label_WST": "Tala", + "currency_label_STN": "Dobra", + "currency_label_SAR": "Saudi Riyal", + "currency_label_RSD": "Serbian Dinar", + "currency_label_SCR": "Seychelles Rupee", + "currency_label_SLL": "Leone", + "currency_label_SGD": "Singapore Dollar", + "currency_label_XSU": "Sucre", + "currency_label_SBD": "Solomon Islands Dollar", + "currency_label_SOS": "Somali Shilling", + "currency_label_SSP": "South Sudanese Pound", + "currency_label_LKR": "Sri Lanka Rupee", + "currency_label_SDG": "Sudanese Pound", + "currency_label_SRD": "Surinam Dollar", + "currency_label_SZL": "Lilangeni", + "currency_label_SEK": "Swedish Krona", + "currency_label_CHE": "WIR Euro", + "currency_label_CHW": "WIR Franc", + "currency_label_SYP": "Syrian Pound", + "currency_label_TWD": "New Taiwan Dollar", + "currency_label_TJS": "Somoni", + "currency_label_TZS": "Tanzanian Shilling", + "currency_label_THB": "Baht", + "currency_label_TOP": "Pa’anga", + "currency_label_TTD": "Trinidad and Tobago Dollar", + "currency_label_TND": "Tunisian Dinar", + "currency_label_TRY": "Turkish Lira", + "currency_label_TMT": "Turkmenistan New Manat", + "currency_label_UGX": "Uganda Shilling", + "currency_label_UAH": "Hryvnia", + "currency_label_AED": "UAE Dirham", + "currency_label_USN": "United States Dollar (Next day)", + "currency_label_UYI": "Uruguay Peso en Unidades Indexadas (URUIURUI)", + "currency_label_UYU": "Peso Uruguayo", + "currency_label_UZS": "Uzbekistan Sum", + "currency_label_VUV": "Vatu", + "currency_label_VEF": "Bolivar", + "currency_label_VND": "Dong", + "currency_label_YER": "Yemeni Rial", + "currency_label_ZMW": "Zambian Kwacha", + "currency_label_ZWL": "Zimbabwe Dollar" } \ No newline at end of file From ec736e99888ba0dc36f16ece8a88fe8705b16f6b Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Thu, 15 Apr 2021 18:16:20 +0300 Subject: [PATCH 015/110] Do not set search term on fiat select. --- src/components/scenes/CreateWalletSelectFiatScene.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/scenes/CreateWalletSelectFiatScene.js b/src/components/scenes/CreateWalletSelectFiatScene.js index 03e5ce7a661..1b99f1b41ea 100644 --- a/src/components/scenes/CreateWalletSelectFiatScene.js +++ b/src/components/scenes/CreateWalletSelectFiatScene.js @@ -92,8 +92,7 @@ class CreateWalletSelectFiatComponent extends React.Component { if (selectedFiat) { this.setState( { - selectedFiat: selectedFiat.value, - searchTerm: selectedFiat.label + selectedFiat: selectedFiat.value }, this.onNext ) From 47aeeee4d74e165c3956a86c60c24b33d7dd6005 Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Thu, 15 Apr 2021 20:08:31 +0300 Subject: [PATCH 016/110] Help modal ui2 design. --- src/components/modals/HelpModal.js | 158 +++++++++++++++++++------ src/components/themed/ClickableRow.js | 37 +++++- src/components/themed/SelectableRow.js | 13 +- src/locales/en_US.js | 10 +- src/locales/strings/enUS.json | 10 +- 5 files changed, 183 insertions(+), 45 deletions(-) diff --git a/src/components/modals/HelpModal.js b/src/components/modals/HelpModal.js index 0bf9cc45f08..ee1d6d34479 100644 --- a/src/components/modals/HelpModal.js +++ b/src/components/modals/HelpModal.js @@ -1,61 +1,153 @@ // @flow import * as React from 'react' -import { Linking, Text } from 'react-native' +import { Image, Linking, View } from 'react-native' import { getBuildNumber, getVersion } from 'react-native-device-info' -import AntDesignIcon from 'react-native-vector-icons/AntDesign' +import MaterialIcon from 'react-native-vector-icons/MaterialIcons' import { WebView } from 'react-native-webview' +import edgeLogo from '../../assets/images/edgeLogo/Edge_logo_L.png' import s from '../../locales/strings.js' import { Airship } from '../services/AirshipInstance.js' -import { type AirshipBridge, AirshipModal, ContentArea, dayText, IconCircle, ModalCloseArrow, textSize, THEME } from './modalParts.js' +import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../services/ThemeContext.js' +import { EdgeText } from '../themed/EdgeText' +import { ModalCloseArrow, ModalTitle } from '../themed/ModalParts' +import { SelectableRow } from '../themed/SelectableRow' +import { ThemedModal } from '../themed/ThemedModal' +import { type AirshipBridge } from './modalParts.js' const buildNumber = getBuildNumber() const versionNumber = getVersion() -const CONTENT_URI = 'https://edgesecure.co/info.html' +const HELP_URIS = { + knowledgeBase: 'https://support.edge.app/support/home', + support: 'https://support.edge.app/support/tickets/new', + call: '+1-855-346-4974', + site: 'https://edge.app' +} export function showHelpModal(): Promise { return Airship.show(bridge => ) } +function showWebViewModal(uri: string, title: string): void { + Airship.show(bridge => ) +} type Props = { bridge: AirshipBridge } -class HelpModal extends React.Component { +class HelpWebViewModal extends React.Component { webview: WebView | void + handleClose = () => this.props.bridge.resolve() + + render() { + const { bridge, uri, title } = this.props + return ( + + + {title} + + (this.webview = element)} source={{ uri }} /> + + + + ) + } +} + +class HelpModalComponent extends React.Component { + handleClose = () => this.props.bridge.resolve() render() { - const { bridge } = this.props + const { bridge, theme } = this.props + const styles = getStyles(theme) + const versionText = `${s.strings.help_version} ${versionNumber}` + const buildText = `${s.strings.help_build} ${buildNumber}` + const optionMarginRem = [0.75, 0, 0.5, 1] + const optionPaddingRem = [0, 1, 1, 0] return ( - bridge.resolve()}> - - - - - - {s.strings.help_modal_title} - { - if (!event.url.includes('info.html')) { - if (this.webview) this.webview.stopLoading() - Linking.openURL(event.url) - bridge.resolve() - } - }} - ref={element => (this.webview = element)} - source={{ uri: CONTENT_URI }} - /> - - {s.strings.help_version} {versionNumber} - {'\n'} - {s.strings.help_build} {buildNumber} - - - - bridge.resolve()} /> - + + + + + {s.strings.help_modal_title} + + + + } + title={s.strings.help_knowledge_base} + subTitle={s.strings.help_knowledge_base_text} + onPress={() => showWebViewModal(HELP_URIS.knowledgeBase, s.strings.help_knowledge_base)} + underline + arrowColor={theme.iconTappable} + marginRem={optionMarginRem} + paddingRem={optionPaddingRem} + /> + + } + title={s.strings.help_support} + subTitle={s.strings.help_support_text} + onPress={() => showWebViewModal(HELP_URIS.support, s.strings.help_support)} + underline + arrowColor={theme.iconTappable} + marginRem={optionMarginRem} + paddingRem={optionPaddingRem} + /> + + } + title={s.strings.help_call} + subTitle={s.strings.help_call_text} + onPress={() => Linking.openURL(`tel:${HELP_URIS.call}`)} + underline + arrowColor={theme.iconTappable} + marginRem={optionMarginRem} + paddingRem={optionPaddingRem} + /> + + } + title={s.strings.help_site} + subTitle={s.strings.help_site_text} + onPress={() => showWebViewModal(HELP_URIS.site, s.strings.help_site_text)} + arrowColor={theme.iconTappable} + marginRem={optionMarginRem} + paddingRem={optionPaddingRem} + /> + + {versionText} + {buildText} + + + + ) } } + +const getStyles = cacheStyles((theme: Theme) => ({ + titleContainer: { + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center' + }, + logo: { + height: theme.rem(2.25) + }, + footer: { + marginTop: theme.rem(1.5), + paddingVertical: theme.rem(0.5), + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center' + }, + version: { + color: theme.secondaryText, + fontSize: theme.rem(0.75) + } +})) + +const HelpModal = withTheme(HelpModalComponent) diff --git a/src/components/themed/ClickableRow.js b/src/components/themed/ClickableRow.js index 6801382b1ed..7158ffb6046 100644 --- a/src/components/themed/ClickableRow.js +++ b/src/components/themed/ClickableRow.js @@ -4,24 +4,30 @@ import * as React from 'react' import { TouchableHighlight, TouchableOpacity, View } from 'react-native' import { Gradient } from '../../modules/UI/components/Gradient/Gradient.ui' +import { unpackEdges } from '../../util/edges' import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../services/ThemeContext.js' type Props = { onPress: () => void | (() => Promise), highlight?: boolean, gradient?: boolean, - children?: React.Node + children?: React.Node, + underline?: boolean, + + marginRem?: number[] | number, + paddingRem?: number[] | number } class ClickableRowComponent extends React.PureComponent { renderContent() { - const { gradient, children, theme } = this.props + const { gradient, children, underline, theme } = this.props const styles = getStyles(theme) + const containerStyles = [styles.rowContainer, spacingStyles(this.props, theme), underline ? styles.underline : null] if (gradient) { - return {children} + return {children} } - return {children} + return {children} } render() { @@ -39,13 +45,32 @@ class ClickableRowComponent extends React.PureComponent { } } +function spacingStyles(props: Props, theme: Theme) { + const marginRem = unpackEdges(props.marginRem || 0) + const paddingRem = unpackEdges(props.paddingRem ?? [0, 1]) + + return { + marginBottom: theme.rem(marginRem.bottom), + marginLeft: theme.rem(marginRem.left), + marginRight: theme.rem(marginRem.right), + marginTop: theme.rem(marginRem.top), + paddingBottom: theme.rem(paddingRem.bottom), + paddingLeft: theme.rem(paddingRem.left), + paddingRight: theme.rem(paddingRem.right), + paddingTop: theme.rem(paddingRem.top) + } +} + const getStyles = cacheStyles((theme: Theme) => ({ rowContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', - height: theme.rem(4.25), - paddingHorizontal: theme.rem(1) + height: theme.rem(4.25) + }, + underline: { + borderBottomWidth: theme.thinLineWidth, + borderBottomColor: theme.lineDivider } })) diff --git a/src/components/themed/SelectableRow.js b/src/components/themed/SelectableRow.js index 143419d5d4c..bb6c738d283 100644 --- a/src/components/themed/SelectableRow.js +++ b/src/components/themed/SelectableRow.js @@ -13,16 +13,21 @@ type Props = { title: string, subTitle: string, icon?: React.Node, - selected: boolean + selected?: boolean, + arrowColor?: string, + underline?: boolean, + + marginRem?: number[] | number, + paddingRem?: number[] | number } class SelectableRowComponent extends React.PureComponent { render() { - const { icon, title, subTitle, onPress, theme } = this.props + const { icon, title, subTitle, arrowColor, underline, marginRem, paddingRem, onPress, theme } = this.props const styles = getStyles(theme) return ( - + {icon} @@ -31,7 +36,7 @@ class SelectableRowComponent extends React.PureComponent { {subTitle} - + ) diff --git a/src/locales/en_US.js b/src/locales/en_US.js index 471db4b0ae7..759d61e1ad0 100644 --- a/src/locales/en_US.js +++ b/src/locales/en_US.js @@ -191,8 +191,16 @@ const strings = { submit: 'Submit', login: 'Login', help_build: 'Build', - help_modal_title: 'Crypto Wallet', + help_modal_title: 'Thanks for using Edge!', help_version: 'Version', + help_knowledge_base: 'Knowledge Base', + help_knowledge_base_text: 'Commonly asked questions and FAQ', + help_support: 'Submit a Support Ticket', + help_support_text: 'Troubleshooting and technical support', + help_call: 'Call for Assistance', + help_call_text: 'Get in touch by phone', + help_site: 'Visit the Edge App site', + help_site_text: 'More info on Edge and Developer API/SDK', loading: 'Loading…', validating: 'Validating…', mining_fee_custom_label_choice: 'Custom', diff --git a/src/locales/strings/enUS.json b/src/locales/strings/enUS.json index d0bb2b71fe2..14d97f5cc37 100644 --- a/src/locales/strings/enUS.json +++ b/src/locales/strings/enUS.json @@ -172,8 +172,16 @@ "submit": "Submit", "login": "Login", "help_build": "Build", - "help_modal_title": "Crypto Wallet", + "help_modal_title": "Thanks for using Edge!", "help_version": "Version", + "help_knowledge_base": "Knowledge Base", + "help_knowledge_base_text": "Commonly asked questions and FAQ", + "help_support": "Submit a Support Ticket", + "help_support_text": "Troubleshooting and technical support", + "help_call": "Call for Assistance", + "help_call_text": "Get in touch by phone", + "help_site": "Visit the Edge App site", + "help_site_text": "More info on Edge and Developer API/SDK", "loading": "Loading…", "validating": "Validating…", "mining_fee_custom_label_choice": "Custom", From 12ec94c200406cb20b2fe33cf2741afd70082336 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 16 Apr 2021 12:05:47 -0700 Subject: [PATCH 017/110] v2.0.9 --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b67ecdff3c..28d53bef18a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # edge-react-gui +## 2.0.9 (2021-04-16) + +- Add UNI ERC20 token +- Various bug fixes and improvements +- Upgrade edge-core-js to v0.17.30 + - Deprecate several methods: + - EdgeContext.getRecovery2Key - Use EdgeUserInfo.recovery2Key instead. + - EdgeCurrencyWallet.exportTransactionsToCSV - Moved to edge-react-gui project. + - EdgeCurrencyWallet.exportTransactionsToQBO - Moved to edge-react-gui project. + - EdgeCurrencyWallet.getDisplayPrivateSeed - Use EdgeCurrencyWallet.displayPrivateSeed instead. + - EdgeCurrencyWallet.getDisplayPublicSeed - Use EdgeCurrencyWallet.displayPublicSeed instead. + - Upgrade build scripts to use Webpack 5. +- Upgrade edge-currency-accountbased to v0.7.52 + - ETH: Add UNI ERC20 token + - ETH: Add eth_call to token balance loop + - FIO: Logging cleanup + - FIO: Allow sending tokens without transactionJson or otherParams +- Upgrade edge-exchange-plugins to v0.11.24 + - Sideshift: Move permission check after currency check + - Upgrade eslint-config-standard-kit to v0.15.1 + - Upgrade to edge-core-js v0.17.29 + - Upgrade to Webpack 5 +- Upgrade edge-login-ui-rn to v0.9.0 + - *Breaking change*: This release contains a breaking change that was not indicated in the minor version update: + - rn: Prompt for notification permissions to support security features + - rn: Update modal colors +- Upgrade edge-currency-monero to v0.2.10 + - Update image URL + ## 2.0.8 (2021-04-08) - Reset the slider on the send screen when the pending state changes. diff --git a/package.json b/package.json index f3dd8893862..ebcc9d1b9de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "edge-react-gui", - "version": "2.0.8", + "version": "2.0.9", "private": true, "description": "Edge Wallet React GUI", "homepage": "https://edge.app", From 528c24336a0e88ea1dbb69ef942b8cfcf0d47888 Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Sun, 18 Apr 2021 02:42:04 +0300 Subject: [PATCH 018/110] Set fiorequest from own props on send scene. isSendUsingFioAddress fix. --- src/components/scenes/SendScene.js | 14 ++++++++++---- src/components/themed/SelectFioAddress.js | 13 +++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/components/scenes/SendScene.js b/src/components/scenes/SendScene.js index bef9a41bde9..e3d9fc9da04 100644 --- a/src/components/scenes/SendScene.js +++ b/src/components/scenes/SendScene.js @@ -63,7 +63,8 @@ type StateProps = { transaction: EdgeTransaction | null, transactionMetadata: EdgeMetadata | null, uniqueIdentifier?: string, - wallets: { [walletId: string]: GuiWallet } + wallets: { [walletId: string]: GuiWallet }, + isSendUsingFioAddress?: boolean } type DispatchProps = { @@ -438,7 +439,7 @@ class SendComponent extends React.PureComponent { } renderSelectFioAddress() { - const { hiddenTilesMap = {} } = this.props + const { hiddenTilesMap = {}, guiMakeSpendInfo, isSendUsingFioAddress } = this.props const { fioSender } = this.state if (hiddenTilesMap.fioAddressSelect) return null @@ -450,6 +451,8 @@ class SendComponent extends React.PureComponent { memoError={fioSender.memoError} onSelect={this.handleFioAddressSelect} onMemoChange={this.handleMemoChange} + fioRequest={guiMakeSpendInfo && guiMakeSpendInfo.fioPendingRequest ? guiMakeSpendInfo.fioPendingRequest : undefined} + isSendUsingFioAddress={isSendUsingFioAddress} /> ) @@ -570,8 +573,10 @@ const getStyles = cacheStyles((theme: Theme) => ({ })) export const SendScene = connect( - (state: RootState): StateProps => { + (state: RootState, ownProps: RouteProps): StateProps => { const { nativeAmount, transaction, transactionMetadata, error, pending, guiMakeSpendInfo } = state.ui.scenes.sendConfirmation + const isSendUsingFioAddress = guiMakeSpendInfo.isSendUsingFioAddress || (ownProps.guiMakeSpendInfo && ownProps.guiMakeSpendInfo.isSendUsingFioAddress) + return { account: state.core.account, authRequired: state.ui.scenes.sendConfirmation.authRequired, @@ -590,7 +595,8 @@ export const SendScene = connect( transaction, transactionMetadata, uniqueIdentifier: guiMakeSpendInfo.uniqueIdentifier, - wallets: state.ui.wallets.byId + wallets: state.ui.wallets.byId, + isSendUsingFioAddress } }, (dispatch: Dispatch): DispatchProps => ({ diff --git a/src/components/themed/SelectFioAddress.js b/src/components/themed/SelectFioAddress.js index e6789e12504..ddb2fd86bb9 100644 --- a/src/components/themed/SelectFioAddress.js +++ b/src/components/themed/SelectFioAddress.js @@ -26,7 +26,9 @@ type SelectFioAddressOwnProps = { memo: string, memoError: string, onSelect: (fioAddress: string, fioWallet: EdgeCurrencyWallet, error: string) => void, - onMemoChange: (memo: string, memoError: string) => void + onMemoChange: (memo: string, memoError: string) => void, + fioRequest?: FioRequest, + isSendUsingFioAddress?: boolean } type SelectFioAddressProps = { @@ -34,9 +36,7 @@ type SelectFioAddressProps = { fioAddresses: FioAddress[], fioWallets: EdgeCurrencyWallet[], selectedWallet: GuiWallet, - currencyCode: string, - fioRequest?: FioRequest, - isSendUsingFioAddress?: boolean + currencyCode: string } type DispatchProps = { @@ -266,7 +266,6 @@ const mapStateToProps = (state: RootState): SelectFioAddressProps => { const currencyCode: string = UI_SELECTORS.getSelectedCurrencyCode(state) const fioWallets: EdgeCurrencyWallet[] = UI_SELECTORS.getFioWallets(state) const fioAddresses = state.ui.scenes.fioAddress.fioAddresses - const { guiMakeSpendInfo } = state.ui.scenes.sendConfirmation if (!guiWallet || !currencyCode) { return { @@ -283,9 +282,7 @@ const mapStateToProps = (state: RootState): SelectFioAddressProps => { fioAddresses, fioWallets, currencyCode, - selectedWallet: guiWallet, - fioRequest: guiMakeSpendInfo && guiMakeSpendInfo.fioPendingRequest ? guiMakeSpendInfo.fioPendingRequest : undefined, - isSendUsingFioAddress: guiMakeSpendInfo ? guiMakeSpendInfo.isSendUsingFioAddress : undefined + selectedWallet: guiWallet } } From 392b0bba0da9c6e81d160cb63026dd61dee657c5 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Mon, 19 Apr 2021 11:16:41 -0700 Subject: [PATCH 019/110] Fix the CSV export bug --- src/actions/TransactionExportActions.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/actions/TransactionExportActions.js b/src/actions/TransactionExportActions.js index ac36db3e60f..414ab752e27 100644 --- a/src/actions/TransactionExportActions.js +++ b/src/actions/TransactionExportActions.js @@ -258,6 +258,7 @@ export async function exportTransactionsToCSVInner( amount, amountFiat, category, + denomName, notes, networkFeeField, txid: edgeTx.txid, From 4ecf1d389021a4d9b3c27b3a0082dc149c39aaae Mon Sep 17 00:00:00 2001 From: William Swanson Date: Mon, 19 Apr 2021 15:33:22 -0700 Subject: [PATCH 020/110] Upgrade to edge-login-ui-rn v0.9.1 --- ios/Podfile.lock | 4 ++-- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index d66bfc98c21..f33caa8ee7b 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -9,7 +9,7 @@ PODS: - disklet (0.4.5): - React - DoubleConversion (1.1.6) - - edge-login-ui-rn (0.9.0): + - edge-login-ui-rn (0.9.1): - React - FBLazyVector (0.63.4) - FBReactNativeSpec (0.63.4): @@ -774,7 +774,7 @@ SPEC CHECKSUMS: CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f disklet: 4f586f90b70fdb46f06614a5b7342eda5c90f253 DoubleConversion: cde416483dac037923206447da6e1454df403714 - edge-login-ui-rn: 7fee86d2eab1d62791f929bb67e0894409e28061 + edge-login-ui-rn: 965cb13c3287f750f8ad25911020f9dc874b5886 FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e Firebase: 458d109512200d1aca2e1b9b6cf7d68a869a4a46 diff --git a/package.json b/package.json index ebcc9d1b9de..7e5fdf781fc 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "edge-currency-bitcoin": "^4.9.14", "edge-currency-monero": "^0.2.10", "edge-exchange-plugins": "^0.11.24", - "edge-login-ui-rn": "^0.9.0", + "edge-login-ui-rn": "^0.9.1", "json-csv": "^1.5.0", "lodash": "^4.17.19", "qrcode-generator": "^1.4.4", diff --git a/yarn.lock b/yarn.lock index cec23fc985b..2f556b55899 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5257,10 +5257,10 @@ edge-exchange-plugins@^0.11.24: iso4217 "^0.2.0" utf8 "^3.0.0" -edge-login-ui-rn@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/edge-login-ui-rn/-/edge-login-ui-rn-0.9.0.tgz#0019772c8b105fb8740de8870243fa1d65a74e29" - integrity sha512-DT3ESLx8zwDcfS6hjmfL2rO3jY/mm2K6zov9HY/lVqvz5+nOwY2qW76Pm9l4I1L6xe03FH71KYmBRoPqdeGvhg== +edge-login-ui-rn@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/edge-login-ui-rn/-/edge-login-ui-rn-0.9.1.tgz#2b4172a05b844681780206ef31d06db6ede7a644" + integrity sha512-P40c193rBeluWCOcZz7J1wkvcp6HTntZ/u2ZR8Y3EtmBb1bsJUspZvYCIqAzxckMkAO0T/PpDyytnzzZvcEx0w== dependencies: cleaners "^0.3.1" qrcode-generator "^1.4.4" From 80ee3c34d2a2914cc959cc6e5683368c8328ffcc Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 19 Apr 2021 17:13:03 -0700 Subject: [PATCH 021/110] Update edge-currency-accountbased to v0.7.53 --- CHANGELOG.md | 3 ++- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28d53bef18a..f1863243de3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,11 +12,12 @@ - EdgeCurrencyWallet.getDisplayPrivateSeed - Use EdgeCurrencyWallet.displayPrivateSeed instead. - EdgeCurrencyWallet.getDisplayPublicSeed - Use EdgeCurrencyWallet.displayPublicSeed instead. - Upgrade build scripts to use Webpack 5. -- Upgrade edge-currency-accountbased to v0.7.52 +- Upgrade edge-currency-accountbased to v0.7.53 - ETH: Add UNI ERC20 token - ETH: Add eth_call to token balance loop - FIO: Logging cleanup - FIO: Allow sending tokens without transactionJson or otherParams + - FIO: Change some error logging levels from error to info to reduce log verbosity - Upgrade edge-exchange-plugins to v0.11.24 - Sideshift: Move permission check after currency check - Upgrade eslint-config-standard-kit to v0.15.1 diff --git a/package.json b/package.json index 7e5fdf781fc..82181283a23 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "disklet": "^0.4.5", "edge-components": "^0.0.31", "edge-core-js": "^0.17.30", - "edge-currency-accountbased": "^0.7.52", + "edge-currency-accountbased": "^0.7.53", "edge-currency-bitcoin": "^4.9.14", "edge-currency-monero": "^0.2.10", "edge-exchange-plugins": "^0.11.24", diff --git a/yarn.lock b/yarn.lock index 2f556b55899..5042ea17f91 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5183,10 +5183,10 @@ edge-core-js@^0.17.30: yaob "^0.3.6" yavent "^0.1.1" -edge-currency-accountbased@^0.7.52: - version "0.7.52" - resolved "https://registry.yarnpkg.com/edge-currency-accountbased/-/edge-currency-accountbased-0.7.52.tgz#8ead92747a18694c94d322a46196ec92c91e81fb" - integrity sha512-+aXJ70aDuHbRgmH5VAEURLQuuBWyJkai9ytNlayvDpVJxTFc47a8kmLc0JxcBqF2pZ+yPZBoWq/enAfTbr8HNA== +edge-currency-accountbased@^0.7.53: + version "0.7.53" + resolved "https://registry.yarnpkg.com/edge-currency-accountbased/-/edge-currency-accountbased-0.7.53.tgz#7801b08f2306b93bd2f48166245b149c046d67ee" + integrity sha512-Ff7Svr68UsAibU8uIXlfxpJEwAVZHDC7J5iJ4/L90tQPYq+hxynN3vAp5yhVbE8+i5DiTvOMcbfVaqAHFxt2+A== dependencies: "@binance-chain/javascript-sdk" "^2.14.4" "@fioprotocol/fiosdk" "^1.2.1" From 481db01d5a796c79ba26f835737f13bd1a1b6e9a Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Tue, 20 Apr 2021 16:33:36 +0300 Subject: [PATCH 022/110] SelectableRow subtitle width and arrow color change. --- src/components/modals/HelpModal.js | 13 +++++++------ src/components/themed/SelectableRow.js | 13 +++++++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/components/modals/HelpModal.js b/src/components/modals/HelpModal.js index ee1d6d34479..b6765d98372 100644 --- a/src/components/modals/HelpModal.js +++ b/src/components/modals/HelpModal.js @@ -8,6 +8,7 @@ import { WebView } from 'react-native-webview' import edgeLogo from '../../assets/images/edgeLogo/Edge_logo_L.png' import s from '../../locales/strings.js' +import { PLATFORM } from '../../theme/variables/platform.js' import { Airship } from '../services/AirshipInstance.js' import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../services/ThemeContext.js' import { EdgeText } from '../themed/EdgeText' @@ -81,7 +82,7 @@ class HelpModalComponent extends React.Component { subTitle={s.strings.help_knowledge_base_text} onPress={() => showWebViewModal(HELP_URIS.knowledgeBase, s.strings.help_knowledge_base)} underline - arrowColor={theme.iconTappable} + arrowTappable marginRem={optionMarginRem} paddingRem={optionPaddingRem} /> @@ -92,7 +93,7 @@ class HelpModalComponent extends React.Component { subTitle={s.strings.help_support_text} onPress={() => showWebViewModal(HELP_URIS.support, s.strings.help_support)} underline - arrowColor={theme.iconTappable} + arrowTappable marginRem={optionMarginRem} paddingRem={optionPaddingRem} /> @@ -103,7 +104,7 @@ class HelpModalComponent extends React.Component { subTitle={s.strings.help_call_text} onPress={() => Linking.openURL(`tel:${HELP_URIS.call}`)} underline - arrowColor={theme.iconTappable} + arrowTappable marginRem={optionMarginRem} paddingRem={optionPaddingRem} /> @@ -113,7 +114,7 @@ class HelpModalComponent extends React.Component { title={s.strings.help_site} subTitle={s.strings.help_site_text} onPress={() => showWebViewModal(HELP_URIS.site, s.strings.help_site_text)} - arrowColor={theme.iconTappable} + arrowTappable marginRem={optionMarginRem} paddingRem={optionPaddingRem} /> @@ -138,8 +139,8 @@ const getStyles = cacheStyles((theme: Theme) => ({ height: theme.rem(2.25) }, footer: { - marginTop: theme.rem(1.5), - paddingVertical: theme.rem(0.5), + marginTop: PLATFORM.deviceHeight < theme.rem(42) ? 0 : theme.rem(1.5), + paddingVertical: PLATFORM.deviceHeight < theme.rem(42) ? theme.rem(0.25) : theme.rem(0.5), flexDirection: 'column', justifyContent: 'center', alignItems: 'center' diff --git a/src/components/themed/SelectableRow.js b/src/components/themed/SelectableRow.js index bb6c738d283..e4a3da23d46 100644 --- a/src/components/themed/SelectableRow.js +++ b/src/components/themed/SelectableRow.js @@ -14,7 +14,7 @@ type Props = { subTitle: string, icon?: React.Node, selected?: boolean, - arrowColor?: string, + arrowTappable?: boolean, underline?: boolean, marginRem?: number[] | number, @@ -23,7 +23,7 @@ type Props = { class SelectableRowComponent extends React.PureComponent { render() { - const { icon, title, subTitle, arrowColor, underline, marginRem, paddingRem, onPress, theme } = this.props + const { icon, title, subTitle, arrowTappable, underline, marginRem, paddingRem, onPress, theme } = this.props const styles = getStyles(theme) return ( @@ -33,10 +33,12 @@ class SelectableRowComponent extends React.PureComponent { {icon} {title} - {subTitle} + + {subTitle} + - + ) @@ -51,14 +53,17 @@ const getStyles = cacheStyles((theme: Theme) => ({ justifyContent: 'space-between' }, iconTitleContainer: { + flex: 1, flexDirection: 'row', alignItems: 'center' }, title: { + width: '100%', flexDirection: 'column', marginLeft: theme.rem(1.25) }, subTitle: { + maxWidth: '85%', color: theme.deactivatedText, fontSize: theme.rem(0.75), marginTop: theme.rem(0.25) From 102acc7311cc6698633eabb984a9160d201f175a Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Tue, 20 Apr 2021 22:44:33 +0300 Subject: [PATCH 023/110] Show proper error message on address register steps. --- .../scenes/FioAddressRegisterScene.js | 13 +++---- src/locales/en_US.js | 2 ++ src/locales/strings/enUS.json | 2 ++ src/modules/FioAddress/util.js | 34 +++++++++++++++---- 4 files changed, 35 insertions(+), 16 deletions(-) diff --git a/src/components/scenes/FioAddressRegisterScene.js b/src/components/scenes/FioAddressRegisterScene.js index 8425ae352c4..73b8de73586 100644 --- a/src/components/scenes/FioAddressRegisterScene.js +++ b/src/components/scenes/FioAddressRegisterScene.js @@ -12,7 +12,7 @@ import s from '../../locales/strings.js' import { createFioWallet } from '../../modules/FioAddress/action' import { DomainListModal } from '../../modules/FioAddress/components/DomainListModal' import { EditNameModal } from '../../modules/FioAddress/components/EditNameModal' -import { FIO_DOMAIN_IS_NOT_PUBLIC, FioError } from '../../modules/FioAddress/util' +import { checkIsDomainPublic } from '../../modules/FioAddress/util' import { getFioWallets } from '../../modules/UI/selectors' import type { RootState } from '../../reducers/RootReducer' import type { Dispatch } from '../../types/reduxTypes' @@ -194,14 +194,9 @@ class FioAddressRegister extends React.Component { const { fioPlugin } = this.props if (isCustomDomain) { try { - const isDomainPublic = fioPlugin.otherMethods ? await fioPlugin.otherMethods.isDomainPublic(domain) : false - if (!isDomainPublic) { - throw new FioError(s.strings.fio_address_register_domain_is_not_public, FIO_DOMAIN_IS_NOT_PUBLIC) - } + await checkIsDomainPublic(fioPlugin, domain) } catch (e) { - if (!e.labelCode || e.name !== 'FioError') { - showError(s.strings.fio_connect_wallets_err) - } + showError(e.message) return this.setState({ isAvailable: false, loading: false @@ -233,7 +228,7 @@ class FioAddressRegister extends React.Component { loading: false }) } - this.checkFioAddress(fioAddressChanged, this.state.selectedDomain.name) + this.checkFioAddress(fioAddressChanged, this.state.selectedDomain.name, !this.state.selectedDomain.walletId) this.setState({ fioAddress: fioAddressChanged.toLowerCase() diff --git a/src/locales/en_US.js b/src/locales/en_US.js index 3114fad101a..d910216770c 100644 --- a/src/locales/en_US.js +++ b/src/locales/en_US.js @@ -648,6 +648,8 @@ const strings = { fio_address_list_register_domain: 'Register New Domain', fio_get_fee_err_msg: 'There was an issue getting the FIO fee. Please try again later.', fio_get_reg_info_err_msg: 'There was an issue getting registration information.', + fio_get_reg_info_domain_err_msg: 'Domain does not exist', + fio_get_reg_info_already_sent_err_msg: 'Registration request is already sent', fio_register_address_err_msg: 'There was an issue registering an address. Please try later.', fio_error_invalid_address: 'Invalid FIO address', fio_renew_err_msg: 'There was an issue renewing your %s. Please try again later.', diff --git a/src/locales/strings/enUS.json b/src/locales/strings/enUS.json index 768df6e1ea7..29074cced81 100644 --- a/src/locales/strings/enUS.json +++ b/src/locales/strings/enUS.json @@ -600,6 +600,8 @@ "fio_address_list_register_domain": "Register New Domain", "fio_get_fee_err_msg": "There was an issue getting the FIO fee. Please try again later.", "fio_get_reg_info_err_msg": "There was an issue getting registration information.", + "fio_get_reg_info_domain_err_msg": "Domain does not exist", + "fio_get_reg_info_already_sent_err_msg": "Registration request is already sent", "fio_register_address_err_msg": "There was an issue registering an address. Please try later.", "fio_error_invalid_address": "Invalid FIO address", "fio_renew_err_msg": "There was an issue renewing your %s. Please try again later.", diff --git a/src/modules/FioAddress/util.js b/src/modules/FioAddress/util.js index c27ef4d1b7d..93b6ac97267 100644 --- a/src/modules/FioAddress/util.js +++ b/src/modules/FioAddress/util.js @@ -21,7 +21,6 @@ type DiskletConnectedWallets = { } type BuyAddressResponse = { - error: any, success: { charge: { pricing: { @@ -507,6 +506,23 @@ export const getFioDomains = async (fioPlugin: EdgeCurrencyConfig, fioAddress: s return '' } +export const checkIsDomainPublic = async (fioPlugin: EdgeCurrencyConfig, domain: string): Promise => { + let isDomainPublic = false + try { + isDomainPublic = fioPlugin.otherMethods ? await fioPlugin.otherMethods.isDomainPublic(domain) : false + } catch (e) { + if (e.labelCode && e.labelCode === fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_DOMAIN_IS_NOT_EXIST) { + throw new Error(s.strings.fio_get_reg_info_domain_err_msg) + } + + throw new Error(s.strings.fio_connect_wallets_err) + } + + if (!isDomainPublic) { + throw new Error(s.strings.fio_address_register_domain_is_not_public) + } +} + /** * * @param fioPlugin @@ -617,11 +633,6 @@ const buyAddressRequest = async ( publicKey: selectedWallet.publicWalletInfo.keys.publicKey }) - if (buyAddressResponse.error) { - console.log(buyAddressResponse.error) - throw new Error(s.strings.fio_get_reg_info_err_msg) - } - if (buyAddressResponse.success) { const supportedCurrencies = { [FIO_STR]: true } const paymentInfo = { @@ -649,7 +660,16 @@ const buyAddressRequest = async ( } } } catch (e) { - console.log(e) + const errorMessages = { + [fioPlugin.currencyInfo.defaultSettings.errorCodes.INVALID_FIO_ADDRESS]: s.strings.fio_error_invalid_address, + [fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_DOMAIN_IS_NOT_EXIST]: s.strings.fio_get_reg_info_domain_err_msg, + [fioPlugin.currencyInfo.defaultSettings.errorCodes.FIO_DOMAIN_IS_NOT_PUBLIC]: s.strings.fio_address_register_domain_is_not_public, + [fioPlugin.currencyInfo.defaultSettings.errorCodes.SERVER_ERROR]: s.strings.fio_get_reg_info_err_msg, + [fioPlugin.currencyInfo.defaultSettings.errorCodes.ALREADY_SENT_REGISTRATION_REQ_FOR_DOMAIN]: s.strings.fio_get_reg_info_already_sent_err_msg + } + if (e.labelCode && errorMessages[e.labelCode]) { + throw new Error(errorMessages[e.labelCode]) + } } throw new Error(s.strings.fio_get_reg_info_err_msg) } From 3d3d2542657de44ccafc9cb9656edfde8097d6f4 Mon Sep 17 00:00:00 2001 From: Art Manalili Date: Wed, 21 Apr 2021 06:31:09 +0800 Subject: [PATCH 024/110] Remove constants and just using string literals --- ios/Podfile.lock | 2 +- src/__tests__/utils.test.js | 5 ++--- src/components/scenes/SendScene.js | 4 ++-- src/components/scenes/TransactionDetailsScene.js | 4 ++-- src/components/themed/TransactionListRow.js | 5 ++--- src/components/themed/TransactionListTop.js | 4 ++-- src/components/themed/WalletList.js | 5 ++--- src/util/utils.js | 16 +++++++--------- 8 files changed, 20 insertions(+), 25 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 1d916634304..565c6ceba74 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -793,7 +793,7 @@ SPEC CHECKSUMS: Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7 FlipperKit: ab353d41aea8aae2ea6daaf813e67496642f3d7d Folly: b73c3869541e86821df3c387eb0af5f65addfab4 - glog: aefd1eb5dda2ab95ba0938556f34b98e2da3a60d + glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 GoogleAppMeasurement: dfe55efa543e899d906309eaaac6ca26d249862f GoogleDataTransport: 9a8a16f79feffc7f42096743de2a7c4815e84020 GoogleDataTransportCCTSupport: 0f39025e8cf51f168711bd3fb773938d7e62ddb5 diff --git a/src/__tests__/utils.test.js b/src/__tests__/utils.test.js index ffd1d3f3f97..62cd10761b4 100644 --- a/src/__tests__/utils.test.js +++ b/src/__tests__/utils.test.js @@ -10,7 +10,6 @@ import { convertNativeToDisplay, convertNativeToExchange, daysBetween, - DENOMINATION_TYPE, getDenomination, getNewArrayWithItem, getNewArrayWithoutItem, @@ -690,7 +689,7 @@ describe('getDisplayDenomination', function () { input.forEach((currency, index) => { test(`${title} ${currency}`, function () { - expect(getDenomination(currency, fixtures.settings, DENOMINATION_TYPE.DISPLAY)).toMatchObject(output[index]) + expect(getDenomination(currency, fixtures.settings, 'display')).toMatchObject(output[index]) }) }) }) @@ -701,7 +700,7 @@ describe('getExchangeDenomination', function () { input.forEach((currency, index) => { test(`${title} ${currency}`, function () { - expect(getDenomination(currency, fixtures.settings, DENOMINATION_TYPE.EXCHANGE)).toMatchObject(output[index]) + expect(getDenomination(currency, fixtures.settings, 'exchange')).toMatchObject(output[index]) }) }) }) diff --git a/src/components/scenes/SendScene.js b/src/components/scenes/SendScene.js index 59726b573c7..15b25931ae6 100644 --- a/src/components/scenes/SendScene.js +++ b/src/components/scenes/SendScene.js @@ -365,8 +365,8 @@ class SendComponent extends React.PureComponent { if (recipientAddress && !hiddenTilesMap.amount) { let cryptoAmountSyntax let fiatAmountSyntax - const cryptoDisplayDenomination = UTILS.getDenomination(selectedCurrencyCode, settings, UTILS.DENOMINATION_TYPE.DISPLAY) - const cryptoExchangeDenomination = UTILS.getDenomination(selectedCurrencyCode, settings, UTILS.DENOMINATION_TYPE.EXCHANGE) + const cryptoDisplayDenomination = UTILS.getDenomination(selectedCurrencyCode, settings, 'display') + const cryptoExchangeDenomination = UTILS.getDenomination(selectedCurrencyCode, settings, 'exchange') const fiatDenomination = UTILS.getDenomFromIsoCode(guiWallet.fiatCurrencyCode) const fiatSymbol = fiatDenomination.symbol ? fiatDenomination.symbol : '' if (nativeAmount && !bns.eq(nativeAmount, '0')) { diff --git a/src/components/scenes/TransactionDetailsScene.js b/src/components/scenes/TransactionDetailsScene.js index a5900a8c2ce..5d7f8811e55 100644 --- a/src/components/scenes/TransactionDetailsScene.js +++ b/src/components/scenes/TransactionDetailsScene.js @@ -593,8 +593,8 @@ export const TransactionDetailsScene = connect( const allCurrencyInfos = plugins.allCurrencyInfos const currencyInfo = UTILS.getCurrencyInfo(allCurrencyInfos, currencyCode) const walletDefaultDenomProps: EdgeDenomination = UTILS.isCryptoParentCurrency(wallet, edgeTransaction.currencyCode) - ? UTILS.getDenomination(wallet.currencyCode, settings, UTILS.DENOMINATION_TYPE.EXCHANGE) - : UTILS.getDenomination(edgeTransaction.currencyCode, settings, UTILS.DENOMINATION_TYPE.EXCHANGE) + ? UTILS.getDenomination(wallet.currencyCode, settings, 'exchange') + : UTILS.getDenomination(edgeTransaction.currencyCode, settings, 'exchange') const nativeAmount = edgeTransaction && edgeTransaction.nativeAmount ? bns.abs(edgeTransaction.nativeAmount) : '' const cryptoAmount = convertNativeToExchangeRateDenomination(settings, currencyCode, nativeAmount) diff --git a/src/components/themed/TransactionListRow.js b/src/components/themed/TransactionListRow.js index b5f92b8925d..37e4b31d0c0 100644 --- a/src/components/themed/TransactionListRow.js +++ b/src/components/themed/TransactionListRow.js @@ -12,7 +12,6 @@ import { type RootState } from '../../types/reduxTypes.js' import type { TransactionListTx } from '../../types/types.js' import * as UTILS from '../../util/utils' import { - DENOMINATION_TYPE, DIVIDE_PRECISION, getDenomFromIsoCode, getDenomination, @@ -78,8 +77,8 @@ export const TransactionListRow = connect((state: RootState, ownProps: OwnProps) const guiWallet = state.ui.wallets.byId[walletId] const { fiatCurrencyCode } = guiWallet const { settings } = state.ui - const displayDenomination = getDenomination(currencyCode, settings, DENOMINATION_TYPE.DISPLAY) - const exchangeDenomination = getDenomination(currencyCode, settings, DENOMINATION_TYPE.EXCHANGE) + const displayDenomination = getDenomination(currencyCode, settings, 'display') + const exchangeDenomination = getDenomination(currencyCode, settings, 'exchange') const fiatDenomination = getDenomFromIsoCode(guiWallet.fiatCurrencyCode) // Required Confirmations diff --git a/src/components/themed/TransactionListTop.js b/src/components/themed/TransactionListTop.js index 9a96cb91432..819a45d9801 100644 --- a/src/components/themed/TransactionListTop.js +++ b/src/components/themed/TransactionListTop.js @@ -16,7 +16,7 @@ import * as intl from '../../locales/intl.js' import s from '../../locales/strings.js' import { convertCurrency } from '../../modules/UI/selectors.js' import { type Dispatch, type RootState } from '../../types/reduxTypes.js' -import { convertNativeToDenomination, DENOMINATION_TYPE, getDefaultDenomination, getDenomination, getFiatSymbol } from '../../util/utils' +import { convertNativeToDenomination, getDefaultDenomination, getDenomination, getFiatSymbol } from '../../util/utils' import { type WalletListResult, WalletListModal } from '../modals/WalletListModal.js' import { Airship } from '../services/AirshipInstance.js' import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../services/ThemeContext.js' @@ -335,7 +335,7 @@ export const TransactionListTop = connect( const balance = guiWallet.nativeBalances[selectedCurrencyCode] // Crypto Amount Formatting - const currencyDenomination = getDenomination(selectedCurrencyCode, state.ui.settings, DENOMINATION_TYPE.DISPLAY) + const currencyDenomination = getDenomination(selectedCurrencyCode, state.ui.settings, 'display') const cryptoAmount: string = convertNativeToDenomination(currencyDenomination.multiplier)(balance) // convert to correct denomination const cryptoAmountFormat = intl.formatNumber(bns.add(cryptoAmount, '0')) diff --git a/src/components/themed/WalletList.js b/src/components/themed/WalletList.js index 3f4ec081ac8..edace0a0c4f 100644 --- a/src/components/themed/WalletList.js +++ b/src/components/themed/WalletList.js @@ -18,7 +18,6 @@ import { alphabeticalSort, checkFilterWallet, decimalOrZero, - DENOMINATION_TYPE, getDenomFromIsoCode, getDenomination, getFiatSymbol, @@ -216,8 +215,8 @@ class WalletListComponent extends React.PureComponent { const walletFiatSymbol = getFiatSymbol(guiWallet.isoFiatCurrencyCode) // Crypto Amount And Exchange Rate - const denomination = getDenomination(currencyCode, settings, DENOMINATION_TYPE.DISPLAY) - const exchangeDenomination = getDenomination(currencyCode, settings, DENOMINATION_TYPE.EXCHANGE) + const denomination = getDenomination(currencyCode, settings, 'display') + const exchangeDenomination = getDenomination(currencyCode, settings, 'exchange') const fiatDenomination = getDenomFromIsoCode(guiWallet.fiatCurrencyCode) const rateKey = `${currencyCode}_${guiWallet.isoFiatCurrencyCode}` const exchangeRate = exchangeRates[rateKey] ? exchangeRates[rateKey] : undefined diff --git a/src/util/utils.js b/src/util/utils.js index 922ab6f1351..a300a05814e 100644 --- a/src/util/utils.js +++ b/src/util/utils.js @@ -586,15 +586,13 @@ export function getCustomTokenDenomination(currencyCode: string, settings: Objec return customTokenCurrencyInfo ? customTokenCurrencyInfo.denominations[0] : emptyEdgeDenomination } -export const DENOMINATION_TYPE = { DISPLAY: 'display', EXCHANGE: 'exchange' } -export type DenominationType = typeof DENOMINATION_TYPE.DISPLAY | typeof DENOMINATION_TYPE.EXCHANGE -export function getDenomination(currencyCode: string, settings: Object, type: DenominationType) { +export function getDenomination(currencyCode: string, settings: Object, type: 'display' | 'exchange') { const currencyInfo = settings[currencyCode] if (currencyInfo) { const denomination = currencyInfo.denominations.find(denomination => { - if (type === DENOMINATION_TYPE.DISPLAY) { + if (type === 'display') { return denomination.multiplier === currencyInfo.denomination - } else if (type === DENOMINATION_TYPE.EXCHANGE) { + } else if (type === 'exchange') { return denomination.name === currencyInfo.currencyCode } }) @@ -684,8 +682,8 @@ export const convertTransactionFeeToDisplayFee = ( } } else if (parentNetworkFee && bns.gt(parentNetworkFee, '0')) { // if parentNetworkFee greater than zero - const parentDisplayDenomination = getDenomination(guiWallet.currencyCode, settings, DENOMINATION_TYPE.DISPLAY) - const parentExchangeDenomination = getDenomination(guiWallet.currencyCode, settings, DENOMINATION_TYPE.EXCHANGE) + const parentDisplayDenomination = getDenomination(guiWallet.currencyCode, settings, 'display') + const parentExchangeDenomination = getDenomination(guiWallet.currencyCode, settings, 'exchange') const cryptoFeeSymbol = parentDisplayDenomination && parentDisplayDenomination.symbol ? parentDisplayDenomination.symbol : '' const displayMultiplier = parentDisplayDenomination ? parentDisplayDenomination.multiplier : '' const exchangeMultiplier = parentExchangeDenomination ? parentExchangeDenomination.multiplier : '' @@ -700,8 +698,8 @@ export const convertTransactionFeeToDisplayFee = ( } } else if (networkFee && bns.gt(networkFee, '0')) { // if networkFee greater than zero - const primaryDisplayDenomination = getDenomination(currencyCode, settings, DENOMINATION_TYPE.DISPLAY) - const primaryExchangeDenomination = getDenomination(currencyCode, settings, DENOMINATION_TYPE.EXCHANGE) + const primaryDisplayDenomination = getDenomination(currencyCode, settings, 'display') + const primaryExchangeDenomination = getDenomination(currencyCode, settings, 'exchange') const cryptoFeeSymbol = primaryDisplayDenomination && primaryDisplayDenomination.symbol ? primaryDisplayDenomination.symbol : '' const displayMultiplier = primaryDisplayDenomination ? primaryDisplayDenomination.multiplier : '' const exchangeMultiplier = primaryExchangeDenomination ? primaryExchangeDenomination.multiplier : '' From bb806a96f4ce6b9787ea679ba3176b54d82e5b40 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Tue, 20 Apr 2021 15:53:28 -0700 Subject: [PATCH 025/110] Upgrade to react-native-firebase v10 --- ios/Podfile.lock | 200 ++++++++++++++--------------- ios/edge.xcodeproj/project.pbxproj | 2 +- ios/edge/GoogleService-Info.plist | 2 +- package.json | 8 +- yarn.lock | 42 +++--- 5 files changed, 120 insertions(+), 134 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index f33caa8ee7b..a18cd255406 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -19,51 +19,51 @@ PODS: - React-Core (= 0.63.4) - React-jsi (= 0.63.4) - ReactCommon/turbomodule/core (= 0.63.4) - - Firebase/Analytics (6.13.0): + - Firebase/Analytics (7.6.0): - Firebase/Core - - Firebase/Core (6.13.0): + - Firebase/Core (7.6.0): - Firebase/CoreOnly - - FirebaseAnalytics (= 6.1.6) - - Firebase/CoreOnly (6.13.0): - - FirebaseCore (= 6.4.0) - - Firebase/Messaging (6.13.0): + - FirebaseAnalytics (= 7.6.0) + - Firebase/CoreOnly (7.6.0): + - FirebaseCore (= 7.6.0) + - Firebase/Messaging (7.6.0): - Firebase/CoreOnly - - FirebaseMessaging (~> 4.1.9) - - FirebaseAnalytics (6.1.6): - - FirebaseCore (~> 6.4) - - FirebaseInstanceID (~> 4.2) - - GoogleAppMeasurement (= 6.1.6) - - GoogleUtilities/AppDelegateSwizzler (~> 6.0) - - GoogleUtilities/MethodSwizzler (~> 6.0) - - GoogleUtilities/Network (~> 6.0) - - "GoogleUtilities/NSData+zlib (~> 6.0)" - - nanopb (= 0.3.9011) - - FirebaseAnalyticsInterop (1.5.0) - - FirebaseCore (6.4.0): - - FirebaseCoreDiagnostics (~> 1.0) - - FirebaseCoreDiagnosticsInterop (~> 1.0) - - GoogleUtilities/Environment (~> 6.2) - - GoogleUtilities/Logger (~> 6.2) - - FirebaseCoreDiagnostics (1.2.4): - - FirebaseCoreDiagnosticsInterop (~> 1.2) - - GoogleDataTransportCCTSupport (~> 3.0) - - GoogleUtilities/Environment (~> 6.5) - - GoogleUtilities/Logger (~> 6.5) - - nanopb (~> 0.3.901) - - FirebaseCoreDiagnosticsInterop (1.2.0) - - FirebaseInstanceID (4.2.7): - - FirebaseCore (~> 6.0) - - GoogleUtilities/Environment (~> 6.0) - - GoogleUtilities/UserDefaults (~> 6.0) - - FirebaseMessaging (4.1.10): - - FirebaseAnalyticsInterop (~> 1.3) - - FirebaseCore (~> 6.2) - - FirebaseInstanceID (~> 4.1) - - GoogleUtilities/AppDelegateSwizzler (~> 6.2) - - GoogleUtilities/Environment (~> 6.2) - - GoogleUtilities/Reachability (~> 6.2) - - GoogleUtilities/UserDefaults (~> 6.2) - - Protobuf (>= 3.9.2, ~> 3.9) + - FirebaseMessaging (~> 7.6.0) + - FirebaseAnalytics (7.6.0): + - FirebaseCore (~> 7.0) + - FirebaseInstallations (~> 7.0) + - GoogleAppMeasurement (= 7.6.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.0) + - GoogleUtilities/MethodSwizzler (~> 7.0) + - GoogleUtilities/Network (~> 7.0) + - "GoogleUtilities/NSData+zlib (~> 7.0)" + - nanopb (~> 2.30907.0) + - FirebaseCore (7.6.0): + - FirebaseCoreDiagnostics (~> 7.4) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/Logger (~> 7.0) + - FirebaseCoreDiagnostics (7.9.0): + - GoogleDataTransport (~> 8.0) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/Logger (~> 7.0) + - nanopb (~> 2.30907.0) + - FirebaseInstallations (7.11.0): + - FirebaseCore (~> 7.0) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/UserDefaults (~> 7.0) + - PromisesObjC (~> 1.2) + - FirebaseInstanceID (7.11.0): + - FirebaseCore (~> 7.0) + - FirebaseInstallations (~> 7.0) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/UserDefaults (~> 7.0) + - FirebaseMessaging (7.6.0): + - FirebaseCore (~> 7.0) + - FirebaseInstanceID (~> 7.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.0) + - GoogleUtilities/Environment (~> 7.0) + - GoogleUtilities/Reachability (~> 7.0) + - GoogleUtilities/UserDefaults (~> 7.0) - Flipper (0.54.0): - Flipper-Folly (~> 2.2) - Flipper-RSocket (~> 1.1) @@ -120,40 +120,40 @@ PODS: - DoubleConversion - glog - glog (0.3.5) - - GoogleAppMeasurement (6.1.6): - - GoogleUtilities/AppDelegateSwizzler (~> 6.0) - - GoogleUtilities/MethodSwizzler (~> 6.0) - - GoogleUtilities/Network (~> 6.0) - - "GoogleUtilities/NSData+zlib (~> 6.0)" - - nanopb (= 0.3.9011) - - GoogleDataTransport (6.2.1) - - GoogleDataTransportCCTSupport (3.0.0): - - GoogleDataTransport (~> 6.0) - - nanopb (~> 0.3.901) - - GoogleUtilities/AppDelegateSwizzler (6.7.2): + - GoogleAppMeasurement (7.6.0): + - GoogleUtilities/AppDelegateSwizzler (~> 7.0) + - GoogleUtilities/MethodSwizzler (~> 7.0) + - GoogleUtilities/Network (~> 7.0) + - "GoogleUtilities/NSData+zlib (~> 7.0)" + - nanopb (~> 2.30907.0) + - GoogleDataTransport (8.3.1): + - GoogleUtilities/Environment (~> 7.2) + - nanopb (~> 2.30907.0) + - PromisesObjC (~> 1.2) + - GoogleUtilities/AppDelegateSwizzler (7.3.1): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - - GoogleUtilities/Environment (6.7.2): + - GoogleUtilities/Environment (7.3.1): - PromisesObjC (~> 1.2) - - GoogleUtilities/Logger (6.7.2): + - GoogleUtilities/Logger (7.3.1): - GoogleUtilities/Environment - - GoogleUtilities/MethodSwizzler (6.7.2): + - GoogleUtilities/MethodSwizzler (7.3.1): - GoogleUtilities/Logger - - GoogleUtilities/Network (6.7.2): + - GoogleUtilities/Network (7.3.1): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (6.7.2)" - - GoogleUtilities/Reachability (6.7.2): + - "GoogleUtilities/NSData+zlib (7.3.1)" + - GoogleUtilities/Reachability (7.3.1): - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (6.7.2): + - GoogleUtilities/UserDefaults (7.3.1): - GoogleUtilities/Logger - - nanopb (0.3.9011): - - nanopb/decode (= 0.3.9011) - - nanopb/encode (= 0.3.9011) - - nanopb/decode (0.3.9011) - - nanopb/encode (0.3.9011) + - nanopb (2.30907.0): + - nanopb/decode (= 2.30907.0) + - nanopb/encode (= 2.30907.0) + - nanopb/decode (2.30907.0) + - nanopb/encode (2.30907.0) - OpenSSL-Universal (1.0.2.20): - OpenSSL-Universal/Static (= 1.0.2.20) - OpenSSL-Universal/Static (1.0.2.20) @@ -169,8 +169,7 @@ PODS: - RNPermissions - Permission-Notifications (3.0.0): - RNPermissions - - PromisesObjC (1.2.11) - - Protobuf (3.13.0) + - PromisesObjC (1.2.12) - RCTRequired (0.63.4) - RCTTypeSafety (0.63.4): - FBLazyVector (= 0.63.4) @@ -436,22 +435,21 @@ PODS: - React - RNDeviceInfo (5.6.1): - React - - RNFBAnalytics (6.7.2): - - Firebase/Analytics (~> 6.13.0) - - Firebase/Core (~> 6.13.0) - - React + - RNFBAnalytics (10.8.1): + - Firebase/Analytics (~> 7.6.0) + - React-Core - RNFBApp - - RNFBApp (6.7.1): - - Firebase/Core (~> 6.13.0) - - React - - RNFBIid (6.7.1): - - Firebase/Core (~> 6.13.0) - - React + - RNFBApp (10.8.1): + - Firebase/CoreOnly (~> 7.6.0) + - React-Core + - RNFBIid (10.8.1): + - Firebase/CoreOnly (~> 7.6.0) + - FirebaseInstanceID + - React-Core - RNFBApp - - RNFBMessaging (6.7.1): - - Firebase/Core (~> 6.13.0) - - Firebase/Messaging (~> 6.13.0) - - React + - RNFBMessaging (10.8.1): + - Firebase/Messaging (~> 7.6.0) + - React-Core - RNFBApp - RNFS (2.13.3): - React @@ -607,10 +605,9 @@ SPEC REPOS: - CocoaLibEvent - Firebase - FirebaseAnalytics - - FirebaseAnalyticsInterop - FirebaseCore - FirebaseCoreDiagnostics - - FirebaseCoreDiagnosticsInterop + - FirebaseInstallations - FirebaseInstanceID - FirebaseMessaging - Flipper @@ -622,12 +619,10 @@ SPEC REPOS: - FlipperKit - GoogleAppMeasurement - GoogleDataTransport - - GoogleDataTransportCCTSupport - GoogleUtilities - nanopb - OpenSSL-Universal - PromisesObjC - - Protobuf - YogaKit EXTERNAL SOURCES: @@ -777,14 +772,13 @@ SPEC CHECKSUMS: edge-login-ui-rn: 965cb13c3287f750f8ad25911020f9dc874b5886 FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e - Firebase: 458d109512200d1aca2e1b9b6cf7d68a869a4a46 - FirebaseAnalytics: 45f36d9c429fc91d206283900ab75390cd05ee8a - FirebaseAnalyticsInterop: 3f86269c38ae41f47afeb43ebf32a001f58fcdae - FirebaseCore: 307ea2508df730c5865334e41965bd9ea344b0e5 - FirebaseCoreDiagnostics: b59c024493a409f8aecba02c99928d0d8431d159 - FirebaseCoreDiagnosticsInterop: 296e2c5f5314500a850ad0b83e9e7c10b011a850 - FirebaseInstanceID: ebd2ea79ee38db0cb5f5167b17a0d387e1cc7b6e - FirebaseMessaging: 089b7a4991425783384acc8bcefcd78c0af913bd + Firebase: e1e089d9aac215a52442583f818ab61de3c4581b + FirebaseAnalytics: 9f8f4feab1f3fddf4e4515f8f022fe6aa9e51043 + FirebaseCore: 0a43b7f1c5b36f3358cd703011ca4c7e0df55870 + FirebaseCoreDiagnostics: 3d36e05da74cb8b7ce30e6594a8f201b982c725c + FirebaseInstallations: a58d4f72ec5861840b84df489f2668d970df558a + FirebaseInstanceID: ad5135045a498d7775903efd39762d2cdfa1be27 + FirebaseMessaging: 4b9b2850fcfcaac2820097ee3703ba6cfff3df84 Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-Folly: e4493b013c02d9347d5e0cb4d128680239f6c78a @@ -794,11 +788,10 @@ SPEC CHECKSUMS: FlipperKit: ab353d41aea8aae2ea6daaf813e67496642f3d7d Folly: b73c3869541e86821df3c387eb0af5f65addfab4 glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 - GoogleAppMeasurement: dfe55efa543e899d906309eaaac6ca26d249862f - GoogleDataTransport: 9a8a16f79feffc7f42096743de2a7c4815e84020 - GoogleDataTransportCCTSupport: 0f39025e8cf51f168711bd3fb773938d7e62ddb5 - GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 - nanopb: 18003b5e52dab79db540fe93fe9579f399bd1ccd + GoogleAppMeasurement: c542a2feaac9ab98fd074e8f1a02c3585bbfbd47 + GoogleDataTransport: 8b0e733ea77c9218778e5a9e34ba9508b8328939 + GoogleUtilities: e1d9ed4e544fc32a93e00e721400cbc3f377200d + nanopb: 59221d7f958fb711001e6a449489542d92ae113e OpenSSL-Universal: ff34003318d5e1163e9529b08470708e389ffcdd Permission-Camera: 119b01de97a5b3edb637999e38476b68143b9d17 Permission-Contacts: b04d927dd11f31bb7131384c05ee416d154343f5 @@ -806,8 +799,7 @@ SPEC CHECKSUMS: Permission-LocationAlways: c083f45f28c4b78ddc6f9668cf1a984d879a80ec Permission-LocationWhenInUse: e2b8c40ce0f3675a521f26787ab47ebb9bace503 Permission-Notifications: 5c69bf2f6c1e30345af4f25e2981dc1c8dafbc22 - PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f - Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 + PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97 RCTRequired: 082f10cd3f905d6c124597fd1c14f6f2655ff65e RCTTypeSafety: 8c9c544ecbf20337d069e4ae7fd9a377aadf504b React: b0a957a2c44da4113b0c4c9853d8387f8e64e615 @@ -844,10 +836,10 @@ SPEC CHECKSUMS: RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495 RNDateTimePicker: a84d2b439666c9243d42a8396c588d4d1d36e3f3 RNDeviceInfo: b6e650fbd234732c759544218657d549b4339038 - RNFBAnalytics: 29bc4baf70da8dc04238d2e1c050367264d2f440 - RNFBApp: 7b539bb25520fa73d6a240f5c6ea569e27683645 - RNFBIid: 8f673a41f45f04273d0759c5df0aef113b580822 - RNFBMessaging: c55142d3b2d34d706bf12bd5eef9ef35254c2df1 + RNFBAnalytics: 454b17745d3824156cb906e2777d85f6848bf3e1 + RNFBApp: 02bde3edecf2e9694b908a5d3504e03449980f20 + RNFBIid: b804baf463a87bc0cb9539568ea72cce99d6f2c1 + RNFBMessaging: 1823217d31e942531cc3f51fb5367dcbc69c1e10 RNFS: c9bbde46b0d59619f8e7b735991c60e0f73d22c1 RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211 RNLocalize: 43f6c30d8e19ad92282ae434d310fb463b31f419 diff --git a/ios/edge.xcodeproj/project.pbxproj b/ios/edge.xcodeproj/project.pbxproj index 8465032d337..fe79e58be97 100644 --- a/ios/edge.xcodeproj/project.pbxproj +++ b/ios/edge.xcodeproj/project.pbxproj @@ -333,7 +333,7 @@ name = "[CP-User] [RNFB] Core Configuration"; runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "#!/usr/bin/env bash\n#\n# Copyright (c) 2016-present Invertase Limited & Contributors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this library except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\nset -e\n\n_MAX_LOOKUPS=2;\n_SEARCH_RESULT=''\n_RN_ROOT_EXISTS=''\n_CURRENT_LOOKUPS=1\n_JSON_ROOT=\"'react-native'\"\n_JSON_FILE_NAME='firebase.json'\n_JSON_OUTPUT_BASE64='e30=' # { }\n_CURRENT_SEARCH_DIR=${PROJECT_DIR}\n_PLIST_BUDDY=/usr/libexec/PlistBuddy\n_TARGET_PLIST=\"${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}\"\n_DSYM_PLIST=\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist\"\n\n# plist arrays\n_PLIST_ENTRY_KEYS=()\n_PLIST_ENTRY_TYPES=()\n_PLIST_ENTRY_VALUES=()\n\nfunction setPlistValue {\n echo \"info: setting plist entry '$1' of type '$2' in file '$4'\"\n ${_PLIST_BUDDY} -c \"Add :$1 $2 '$3'\" $4 || echo \"info: '$1' already exists\"\n}\n\nfunction getFirebaseJsonKeyValue () {\n if [[ ${_RN_ROOT_EXISTS} ]]; then\n ruby -e \"require 'rubygems';require 'json'; output=JSON.parse('$1'); puts output[$_JSON_ROOT]['$2']\"\n else\n echo \"\"\n fi;\n}\n\nfunction jsonBoolToYesNo () {\n if [[ $1 == \"false\" ]]; then\n echo \"NO\"\n elif [[ $1 == \"true\" ]]; then\n echo \"YES\"\n else echo \"NO\"\n fi\n}\n\necho \"info: -> RNFB build script started\"\necho \"info: 1) Locating ${_JSON_FILE_NAME} file:\"\n\nif [[ -z ${_CURRENT_SEARCH_DIR} ]]; then\n _CURRENT_SEARCH_DIR=$(pwd)\nfi;\n\nwhile true; do\n _CURRENT_SEARCH_DIR=$(dirname \"$_CURRENT_SEARCH_DIR\")\n if [[ \"$_CURRENT_SEARCH_DIR\" == \"/\" ]] || [[ ${_CURRENT_LOOKUPS} -gt ${_MAX_LOOKUPS} ]]; then break; fi;\n echo \"info: ($_CURRENT_LOOKUPS of $_MAX_LOOKUPS) Searching in '$_CURRENT_SEARCH_DIR' for a ${_JSON_FILE_NAME} file.\"\n _SEARCH_RESULT=$(find \"$_CURRENT_SEARCH_DIR\" -maxdepth 2 -name ${_JSON_FILE_NAME} -print | head -n 1)\n if [[ ${_SEARCH_RESULT} ]]; then\n echo \"info: ${_JSON_FILE_NAME} found at $_SEARCH_RESULT\"\n break;\n fi;\n _CURRENT_LOOKUPS=$((_CURRENT_LOOKUPS+1))\ndone\n\nif [[ ${_SEARCH_RESULT} ]]; then\n _JSON_OUTPUT_RAW=$(cat \"${_SEARCH_RESULT}\")\n _RN_ROOT_EXISTS=$(ruby -e \"require 'rubygems';require 'json'; output=JSON.parse('$_JSON_OUTPUT_RAW'); puts output[$_JSON_ROOT]\" || echo '')\n\n if [[ ${_RN_ROOT_EXISTS} ]]; then\n _JSON_OUTPUT_BASE64=$(python -c 'import json,sys,base64;print(base64.b64encode(json.dumps(json.loads(open('\"'${_SEARCH_RESULT}'\"').read())['${_JSON_ROOT}'])))' || echo \"e30=\")\n fi\n\n _PLIST_ENTRY_KEYS+=(\"firebase_json_raw\")\n _PLIST_ENTRY_TYPES+=(\"string\")\n _PLIST_ENTRY_VALUES+=(\"$_JSON_OUTPUT_BASE64\")\n\n # config.messaging_auto_init_enabled\n _MESSAGING_AUTO_INIT=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"messaging_auto_init_enabled\")\n if [[ $_MESSAGING_AUTO_INIT ]]; then\n _PLIST_ENTRY_KEYS+=(\"FirebaseMessagingAutoInitEnabled\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_MESSAGING_AUTO_INIT\")\")\n fi\n\n # config.crashlytics_disable_auto_disabler - undocumented for now - mainly for debugging, document if becomes usful\n _CRASHLYTICS_AUTO_DISABLE_ENABLED=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"crashlytics_disable_auto_disabler\")\n if [[ $_CRASHLYTICS_AUTO_DISABLE_ENABLED == \"true\" ]]; then\n echo \"Disabled Crashlytics auto disabler.\" # do nothing\n else\n _PLIST_ENTRY_KEYS+=(\"firebase_crashlytics_collection_enabled\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"NO\")\n fi\n\n # config.admob_delay_app_measurement_init\n _ADMOB_DELAY_APP_MEASUREMENT=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"admob_delay_app_measurement_init\")\n if [[ $_ADMOB_DELAY_APP_MEASUREMENT == \"true\" ]]; then\n _PLIST_ENTRY_KEYS+=(\"GADDelayAppMeasurementInit\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"YES\")\n fi\n\n # config.admob_ios_app_id\n _ADMOB_IOS_APP_ID=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"admob_ios_app_id\")\n if [[ $_ADMOB_IOS_APP_ID ]]; then\n _PLIST_ENTRY_KEYS+=(\"GADApplicationIdentifier\")\n _PLIST_ENTRY_TYPES+=(\"string\")\n _PLIST_ENTRY_VALUES+=(\"$_ADMOB_IOS_APP_ID\")\n fi\nelse\n _PLIST_ENTRY_KEYS+=(\"firebase_json_raw\")\n _PLIST_ENTRY_TYPES+=(\"string\")\n _PLIST_ENTRY_VALUES+=(\"$_JSON_OUTPUT_BASE64\")\n echo \"warning: A firebase.json file was not found, whilst this file is optional it is recommended to include it to configure firebase services in React Native Firebase.\"\nfi;\n\necho \"info: 2) Injecting Info.plist entries: \"\n\n# Log out the keys we're adding\nfor i in \"${!_PLIST_ENTRY_KEYS[@]}\"; do\n echo \" -> $i) ${_PLIST_ENTRY_KEYS[$i]}\" \"${_PLIST_ENTRY_TYPES[$i]}\" \"${_PLIST_ENTRY_VALUES[$i]}\"\ndone\n\nfor plist in \"${_TARGET_PLIST}\" \"${_DSYM_PLIST}\" ; do\n if [[ -f \"${plist}\" ]]; then\n\n # paths with spaces break the call to setPlistValue. temporarily modify\n # the shell internal field separator variable (IFS), which normally \n # includes spaces, to consist only of line breaks\n oldifs=$IFS\n IFS=\"\n\"\n\n for i in \"${!_PLIST_ENTRY_KEYS[@]}\"; do\n setPlistValue \"${_PLIST_ENTRY_KEYS[$i]}\" \"${_PLIST_ENTRY_TYPES[$i]}\" \"${_PLIST_ENTRY_VALUES[$i]}\" \"${plist}\"\n done\n\n # restore the original internal field separator value\n IFS=$oldifs\n else\n echo \"warning: A Info.plist build output file was not found (${plist})\"\n fi\ndone\n\necho \"info: <- RNFB build script finished\"\n\n"; + shellScript = "#!/usr/bin/env bash\n#\n# Copyright (c) 2016-present Invertase Limited & Contributors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this library except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\nset -e\n\n_MAX_LOOKUPS=2;\n_SEARCH_RESULT=''\n_RN_ROOT_EXISTS=''\n_CURRENT_LOOKUPS=1\n_JSON_ROOT=\"'react-native'\"\n_JSON_FILE_NAME='firebase.json'\n_JSON_OUTPUT_BASE64='e30=' # { }\n_CURRENT_SEARCH_DIR=${PROJECT_DIR}\n_PLIST_BUDDY=/usr/libexec/PlistBuddy\n_TARGET_PLIST=\"${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}\"\n_DSYM_PLIST=\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist\"\n\n# plist arrays\n_PLIST_ENTRY_KEYS=()\n_PLIST_ENTRY_TYPES=()\n_PLIST_ENTRY_VALUES=()\n\nfunction setPlistValue {\n echo \"info: setting plist entry '$1' of type '$2' in file '$4'\"\n ${_PLIST_BUDDY} -c \"Add :$1 $2 '$3'\" $4 || echo \"info: '$1' already exists\"\n}\n\nfunction getFirebaseJsonKeyValue () {\n if [[ ${_RN_ROOT_EXISTS} ]]; then\n ruby -e \"require 'rubygems';require 'json'; output=JSON.parse('$1'); puts output[$_JSON_ROOT]['$2']\"\n else\n echo \"\"\n fi;\n}\n\nfunction jsonBoolToYesNo () {\n if [[ $1 == \"false\" ]]; then\n echo \"NO\"\n elif [[ $1 == \"true\" ]]; then\n echo \"YES\"\n else echo \"NO\"\n fi\n}\n\necho \"info: -> RNFB build script started\"\necho \"info: 1) Locating ${_JSON_FILE_NAME} file:\"\n\nif [[ -z ${_CURRENT_SEARCH_DIR} ]]; then\n _CURRENT_SEARCH_DIR=$(pwd)\nfi;\n\nwhile true; do\n _CURRENT_SEARCH_DIR=$(dirname \"$_CURRENT_SEARCH_DIR\")\n if [[ \"$_CURRENT_SEARCH_DIR\" == \"/\" ]] || [[ ${_CURRENT_LOOKUPS} -gt ${_MAX_LOOKUPS} ]]; then break; fi;\n echo \"info: ($_CURRENT_LOOKUPS of $_MAX_LOOKUPS) Searching in '$_CURRENT_SEARCH_DIR' for a ${_JSON_FILE_NAME} file.\"\n _SEARCH_RESULT=$(find \"$_CURRENT_SEARCH_DIR\" -maxdepth 2 -name ${_JSON_FILE_NAME} -print | head -n 1)\n if [[ ${_SEARCH_RESULT} ]]; then\n echo \"info: ${_JSON_FILE_NAME} found at $_SEARCH_RESULT\"\n break;\n fi;\n _CURRENT_LOOKUPS=$((_CURRENT_LOOKUPS+1))\ndone\n\nif [[ ${_SEARCH_RESULT} ]]; then\n _JSON_OUTPUT_RAW=$(cat \"${_SEARCH_RESULT}\")\n _RN_ROOT_EXISTS=$(ruby -e \"require 'rubygems';require 'json'; output=JSON.parse('$_JSON_OUTPUT_RAW'); puts output[$_JSON_ROOT]\" || echo '')\n\n if [[ ${_RN_ROOT_EXISTS} ]]; then\n _JSON_OUTPUT_BASE64=$(python -c 'import json,sys,base64;print(base64.b64encode(json.dumps(json.loads(open('\"'${_SEARCH_RESULT}'\"').read())['${_JSON_ROOT}'])))' || echo \"e30=\")\n fi\n\n _PLIST_ENTRY_KEYS+=(\"firebase_json_raw\")\n _PLIST_ENTRY_TYPES+=(\"string\")\n _PLIST_ENTRY_VALUES+=(\"$_JSON_OUTPUT_BASE64\")\n\n # config.analytics_auto_collection_enabled\n _ANALYTICS_AUTO_COLLECTION=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"analytics_auto_collection_enabled\")\n if [[ $_ANALYTICS_AUTO_COLLECTION ]]; then\n _PLIST_ENTRY_KEYS+=(\"FIREBASE_ANALYTICS_COLLECTION_ENABLED\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_ANALYTICS_AUTO_COLLECTION\")\")\n fi\n\n # config.perf_auto_collection_enabled\n _PERF_AUTO_COLLECTION=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"perf_auto_collection_enabled\")\n if [[ $_PERF_AUTO_COLLECTION ]]; then\n _PLIST_ENTRY_KEYS+=(\"firebase_performance_collection_enabled\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_PERF_AUTO_COLLECTION\")\")\n fi\n\n # config.messaging_auto_init_enabled\n _MESSAGING_AUTO_INIT=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"messaging_auto_init_enabled\")\n if [[ $_MESSAGING_AUTO_INIT ]]; then\n _PLIST_ENTRY_KEYS+=(\"FirebaseMessagingAutoInitEnabled\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"$(jsonBoolToYesNo \"$_MESSAGING_AUTO_INIT\")\")\n fi\n\n # config.crashlytics_disable_auto_disabler - undocumented for now - mainly for debugging, document if becomes useful\n _CRASHLYTICS_AUTO_DISABLE_ENABLED=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"crashlytics_disable_auto_disabler\")\n if [[ $_CRASHLYTICS_AUTO_DISABLE_ENABLED == \"true\" ]]; then\n echo \"Disabled Crashlytics auto disabler.\" # do nothing\n else\n _PLIST_ENTRY_KEYS+=(\"FirebaseCrashlyticsCollectionEnabled\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"NO\")\n fi\n\n # config.admob_delay_app_measurement_init\n _ADMOB_DELAY_APP_MEASUREMENT=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"admob_delay_app_measurement_init\")\n if [[ $_ADMOB_DELAY_APP_MEASUREMENT == \"true\" ]]; then\n _PLIST_ENTRY_KEYS+=(\"GADDelayAppMeasurementInit\")\n _PLIST_ENTRY_TYPES+=(\"bool\")\n _PLIST_ENTRY_VALUES+=(\"YES\")\n fi\n\n # config.admob_ios_app_id\n _ADMOB_IOS_APP_ID=$(getFirebaseJsonKeyValue \"$_JSON_OUTPUT_RAW\" \"admob_ios_app_id\")\n if [[ $_ADMOB_IOS_APP_ID ]]; then\n _PLIST_ENTRY_KEYS+=(\"GADApplicationIdentifier\")\n _PLIST_ENTRY_TYPES+=(\"string\")\n _PLIST_ENTRY_VALUES+=(\"$_ADMOB_IOS_APP_ID\")\n fi\nelse\n _PLIST_ENTRY_KEYS+=(\"firebase_json_raw\")\n _PLIST_ENTRY_TYPES+=(\"string\")\n _PLIST_ENTRY_VALUES+=(\"$_JSON_OUTPUT_BASE64\")\n echo \"warning: A firebase.json file was not found, whilst this file is optional it is recommended to include it to configure firebase services in React Native Firebase.\"\nfi;\n\necho \"info: 2) Injecting Info.plist entries: \"\n\n# Log out the keys we're adding\nfor i in \"${!_PLIST_ENTRY_KEYS[@]}\"; do\n echo \" -> $i) ${_PLIST_ENTRY_KEYS[$i]}\" \"${_PLIST_ENTRY_TYPES[$i]}\" \"${_PLIST_ENTRY_VALUES[$i]}\"\ndone\n\nfor plist in \"${_TARGET_PLIST}\" \"${_DSYM_PLIST}\" ; do\n if [[ -f \"${plist}\" ]]; then\n\n # paths with spaces break the call to setPlistValue. temporarily modify\n # the shell internal field separator variable (IFS), which normally\n # includes spaces, to consist only of line breaks\n oldifs=$IFS\n IFS=\"\n\"\n\n for i in \"${!_PLIST_ENTRY_KEYS[@]}\"; do\n setPlistValue \"${_PLIST_ENTRY_KEYS[$i]}\" \"${_PLIST_ENTRY_TYPES[$i]}\" \"${_PLIST_ENTRY_VALUES[$i]}\" \"${plist}\"\n done\n\n # restore the original internal field separator value\n IFS=$oldifs\n else\n echo \"warning: A Info.plist build output file was not found (${plist})\"\n fi\ndone\n\necho \"info: <- RNFB build script finished\"\n"; }; 66E3B72D0FE8946FF30D15F8 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; diff --git a/ios/edge/GoogleService-Info.plist b/ios/edge/GoogleService-Info.plist index 5fe933bb3b6..018e7e577fa 100644 --- a/ios/edge/GoogleService-Info.plist +++ b/ios/edge/GoogleService-Info.plist @@ -13,7 +13,7 @@ REVERSED_CLIENT_ID com.googleusercontent.apps.12345678990-replacethisfilereplacethisfilenow API_KEY - replacethisfilereplacethisfilereplaceme + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA GCM_SENDER_ID replacemeok PLIST_VERSION diff --git a/package.json b/package.json index 82181283a23..77fc54b6079 100644 --- a/package.json +++ b/package.json @@ -119,10 +119,10 @@ "@react-native-community/clipboard": "^1.5.1", "@react-native-community/datetimepicker": "^3.0.2", "@react-native-community/netinfo": "^5.9.10", - "@react-native-firebase/analytics": "^6.0.0", - "@react-native-firebase/app": "^6.0.0", - "@react-native-firebase/iid": "^6.0.0", - "@react-native-firebase/messaging": "^6.0.0", + "@react-native-firebase/analytics": "^10.0.0", + "@react-native-firebase/app": "^10.0.0", + "@react-native-firebase/iid": "^10.0.0", + "@react-native-firebase/messaging": "^10.0.0", "async-lock": "^1.1.2", "biggystring": "^3.0.2", "cleaners": "^0.3.7", diff --git a/yarn.lock b/yarn.lock index 5042ea17f91..e474c504cc2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2180,34 +2180,28 @@ resolved "https://registry.yarnpkg.com/@react-native-community/netinfo/-/netinfo-5.9.10.tgz#97d3a9fa62a3a4838ec7a6ec91cfec5a26e365b6" integrity sha512-1NPlBA2Hu/KWc3EnQcDRPRX0x8Dg9tuQlQQVWVQjlg+u+PjCq7ANEtbikOFKp5yQqfF8tqzU5+84/IfDO8zpiA== -"@react-native-firebase/analytics@^6.0.0": - version "6.7.2" - resolved "https://registry.yarnpkg.com/@react-native-firebase/analytics/-/analytics-6.7.2.tgz#5f5d6cdefbee09e2a45e33e8dbf55cbc3452c64b" - integrity sha512-PKNTvufrQ6ZTsjVzMyCzZncy14PsnSQqqGFXeoMK+Jwa3byJaz8rwVmgeGEwKUkcWQOmEQA0KxmIKjXHLeUskw== - -"@react-native-firebase/app-types@6.7.1": - version "6.7.1" - resolved "https://registry.yarnpkg.com/@react-native-firebase/app-types/-/app-types-6.7.1.tgz#93497885e6c112203db310636616647c16478da9" - integrity sha512-jfP2wdBUaptGXO6BC0g3RYMgmGLGOkdWhkGxPhZZy1uxIxN4IXPfeUKEPL0as6ZJqfdx0IMvSvtcp7ywoFNxyg== - -"@react-native-firebase/app@^6.0.0": - version "6.7.1" - resolved "https://registry.yarnpkg.com/@react-native-firebase/app/-/app-6.7.1.tgz#0fe8bb9a82292d672da524763dc42e224dda4fde" - integrity sha512-MzRlcR+5+RCU3Za+QMV064oPpZhkXvLoZbB8CdYxI66Qd2XKAGUT0FoQlFaeXZxkrfisdhLbvRUYJo1TY/Iuxg== - dependencies: - "@react-native-firebase/app-types" "6.7.1" +"@react-native-firebase/analytics@^10.0.0": + version "10.8.1" + resolved "https://registry.yarnpkg.com/@react-native-firebase/analytics/-/analytics-10.8.1.tgz#293c3e483fbb77a181803e9b5a766c87e0d466d8" + integrity sha512-6fw3TwV7PbdelLND0yBqrnneHxGzqaXtCMLUYaklO55iCBi8dzX2eT3ouyI3IvtS/qYrF7ruEpvMeM4gUVcdqw== + +"@react-native-firebase/app@^10.0.0": + version "10.8.1" + resolved "https://registry.yarnpkg.com/@react-native-firebase/app/-/app-10.8.1.tgz#3455f491a5fc3d91677fd69e70b006a68fb7ca5c" + integrity sha512-EHbFGCbRdZMxSbdq5YCc47E9C+ckzsMeZdknJbSddTYJ9JxPDiorUyoHFOUCAHS2ZoklhpdlrU5zGNzxpBgDUw== + dependencies: opencollective-postinstall "^2.0.1" superstruct "^0.6.2" -"@react-native-firebase/iid@^6.0.0": - version "6.7.1" - resolved "https://registry.yarnpkg.com/@react-native-firebase/iid/-/iid-6.7.1.tgz#965c13edbe32c16a6bb0c8904dd993c866abec8b" - integrity sha512-7sBXpw08lcP1KLIIhdzvALdZUp9xcDj87oy6w+bWKlX5I3EcVSPfPkrG6nihaWfJGSFLiIa17v31tsY6L+ZTgg== +"@react-native-firebase/iid@^10.0.0": + version "10.8.1" + resolved "https://registry.yarnpkg.com/@react-native-firebase/iid/-/iid-10.8.1.tgz#6a89144e3463854332afc4a0d2022c108ae8887d" + integrity sha512-vrstWXYiFkWXIF0zUQqWW9WEA2NfpjY9eNVBrp6O+yqad2wyUgbFq5pU9Nx9S4QLrwK93/QlwwFB5wHuMCATcw== -"@react-native-firebase/messaging@^6.0.0": - version "6.7.1" - resolved "https://registry.yarnpkg.com/@react-native-firebase/messaging/-/messaging-6.7.1.tgz#d53b73791567366d95fb423f094e2057027cc9fa" - integrity sha512-j5aSUtdWapnfYCu57wAZ/xBWfh/ym68veplA/Fs+lTtKnBGmrFB5qbW2lKN0gRENC1MloOkD57rnLHEr5tTvUA== +"@react-native-firebase/messaging@^10.0.0": + version "10.8.1" + resolved "https://registry.yarnpkg.com/@react-native-firebase/messaging/-/messaging-10.8.1.tgz#da9e0db91645e70e7853e5b91c06771fffbea8bb" + integrity sha512-DVgibb4XERG+5TQQiHKJ1qF+5cbpfiKGRFze9WcbE+FxSYwNMIzyt6u3l7WMBLz6wXcqAq3zLRo6SBbSt37uDw== "@sindresorhus/is@^0.14.0": version "0.14.0" From 8d3e686ff7214e2c3d55a73b76331e80182793ea Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Wed, 21 Apr 2021 17:49:08 +0300 Subject: [PATCH 026/110] FIX. Search outlined field prefix and suffix. --- src/components/themed/EdgeTextField.js | 41 +++++++------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/src/components/themed/EdgeTextField.js b/src/components/themed/EdgeTextField.js index fff459dc35e..b2ae5acccae 100644 --- a/src/components/themed/EdgeTextField.js +++ b/src/components/themed/EdgeTextField.js @@ -52,28 +52,14 @@ class EdgeTextFieldOutlinedComponent extends React.PureComponent { - const { fieldRef, value } = this.props - if (fieldRef && fieldRef.current) { - return !fieldRef.current.focused - } - return value == null - } - render() { const { isClearable, marginRem = 0.5, small, theme, ...rest } = this.props const spacings = spacingStyles(marginRem, theme) const styles = getStyles(theme) - const searchContentInset = this.showSearchIcon() ? { left: theme.rem(2.25) } : null - const contentInset = small ? { input: theme.rem(0.75), label: 0, ...searchContentInset } : searchContentInset + const contentInset = small ? { input: theme.rem(0.75), label: 0 } : null return ( - {this.showSearchIcon() ? ( - - - - ) : null} } + suffix={ + isClearable && ( + + + + ) + } {...rest} /> - {isClearable && ( - - - - )} ) } @@ -119,17 +108,7 @@ const getStyles = cacheStyles((theme: Theme) => ({ paddingLeft: theme.rem(2) }, outlinedTextFieldClearContainer: { - position: 'absolute', - right: 0, - paddingHorizontal: theme.rem(0.75), - justifyContent: 'center', - paddingBottom: theme.rem(0.25) // This is needed because the OutlinedTextField also has innate padding/margin/height on the bottom - }, - search: { - position: 'absolute', - left: 0, - paddingHorizontal: theme.rem(0.75), - paddingBottom: theme.rem(0.5) + paddingTop: theme.rem(0.125) } })) export const EdgeTextField = withTheme(EdgeTextFieldComponent) From 10a7d851db8e3587e29e17b86aa7d1d4d819c859 Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Wed, 21 Apr 2021 20:56:03 +0300 Subject: [PATCH 027/110] Changed icons in help modal. --- android/app/src/main/assets/fonts/custom.ttf | Bin 10180 -> 12284 bytes src/assets/vector/config.json | 176 ++++++------------- src/components/modals/HelpModal.js | 11 +- 3 files changed, 59 insertions(+), 128 deletions(-) mode change 100755 => 100644 android/app/src/main/assets/fonts/custom.ttf diff --git a/android/app/src/main/assets/fonts/custom.ttf b/android/app/src/main/assets/fonts/custom.ttf old mode 100755 new mode 100644 index 5981318c192792e072147b70cb054837bc00ae3b..6eb665e46c463da08b6983903d5d4585acbf116f GIT binary patch delta 2860 zcmb_eX-pg09e>B1K4yH4$Hrh|8^(aa#>NMMV9W-xi|q{wEZ0K9I)ng`32vYX-6Kx6 zN!sRUH)YYTw%3=cin6O!+9*j??T1yHt&qB^l&X!YYNg&4>W5y^s;Sh3{>L9W(byH&p#Kq0h-Xm!*Iy#azxBL)F5;-JTfY?-%ewzm=5LR+fd!-2t8U+oFRFo*@2 zM*Ai6H9HLu zeoQ|{*O%l6H+zHxU%5rQC=VW9)Q);kUp5oOlwn{-q#&?_q0D(i2|bSpN6y2vxbr+F z2%U__?6%HytS8>n8ur(_T{f@XTPt#EIGw>hoKAT$Cu1%U#SyFqw4^nWiaQmngR^^a zFIJrytVOXFka0!A=>P{7XFLU7+AUt;&wQ3wBqFTycK%BOdB-5j4q3hchRV6B;dS1| zzb4?f!JtUeltB39Wu90R?iG%Eg?D^iHjoLUBpV)HGsxr}0rSVJX8vW}tbAj~u;YYo z&RV*d3Pou98jVp0q@Ra0B3Bb`^ecX~LkZdg5>Ys(3a8SM2x6Ctk5}^nVX?Oy6KHAK@_uiq*%0!gio%D#NjA9N%oGR7!P9K@xt5MY%37D0PN%SPW zb=2jW*wu3+)7wi+?Gr1R{6!tM=^IAR?l)}5qv2Sb`h~W&yFLO z&8K7BQ^%&ecB?;>*1@eGd zSMd_5x&w(CH3@^t3w7tveL5fo=~Pl@5U&@bZcrpF6A3UQxQYz7YM)Hur$a*(U!WN? zKlx%XAM|%fJTbJH%Zp_aZRM#Yd6Fsqv}-@PH6PlJgUp@ zNk~zVGis5z+Lh`{%`*7+q9XEwefoqEvjR(b*1$kojIYi;%Q{4^=YWY2%D}~&C`&7Z zh(UjnBS0JQB3lN*X3w^~{pgJum9@xSnnSaXHp{YXW(XhdH7LC5X?M0cM(qaE#o87( z$1}E3ciO7T?KO@4H8zHdX3^#zwb<)goYbOq4NPDE+EtdfDvUAy?xM^Zc#MIml$TfU zcD^K5SdKQV?KK-X7HCd@>nzL4yW_EX2F8@5Jcsm6bo*2E*K`<0Dr}cQc=u71L|v#4 z4WfN$6ivaqK8i}{1To}qh)_B5OoN*;=)|$X-3)eG>` za&mG9IbVZ;gupU4zMux2yoY5R#yYW<)%T@&zhV#=w%%qjL5f*2Z}(Zv3=O(uFC)3B z^lzEEXONq^hdlX8by~xZFL>9tY#vdb_D6v+7iIqy$aWkf}mq;$ah9Py$xP!z+ zT>xEOSne^h^dw}zQhCyJC5evjOq@!92a{(dDh+wE|If8ULbEdqmHC6yV`KY=a=GsA zaM?{)2T#9tUVkJ zN84JpMqkhu4ESAMm)EJ-ZK8mz*wRqlz9i!Cl6ZzBA|!}AoN7?RNxfE~lGR|c5>kRG z*bG#?s`Vg;EBXP*4jw)ka-ILDWL59?Rpu&fdO~ z&tJLy!JW(b{N+1`9~CZ9+bKW3*Oax}j5T(;nSax4wf8n{vbNz%LdAc|*17p@+uf#K zhei7Bn?|U*4?o%@bE7&PjO(N=!q>15IOEC_Ak=m|2*jf zc<#eL76$wAOV{OHny)UucWC3|>%Lm8>kk{ldtN`#KlsK*|7G1)=evHb&Zq5?|Gu#= zpW7%5K9hU4uy@b!ukzXUsY`visfTan`l5%f^cJQfJ0B)}PksOF{GAzj_s2-4)t{h` zzGXM*->sc~`xu*qzp+h66x-JyICc-~PXFC>SDeG&CmHfx+CrbFzhmBI?{gD;mM`(Y z5mto<;zh%&rXKxK$d1;LM~^@RJ%i4nD=_-$&Ev{1383$Dc?E36Hf+a^^^(iYb1Tay uR@-9h7hRtYi3@Y3^339qxuU5$(*IXi=2myqv&B-0oi8mPp8JmbuJkYYF#Cl7 delta 702 zcmYL`O-NKx6vxlG_r7YBNN`}OR1cj>>QDCi z0A2xro`G~M(_Z`IGVu!l78n@M`bei%u9GnaGl_Kn$-Ude6@+>sHku*bMJ&i`iPY5K z(x0DH%RiI+F&U5DtW2{#0QVy0LrD^}dGVTfgZOwdot-?>J5M3FcgciPBLgvS#GC*q z4HEm(vB?b18C%5NHV?rgcV!Bz~NYV=~6TQwVyyA2F96;%gAE!bFATH-G` zk5wqSfzodVx@!0_Gk`hOrpa+= { } + icon={} title={s.strings.help_knowledge_base} subTitle={s.strings.help_knowledge_base_text} onPress={() => showWebViewModal(HELP_URIS.knowledgeBase, s.strings.help_knowledge_base)} @@ -88,7 +88,7 @@ class HelpModalComponent extends React.Component { /> } + icon={} title={s.strings.help_support} subTitle={s.strings.help_support_text} onPress={() => showWebViewModal(HELP_URIS.support, s.strings.help_support)} @@ -99,7 +99,7 @@ class HelpModalComponent extends React.Component { /> } + icon={} title={s.strings.help_call} subTitle={s.strings.help_call_text} onPress={() => Linking.openURL(`tel:${HELP_URIS.call}`)} @@ -110,7 +110,7 @@ class HelpModalComponent extends React.Component { /> } + icon={} title={s.strings.help_site} subTitle={s.strings.help_site_text} onPress={() => showWebViewModal(HELP_URIS.site, s.strings.help_site_text)} @@ -131,6 +131,7 @@ class HelpModalComponent extends React.Component { const getStyles = cacheStyles((theme: Theme) => ({ titleContainer: { + marginTop: theme.rem(0.5), flexDirection: 'column', justifyContent: 'center', alignItems: 'center' From 19ca13377682ca6fe27850f52005f8926127cdb3 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Tue, 20 Apr 2021 14:16:04 -0700 Subject: [PATCH 028/110] Upgrade to react-native v0.64.0 --- .flowconfig | 5 +- .gitattributes | 4 +- README.md | 19 +- android/app/build.gradle | 5 +- android/app/src/debug/AndroidManifest.xml | 7 +- android/app/src/main/AndroidManifest.xml | 2 - android/app/src/main/res/values/styles.xml | 2 +- android/build.gradle | 7 +- android/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/gradlew | 2 + android/gradlew.bat | 22 +- ios/Podfile | 13 +- ios/Podfile.lock | 629 +- ios/edge.xcodeproj/project.pbxproj | 23 + ios/edge/AppDelegate.m | 6 +- metro.config.js | 2 +- package.json | 18 +- patches/react-native-fast-crypto+2.0.0.patch | 18 +- yarn.lock | 5157 +++++++---------- 20 files changed, 2539 insertions(+), 3406 deletions(-) diff --git a/.flowconfig b/.flowconfig index 6b9fe99c8be..d2dc27bc10f 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,6 +1,7 @@ [ignore] ; Edge additions .*/node_modules/edge-plugin-bity/.* +.*/node_modules/metro/.* .*/node_modules/react-native-camera/.* .*/node_modules/react-native-keyboard-aware-scroll-view/.* .*/node_modules/react-native-permissions/.* @@ -15,10 +16,6 @@ ; Ignore polyfills node_modules/react-native/Libraries/polyfills/.* -; These should not be required directly -; require from fbjs/lib instead: require('fbjs/lib/warning') -node_modules/warning/.* - ; Flow doesn't support platforms .*/Libraries/Utilities/LoadingView.js diff --git a/.gitattributes b/.gitattributes index d42ff18354d..45a3dcb2a20 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,3 @@ -*.pbxproj -text +# Windows files should use crlf line endings +# https://help.github.com/articles/dealing-with-line-endings/ +*.bat text eol=crlf diff --git a/README.md b/README.md index 18481992b9f..b26f67ff85a 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Edge is known to build with this exact tool set. Updated versions of these tools yarn ### Run the bundler - + yarn start ### XCode Setup - Use Legacy Build System @@ -163,22 +163,7 @@ Run deploy ## Debugging -For debugging, we recommend using [React Native Debugger](https://github.com/jhen0409/react-native-debugger). The current latest version (0.11) works well. - -### Installation - -You can download React Native Debgger 0.10.11 at -[https://github.com/jhen0409/react-native-debugger/releases/tag/v0.10.11](https://github.com/jhen0409/react-native-debugger/releases/tag/v0.10.11). - -#### Debugging in iOS Simulator - - ⌘ + d (command + d) - Select "Debug JS Remotely" - -#### Debugging in Android Emulator (GenyMotion / Android Studios) - - ⌘ + m (command + m) - Select "Debug JS Remotely" +As with any modern React Native app, [Flipper](https://fbflipper.com/) is the officially-supported debugging app. Use the "React Native Hermes Debugger" to debug Javascript running in the UI. ## Contributing diff --git a/android/app/build.gradle b/android/app/build.gradle index e153ca899d3..a61802a8162 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -121,6 +121,8 @@ def jscFlavor = 'org.webkit:android-jsc:+' def enableHermes = project.ext.react.get("enableHermes", false); android { + ndkVersion rootProject.ext.ndkVersion + compileSdkVersion rootProject.ext.compileSdkVersion compileOptions { @@ -163,11 +165,12 @@ android { variant.outputs.each { output -> // For each separate APK per architecture, set a unique version code as described here: // https://developer.android.com/studio/build/configure-apk-splits.html + // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = - versionCodes.get(abi) * 1048576 + defaultConfig.versionCode + defaultConfig.versionCode * 1000 + versionCodes.get(abi) } } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index fa26aa56e1c..b2f3ad9fce9 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -4,5 +4,10 @@ - + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 4e92b5f742c..81f856b614b 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -123,7 +123,5 @@ - - diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 08f1fba4b76..bb0702ee5a1 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,7 +1,7 @@ -