Skip to content

Commit

Permalink
Merge branch 'main' into fix/822-delete-collectible-media-reproductor
Browse files Browse the repository at this point in the history
  • Loading branch information
tommasini authored Jul 7, 2023
2 parents 4bc772b + 89249a5 commit e31c8bb
Show file tree
Hide file tree
Showing 32 changed files with 270 additions and 180 deletions.
10 changes: 6 additions & 4 deletions app/components/UI/AccountInfoCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import { QR_HARDWARE_WALLET_DEVICE } from '../../../constants/keyringTypes';
import Device from '../../../util/device';
import { ThemeContext, mockTheme } from '../../../util/theme';
import { selectTicker } from '../../../selectors/networkController';
import {
selectConversionRate,
selectCurrentCurrency,
} from '../../../selectors/currencyRateController';
import ApproveTransactionHeader from '../ApproveTransactionHeader';

const createStyles = (colors) =>
Expand Down Expand Up @@ -236,10 +240,8 @@ class AccountInfoCard extends PureComponent {
const mapStateToProps = (state) => ({
accounts: state.engine.backgroundState.AccountTrackerController.accounts,
identities: state.engine.backgroundState.PreferencesController.identities,
conversionRate:
state.engine.backgroundState.CurrencyRateController.conversionRate,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
conversionRate: selectConversionRate(state),
currentCurrency: selectCurrentCurrency(state),
ticker: selectTicker(state),
transaction: getNormalizedTxState(state),
activeTabUrl: getActiveTabUrl(state),
Expand Down
4 changes: 2 additions & 2 deletions app/components/UI/AccountOverview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import Analytics from '../../../core/Analytics/Analytics';
import AppConstants from '../../../core/AppConstants';
import Engine from '../../../core/Engine';
import { selectNetwork } from '../../../selectors/networkController';
import { selectCurrentCurrency } from '../../../selectors/currencyRateController';
import { createAccountSelectorNavDetails } from '../../Views/AccountSelector';

const createStyles = (colors) =>
Expand Down Expand Up @@ -454,8 +455,7 @@ const mapStateToProps = (state) => ({
selectedAddress:
state.engine.backgroundState.PreferencesController.selectedAddress,
identities: state.engine.backgroundState.PreferencesController.identities,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
currentCurrency: selectCurrentCurrency(state),
network: String(selectNetwork(state)),
browserTabs: state.browser.tabs,
});
Expand Down
4 changes: 2 additions & 2 deletions app/components/UI/DrawerView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ import {
selectProviderConfig,
selectTicker,
} from '../../../selectors/networkController';
import { selectCurrentCurrency } from '../../../selectors/currencyRateController';

import { createAccountSelectorNavDetails } from '../../Views/AccountSelector';
import NetworkInfo from '../NetworkInfo';
Expand Down Expand Up @@ -1244,8 +1245,7 @@ const mapStateToProps = (state) => ({
identities: state.engine.backgroundState.PreferencesController.identities,
frequentRpcList:
state.engine.backgroundState.PreferencesController.frequentRpcList,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
currentCurrency: selectCurrentCurrency(state),
keyrings: state.engine.backgroundState.KeyringController.keyrings,
networkModalVisible: state.modals.networkModalVisible,
receiveModalVisible: state.modals.receiveModalVisible,
Expand Down
10 changes: 6 additions & 4 deletions app/components/UI/Notification/TransactionNotification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ import {
selectChainId,
selectTicker,
} from '../../../../selectors/networkController';
import {
selectConversionRate,
selectCurrentCurrency,
} from '../../../../selectors/currencyRateController';

const WINDOW_WIDTH = Dimensions.get('window').width;
const ACTION_CANCEL = 'cancel';
Expand Down Expand Up @@ -428,10 +432,8 @@ const mapStateToProps = (state) => ({
collectibleContracts: collectibleContractsSelector(state),
contractExchangeRates:
state.engine.backgroundState.TokenRatesController.contractExchangeRates,
conversionRate:
state.engine.backgroundState.CurrencyRateController.conversionRate,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
conversionRate: selectConversionRate(state),
currentCurrency: selectCurrentCurrency(state),
primaryCurrency: state.settings.primaryCurrency,
swapsTransactions:
state.engine.backgroundState.TransactionController.swapsTransactions || {},
Expand Down
4 changes: 2 additions & 2 deletions app/components/UI/OnboardingWizard/Step3/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import AnalyticsV2 from '../../../../util/analyticsV2';
import { useTheme } from '../../../../util/theme';
import generateTestId from '../../../../../wdio/utils/generateTestId';
import { ONBOARDING_WIZARD_THIRD_STEP_CONTENT_ID } from '../../../../../wdio/screen-objects/testIDs/Components/OnboardingWizard.testIds';
import { selectCurrentCurrency } from '../../../../selectors/currencyRateController';

const styles = StyleSheet.create({
main: {
Expand Down Expand Up @@ -128,8 +129,7 @@ Step3.propTypes = {

const mapStateToProps = (state) => ({
accounts: state.engine.backgroundState.AccountTrackerController.accounts,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
currentCurrency: selectCurrentCurrency(state),
selectedAddress:
state.engine.backgroundState.PreferencesController.selectedAddress,
identities: state.engine.backgroundState.PreferencesController.identities,
Expand Down
10 changes: 6 additions & 4 deletions app/components/UI/PaymentRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ import {
selectChainId,
selectTicker,
} from '../../../selectors/networkController';
import {
selectConversionRate,
selectCurrentCurrency,
} from '../../../selectors/currencyRateController';
import generateTestId from '../../../../wdio/utils/generateTestId';
import {
REQUEST_AMOUNT_INPUT,
Expand Down Expand Up @@ -878,10 +882,8 @@ class PaymentRequest extends PureComponent {
PaymentRequest.contextType = ThemeContext;

const mapStateToProps = (state) => ({
conversionRate:
state.engine.backgroundState.CurrencyRateController.conversionRate,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
conversionRate: selectConversionRate(state),
currentCurrency: selectCurrentCurrency(state),
contractExchangeRates:
state.engine.backgroundState.TokenRatesController.contractExchangeRates,
searchEngine: state.settings.searchEngine,
Expand Down
10 changes: 6 additions & 4 deletions app/components/UI/Swaps/QuotesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ import {
selectChainId,
selectTicker,
} from '../../../selectors/networkController';
import {
selectConversionRate,
selectCurrentCurrency,
} from '../../../selectors/currencyRateController';
import { resetTransaction, setRecipient } from '../../../actions/transaction';

const POLLING_INTERVAL = 30000;
Expand Down Expand Up @@ -2346,10 +2350,8 @@ const mapStateToProps = (state) => ({
state.engine.backgroundState.PreferencesController.selectedAddress,
balances:
state.engine.backgroundState.TokenBalancesController.contractBalances,
conversionRate:
state.engine.backgroundState.CurrencyRateController.conversionRate,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
conversionRate: selectConversionRate(state),
currentCurrency: selectCurrentCurrency(state),
isInPolling: state.engine.backgroundState.SwapsController.isInPolling,
quotesLastFetched:
state.engine.backgroundState.SwapsController.quotesLastFetched,
Expand Down
14 changes: 8 additions & 6 deletions app/components/UI/Swaps/components/GasEditModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ import {
selectChainId,
selectTicker,
} from '../../../../selectors/networkController';
import {
selectConversionRate,
selectCurrentCurrency,
selectNativeCurrency,
} from '../../../../selectors/currencyRateController';

const GAS_OPTIONS = AppConstants.GAS_OPTIONS;

Expand Down Expand Up @@ -545,12 +550,9 @@ GasEditModal.propTypes = {
animateOnChange: PropTypes.bool,
};
const mapStateToProps = (state) => ({
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
conversionRate:
state.engine.backgroundState.CurrencyRateController.conversionRate,
nativeCurrency:
state.engine.backgroundState.CurrencyRateController.nativeCurrency,
conversionRate: selectConversionRate(state),
currentCurrency: selectCurrentCurrency(state),
nativeCurrency: selectNativeCurrency(state),
ticker: selectTicker(state),
chainId: selectChainId(state),
primaryCurrency: state.settings.primaryCurrency,
Expand Down
10 changes: 6 additions & 4 deletions app/components/UI/Swaps/components/QuotesModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ import Text from '../../../Base/Text';
import Title from '../../../Base/Title';
import Ratio from './Ratio';
import { useTheme } from '../../../../util/theme';
import {
selectConversionRate,
selectCurrentCurrency,
} from '../../../../selectors/currencyRateController';

const createStyles = (colors, shadows) =>
StyleSheet.create({
Expand Down Expand Up @@ -525,10 +529,8 @@ QuotesModal.propTypes = {
};

const mapStateToProps = (state) => ({
conversionRate:
state.engine.backgroundState.CurrencyRateController.conversionRate,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
conversionRate: selectConversionRate(state),
currentCurrency: selectCurrentCurrency(state),
quoteValues: state.engine.backgroundState.SwapsController.quoteValues,
});

Expand Down
10 changes: 6 additions & 4 deletions app/components/UI/Swaps/components/TokenSelectModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ import {
selectChainId,
selectProviderConfig,
} from '../../../../selectors/networkController';
import {
selectConversionRate,
selectCurrentCurrency,
} from '../../../../selectors/currencyRateController';

import Analytics from '../../../../core/Analytics/Analytics';
import { MetaMetricsEvents } from '../../../../core/Analytics';
Expand Down Expand Up @@ -556,10 +560,8 @@ TokenSelectModal.propTypes = {

const mapStateToProps = (state) => ({
accounts: state.engine.backgroundState.AccountTrackerController.accounts,
conversionRate:
state.engine.backgroundState.CurrencyRateController.conversionRate,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
conversionRate: selectConversionRate(state),
currentCurrency: selectCurrentCurrency(state),
selectedAddress:
state.engine.backgroundState.PreferencesController.selectedAddress,
balances:
Expand Down
10 changes: 6 additions & 4 deletions app/components/UI/Swaps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ import {
selectChainId,
selectProviderConfig,
} from '../../../selectors/networkController';
import {
selectConversionRate,
selectCurrentCurrency,
} from '../../../selectors/currencyRateController';
import AccountSelector from '../FiatOnRampAggregator/components/AccountSelector';

const createStyles = (colors) =>
Expand Down Expand Up @@ -998,12 +1002,10 @@ const mapStateToProps = (state) => ({
state.engine.backgroundState.PreferencesController.selectedAddress,
balances:
state.engine.backgroundState.TokenBalancesController.contractBalances,
conversionRate:
state.engine.backgroundState.CurrencyRateController.conversionRate,
conversionRate: selectConversionRate(state),
currentCurrency: selectCurrentCurrency(state),
tokenExchangeRates:
state.engine.backgroundState.TokenRatesController.contractExchangeRates,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
providerConfig: selectProviderConfig(state),
frequentRpcList:
state.engine.backgroundState.PreferencesController.frequentRpcList,
Expand Down
14 changes: 6 additions & 8 deletions app/components/UI/Tokens/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ import { BrowserTab, TokenI, TokensI } from './types';
import useOnRampNetwork from '../FiatOnRampAggregator/hooks/useOnRampNetwork';
import Badge from '../../../component-library/components/Badges/Badge/Badge';
import useTokenBalancesController from '../../hooks/useTokenBalancesController/useTokenBalancesController';
import {
selectConversionRate,
selectCurrentCurrency,
} from '../../../selectors/currencyRateController';

const Tokens: React.FC<TokensI> = ({ tokens }) => {
const { colors, themeAppearance } = useTheme();
Expand All @@ -105,14 +109,8 @@ const Tokens: React.FC<TokensI> = ({ tokens }) => {
});
const chainId = useSelector(selectChainId);
const ticker = useSelector(selectTicker);
const currentCurrency = useSelector(
(state: EngineState) =>
state.engine.backgroundState.CurrencyRateController.currentCurrency,
);
const conversionRate = useSelector(
(state: EngineState) =>
state.engine.backgroundState.CurrencyRateController.conversionRate,
);
const currentCurrency = useSelector(selectCurrentCurrency);
const conversionRate = useSelector(selectConversionRate);
const primaryCurrency = useSelector(
(state: any) => state.settings.primaryCurrency,
);
Expand Down
14 changes: 8 additions & 6 deletions app/components/UI/TransactionEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ import {
selectProviderType,
selectTicker,
} from '../../../selectors/networkController';
import {
selectConversionRate,
selectCurrentCurrency,
selectNativeCurrency,
} from '../../../selectors/currencyRateController';

const EDIT = 'edit';
const REVIEW = 'review';
Expand Down Expand Up @@ -885,12 +890,9 @@ const mapStateToProps = (state) => ({
state.engine.backgroundState.GasFeeController.gasFeeEstimates,
gasEstimateType:
state.engine.backgroundState.GasFeeController.gasEstimateType,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
conversionRate:
state.engine.backgroundState.CurrencyRateController.conversionRate,
nativeCurrency:
state.engine.backgroundState.CurrencyRateController.nativeCurrency,
conversionRate: selectConversionRate(state),
currentCurrency: selectCurrentCurrency(state),
nativeCurrency: selectNativeCurrency(state),
primaryCurrency: state.settings.primaryCurrency,
chainId: selectChainId(state),
});
Expand Down
10 changes: 6 additions & 4 deletions app/components/UI/TransactionElement/TransactionDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ import {
selectProviderConfig,
selectTicker,
} from '../../../../selectors/networkController';
import {
selectConversionRate,
selectCurrentCurrency,
} from '../../../../selectors/currencyRateController';

const createStyles = (colors) =>
StyleSheet.create({
Expand Down Expand Up @@ -420,10 +424,8 @@ const mapStateToProps = (state) => ({
),
contractExchangeRates:
state.engine.backgroundState.TokenRatesController.contractExchangeRates,
conversionRate:
state.engine.backgroundState.CurrencyRateController.conversionRate,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
conversionRate: selectConversionRate(state),
currentCurrency: selectCurrentCurrency(state),
primaryCurrency: state.settings.primaryCurrency,
swapsTransactions:
state.engine.backgroundState.TransactionController.swapsTransactions || {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import { ThemeContext, mockTheme } from '../../../../util/theme';
import ClipboardManager from '../../../../core/ClipboardManager';
import { showAlert } from '../../../../actions/alert';
import GlobalAlert from '../../../../components/UI/GlobalAlert';
import {
selectConversionRate,
selectCurrentCurrency,
} from '../../../../selectors/currencyRateController';

const createStyles = (colors) =>
StyleSheet.create({
Expand Down Expand Up @@ -179,10 +183,8 @@ class TransactionReviewData extends PureComponent {
}

const mapStateToProps = (state) => ({
conversionRate:
state.engine.backgroundState.CurrencyRateController.conversionRate,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
conversionRate: selectConversionRate(state),
currentCurrency: selectCurrentCurrency(state),
contractExchangeRates:
state.engine.backgroundState.TokenRatesController.contractExchangeRates,
transaction: state.transaction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ import {
selectNetwork,
selectTicker,
} from '../../../../selectors/networkController';
import {
selectConversionRate,
selectCurrentCurrency,
selectNativeCurrency,
} from '../../../../selectors/currencyRateController';
import { createBrowserNavDetails } from '../../../Views/Browser';
import { isNetworkBuyNativeTokenSupported } from '../../FiatOnRampAggregator/utils';
import { getRampNetworks } from '../../../../reducers/fiatOrders';
Expand Down Expand Up @@ -716,18 +721,15 @@ class TransactionReviewInformation extends PureComponent {

const mapStateToProps = (state) => ({
network: selectNetwork(state),
conversionRate:
state.engine.backgroundState.CurrencyRateController.conversionRate,
currentCurrency:
state.engine.backgroundState.CurrencyRateController.currentCurrency,
conversionRate: selectConversionRate(state),
currentCurrency: selectCurrentCurrency(state),
nativeCurrency: selectNativeCurrency(state),
contractExchangeRates:
state.engine.backgroundState.TokenRatesController.contractExchangeRates,
transaction: getNormalizedTxState(state),
ticker: selectTicker(state),
primaryCurrency: state.settings.primaryCurrency,
showCustomNonce: state.settings.showCustomNonce,
nativeCurrency:
state.engine.backgroundState.CurrencyRateController.nativeCurrency,
isNativeTokenBuySupported: isNetworkBuyNativeTokenSupported(
selectChainId(state),
getRampNetworks(state),
Expand Down
Loading

0 comments on commit e31c8bb

Please sign in to comment.