diff --git a/packages/yoroi-extension/app/components/wallet/assets/NFTDetails.js b/packages/yoroi-extension/app/components/wallet/assets/NFTDetails.js index 4773c6b2ef..4e0c90a77f 100644 --- a/packages/yoroi-extension/app/components/wallet/assets/NFTDetails.js +++ b/packages/yoroi-extension/app/components/wallet/assets/NFTDetails.js @@ -144,7 +144,7 @@ function NFTDetails({ nftInfo, network, intl, nextNftId, prevNftId, tab }: Props if (nftInfo == null) return null; return ( - + - + { + onClick={() => { ampli.nftGalleryDetailsNavigation({ nft_navigation: 'Previous', }); - } - } + }} > { + onClick={() => { ampli.nftGalleryDetailsNavigation({ nft_navigation: 'Next', }); - } - } + }} > diff --git a/packages/yoroi-extension/app/components/wallet/restore/RestoreWalletPage.js b/packages/yoroi-extension/app/components/wallet/restore/RestoreWalletPage.js index a33a51950b..5c72958ce6 100644 --- a/packages/yoroi-extension/app/components/wallet/restore/RestoreWalletPage.js +++ b/packages/yoroi-extension/app/components/wallet/restore/RestoreWalletPage.js @@ -184,9 +184,15 @@ function RestoreWalletPage(props: Props & Intl): Node { component: ( - walletData.isValidMnemonic({ mnemonic: phrase, mode: walletData.mode }) - } + checkValidPhrase={phrase => { + const isValid = walletData.isValidMnemonic( + { mnemonic: phrase, mode: walletData.mode } + ); + ampli.restoreWalletEnterPhraseStepStatus( + { recovery_prhase_status: isValid } + ); + return isValid; + }} openDuplicatedWallet={lastDuplicatedWallet => { resetRestoreWalletData(); walletsActions.setActiveWallet.trigger({ wallet: lastDuplicatedWallet }); diff --git a/packages/yoroi-extension/app/components/wallet/send/WalletSendFormRevamp.js b/packages/yoroi-extension/app/components/wallet/send/WalletSendFormRevamp.js index 6a720a4955..db01c74e51 100644 --- a/packages/yoroi-extension/app/components/wallet/send/WalletSendFormRevamp.js +++ b/packages/yoroi-extension/app/components/wallet/send/WalletSendFormRevamp.js @@ -538,7 +538,7 @@ export default class WalletSendFormRevamp extends Component { case SEND_FORM_STEP.RECEIVER: return (
-
+ { this.state.isReceiverFieldActive ? intl.formatMessage(messages.receiverFieldLabelActive) : intl.formatMessage(messages.receiverFieldLabelInactive) + } /> -
- + + this.onUpdateMemo(e.target.value)} helperText={ @@ -579,8 +580,8 @@ export default class WalletSendFormRevamp extends Component { /> {memo ? memo.length : 0}/{MAX_MEMO_SIZE} diff --git a/packages/yoroi-extension/app/components/widgets/forms/InlineEditingInput.js b/packages/yoroi-extension/app/components/widgets/forms/InlineEditingInput.js index bf31b36423..1d387a24d0 100644 --- a/packages/yoroi-extension/app/components/widgets/forms/InlineEditingInput.js +++ b/packages/yoroi-extension/app/components/widgets/forms/InlineEditingInput.js @@ -147,6 +147,7 @@ export default class InlineEditingInput extends Component { className, styles.component, isActive ? null : styles.inactive, + inputField.error && styles.error, ]); const inputStyles = classnames([ successfullyUpdated ? 'input_animateSuccess' : null, diff --git a/packages/yoroi-extension/app/components/widgets/forms/InlineEditingInput.scss b/packages/yoroi-extension/app/components/widgets/forms/InlineEditingInput.scss index af0edfb3da..86c69fb1fb 100644 --- a/packages/yoroi-extension/app/components/widgets/forms/InlineEditingInput.scss +++ b/packages/yoroi-extension/app/components/widgets/forms/InlineEditingInput.scss @@ -77,3 +77,19 @@ } } } + +:global(.YoroiRevamp) { + .component { + .error { + display: none; + } + .button { + top: 40%; + } + + .savingResultLabel { + top: 40%; + transform: unset; + } + } +} diff --git a/packages/yoroi-extension/app/connector/containers/ConnectContainer.js b/packages/yoroi-extension/app/connector/containers/ConnectContainer.js index e7c0a74fdc..8f93133a3f 100644 --- a/packages/yoroi-extension/app/connector/containers/ConnectContainer.js +++ b/packages/yoroi-extension/app/connector/containers/ConnectContainer.js @@ -3,7 +3,7 @@ import type { Node } from 'react'; import { Component } from 'react'; import ConnectPage from '../components/connect/ConnectPage'; import { observer } from 'mobx-react'; -import { computed } from 'mobx'; +import { computed, autorun } from 'mobx'; import type { InjectedOrGeneratedConnector } from '../../types/injectedPropsType'; import type { PublicDeriverCache, @@ -19,6 +19,7 @@ import { genLookupOrFail } from '../../stores/stateless/tokenHelpers'; import { PublicDeriver } from '../../api/ada/lib/storage/models/PublicDeriver'; import { createAuthEntry } from '../api'; import { WalletTypeOption } from '../../api/ada/lib/storage/models/ConceptualWallet/interfaces'; +import { ampli } from '../../../ampli/index'; type GeneratedData = typeof ConnectContainer.prototype.generated; declare var chrome; @@ -54,6 +55,18 @@ export default class ConnectContainer extends Component< }); }; + componentDidMount() { + autorun(() => { + if ( + this.generated.stores.connector.loadingWallets === LoadingWalletStates.SUCCESS + ) { + ampli.dappPopupConnectWalletPageViewed({ + wallet_count: this.generated.stores.connector.filteredWallets.length, + }); + } + }); + } + // eslint-disable-next-line camelcase UNSAFE_componentWillMount() { this.generated.actions.connector.refreshWallets.trigger(); @@ -103,6 +116,8 @@ export default class ConnectContainer extends Component< }); await connector.updateConnectorWhitelist.trigger({ whitelist }); + await ampli.dappPopupConnectWalletPasswordPageViewed(); + chrome.runtime.sendMessage( ({ type: 'connect_response', diff --git a/packages/yoroi-extension/app/connector/stores/ConnectorStore.js b/packages/yoroi-extension/app/connector/stores/ConnectorStore.js index e53b57a516..c0f8339082 100644 --- a/packages/yoroi-extension/app/connector/stores/ConnectorStore.js +++ b/packages/yoroi-extension/app/connector/stores/ConnectorStore.js @@ -92,6 +92,7 @@ import { unsupportedTransactionError, } from '../../domain/HardwareWalletLocalizedError'; import { wrapWithFrame } from '../../stores/lib/TrezorWrapper'; +import { ampli } from '../../../ampli/index'; export function connectorCall(message: T): Promise { return new Promise((resolve, reject) => { @@ -317,9 +318,11 @@ export default class ConnectorStore extends Store { if (response) { if (response.sign.type === 'tx/cardano') { this.createAdaTransaction(); + ampli.dappPopupSignTransactionPageViewed(); } if (response.sign.type === 'tx-reorg/cardano') { this.generateReorgTransaction(); + ampli.dappPopupAddCollateralPageViewed(); } if (response.sign.type === 'data') { this.checkHwWalletSignData(); @@ -457,6 +460,7 @@ export default class ConnectorStore extends Store { window.chrome.runtime.sendMessage(sendData); this.actions.connector.cancelSignInTx.remove(this._cancelSignInTx); + await ampli.dappPopupSignTransactionSubmitted(); this._closeWindow(); }; @action diff --git a/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js b/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js index 88dc60c65c..8e1354d1d9 100644 --- a/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js +++ b/packages/yoroi-extension/app/containers/NavBarContainerRevamp.js @@ -28,6 +28,7 @@ import NavBarRevamp from '../components/topbar/NavBarRevamp'; import NavWalletDetailsRevamp from '../components/topbar/NavWalletDetailsRevamp'; import WalletListDialog from '../components/topbar/WalletListDialog'; import BuySellAdaButton from '../components/topbar/BuySellAdaButton'; +import { ampli } from '../../ampli/index'; export type GeneratedData = typeof NavBarContainerRevamp.prototype.generated; @@ -101,6 +102,7 @@ export default class NavBarContainerRevamp extends Component { unitOfAccountSetting={profile.unitOfAccount} getCurrentPrice={this.generated.stores.coinPriceStore.getCurrentPrice} openWalletInfoDialog={() => { + ampli.allWalletsPageViewed(); this.generated.actions.dialogs.open.trigger({ dialog: WalletListDialog }); }} /> diff --git a/packages/yoroi-extension/app/containers/wallet/NFTDetailPageRevamp.js b/packages/yoroi-extension/app/containers/wallet/NFTDetailPageRevamp.js index d847fd94e4..62e430d3da 100644 --- a/packages/yoroi-extension/app/containers/wallet/NFTDetailPageRevamp.js +++ b/packages/yoroi-extension/app/containers/wallet/NFTDetailPageRevamp.js @@ -94,7 +94,7 @@ class NFTDetailPageRevamp extends Component { const tab = urlPrams.get('tab'); return ( - + { const walletSummaryPageRevamp = ( - - {!!notification && ( - - )} - - ({ color: theme.palette.grayscale[600], - marginTop: 0, - marginLeft: '14px', - fontWeight: 400, - position: 'absolute', - bottom: '-2px', fontSize: '0.75rem', '&.Mui-disabled': { color: theme.palette.grayscale[200] }, '&.Mui-error': { color: theme.palette.magenta[500] }, diff --git a/packages/yoroi-extension/app/styles/overrides/revamp/OutlinedInput.js b/packages/yoroi-extension/app/styles/overrides/revamp/OutlinedInput.js index dcbf0a6bc8..34f4702fde 100644 --- a/packages/yoroi-extension/app/styles/overrides/revamp/OutlinedInput.js +++ b/packages/yoroi-extension/app/styles/overrides/revamp/OutlinedInput.js @@ -4,7 +4,6 @@ const RevampOutlinedInput = { styleOverrides: { root: ({ theme }: any): any => ({ paddingRight: '16px', - height: '56px', '&:hover .MuiOutlinedInput-notchedOutline': { borderColor: theme.palette.grayscale[900] }, '& .MuiOutlinedInput-notchedOutline': { borderColor: theme.palette.grayscale[400], diff --git a/packages/yoroi-extension/chrome/extension/connector/index.js b/packages/yoroi-extension/chrome/extension/connector/index.js index 433f74d5e5..8e7d496ebc 100644 --- a/packages/yoroi-extension/chrome/extension/connector/index.js +++ b/packages/yoroi-extension/chrome/extension/connector/index.js @@ -12,6 +12,10 @@ import { Action } from '../../../app/actions/lib/Action'; import App from '../../../app/connector/App'; import BigNumber from 'bignumber.js'; import { addCloseListener, TabIdKeys } from '../../../app/utils/tabManager'; +import environment from '../../../app/environment'; +import { ampli } from '../../../ampli/index'; +import type { LoadOptionsWithEnvironment } from '../../../ampli/index'; +import LocalStorageApi from '../../../app/api/localStorage'; // run MobX in strict mode configure({ enforceActions: 'always' }); @@ -41,6 +45,21 @@ const initializeErgoConnector: void => Promise = async () => { if (root == null) { throw new Error('Root element not found.'); } + const AMPLI_FLUSH_INTERVAL_MS = 5000; + const isAnalyticsAllowd = (new LocalStorageApi()).loadIsAnalyticsAllowed(); + await ampli.load(({ + environment: environment.isProduction() ? 'production' : 'development', + client: { + configuration: { + optOut: !isAnalyticsAllowd, + flushIntervalMillis: AMPLI_FLUSH_INTERVAL_MS, + trackingOptions: { + ipAddress: false, + }, + defaultTracking: false, + }, + }, + }: LoadOptionsWithEnvironment)).promise; render(, root); }; diff --git a/packages/yoroi-extension/chrome/extension/index.js b/packages/yoroi-extension/chrome/extension/index.js index 1de03b7adb..8de932dfd1 100644 --- a/packages/yoroi-extension/chrome/extension/index.js +++ b/packages/yoroi-extension/chrome/extension/index.js @@ -89,6 +89,8 @@ const initializeYoroi: void => Promise = async () => { ampli.votingPageViewed(); } else if (pathname === ROUTES.WALLETS.TRANSACTIONS) { ampli.transactionsPageViewed(); + } else if (pathname === ROUTES.STAKING) { + ampli.stakingCenterPageViewed(); } }); };