Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
b81b8be
[DDW-809] WIP Analytics agreement
przemyslaw-wlodek Dec 31, 2021
11d06a1
Merge remote-tracking branch 'origin/develop' into feature/ddw-809-im…
przemyslaw-wlodek Jan 4, 2022
3ee1643
[DDW-809] Clean-up and updated design + translations
przemyslaw-wlodek Jan 4, 2022
20e7706
[DDW-809] Clean-up and updated initial settings flow
przemyslaw-wlodek Jan 5, 2022
2e8f532
[DDW-809] Add placeholder for Analytics settings
przemyslaw-wlodek Jan 5, 2022
e15fe1a
[DDW-809] Add WIP placeholder for T&C link interpolation
przemyslaw-wlodek Jan 5, 2022
88badbc
[DDW-809] Add JP translations
przemyslaw-wlodek Jan 10, 2022
8ed2846
[DDW-809] Update analytics dialog styles
przemyslaw-wlodek Jan 10, 2022
f961d83
Merge remote-tracking branch 'origin/develop' into feature/ddw-809-im…
przemyslaw-wlodek Jan 18, 2022
2ee3380
Merge remote-tracking branch 'origin/develop' into feature/ddw-809-im…
przemyslaw-wlodek Jan 27, 2022
c1dd030
Fix flow issue
przemyslaw-wlodek Jan 27, 2022
2919d53
[DDW-809] installed ts packages, and packages required for migration
przemyslaw-wlodek Jan 31, 2022
c5f4ab8
[DDW-809] added ts extensions to prettierignore
przemyslaw-wlodek Jan 31, 2022
f31d065
[DDW-809] added tsconfig
przemyslaw-wlodek Jan 31, 2022
4155036
[DDW-809] installed ts packages, and packages required for migration
przemyslaw-wlodek Jan 31, 2022
3148b0a
[DDW-809] added ts extensions to prettierignore
przemyslaw-wlodek Jan 31, 2022
6786254
[DDW-809] added tsconfig
przemyslaw-wlodek Jan 31, 2022
a58d0c1
[DDW-809] temporarily removed husky pre-commit
przemyslaw-wlodek Jan 31, 2022
32f1c4e
[DDW-809] added ts extensions to prettierignore
przemyslaw-wlodek Jan 31, 2022
20a5718
[DDW-809] added tsconfig
przemyslaw-wlodek Jan 31, 2022
d3ebb3c
[DDW-809] converted all javascript files to typescript files
przemyslaw-wlodek Jan 31, 2022
c259752
[DDW-809] converted files returning react components to tsx extension
przemyslaw-wlodek Jan 31, 2022
50fcc51
[DDW-809] made global replacements in all folders
przemyslaw-wlodek Jan 31, 2022
f09ba96
[DDW-809] converted flow style code in typescript files to typescript…
przemyslaw-wlodek Jan 31, 2022
63d9a3b
[DDW-809] updated ts-ignore annotations in components
przemyslaw-wlodek Jan 31, 2022
986595c
[DDW-809] re-enabled husky pre-commit step
przemyslaw-wlodek Jan 31, 2022
d30b724
[DDW-809] lockfile fixed
przemyslaw-wlodek Jan 31, 2022
5c7d361
Merge remote-tracking branch 'origin/develop' into feature/ddw-809-im…
przemyslaw-wlodek Jan 31, 2022
a5201b8
[DDW-809] Manually fix trivial ts issues after migration
przemyslaw-wlodek Jan 31, 2022
f4324eb
[DDW-809] Manually fix trivial ts issues after migration (part 2)
przemyslaw-wlodek Feb 1, 2022
90f9ee6
[DDW-904]: Create GoogleAnalytics client + ground work for integration
przemyslaw-wlodek Feb 2, 2022
d8231c7
[DDW-904]: Update eslint config for instance property assignment in c…
przemyslaw-wlodek Feb 2, 2022
391256b
[DDW-904]: Rename user_uuid => user_id (consistency)
przemyslaw-wlodek Feb 3, 2022
a5cf2d2
[DDW-904]: Integrate google analytics with basic user flow
przemyslaw-wlodek Feb 11, 2022
e8f9372
Merge remote-tracking branch 'origin/develop' into feature/ddw-809-im…
przemyslaw-wlodek Feb 16, 2022
080cc47
[DDW-809] Fix lockfile
przemyslaw-wlodek Feb 16, 2022
3c8860d
Merge remote-tracking branch 'origin/develop' into feature/ddw-904-in…
przemyslaw-wlodek Feb 16, 2022
390b93f
[DDW-904] Fix lockfile
przemyslaw-wlodek Feb 16, 2022
34a91d7
[DDW-904] Remove Analytics settings page placeholder
przemyslaw-wlodek Feb 16, 2022
3141165
[DDW-904] Fix and ignore TS errors
przemyslaw-wlodek Feb 16, 2022
c4ff53e
Merge branch 'feature/ddw-809-implement-analytics' into feature/ddw-9…
przemyslaw-wlodek Feb 17, 2022
572f179
[DDW-904] Fix TS error
przemyslaw-wlodek Feb 17, 2022
a033b30
[DDW-904] Remove trailing comma from .eslintrc
przemyslaw-wlodek Feb 17, 2022
86c552d
[DDW-904] Update translations
przemyslaw-wlodek Feb 17, 2022
34608df
[DDW-904] Split AnalyticsForm from AnalyticsPage + refactor
przemyslaw-wlodek Feb 17, 2022
6901fee
[DDW-904] Update translations
przemyslaw-wlodek Feb 17, 2022
e2100e5
[DDW-1025] Working Matomo client for tracking hardware
Mar 17, 2022
14a6992
[DDW-1025] Fix lockfile
Mar 21, 2022
82cd6fa
[DDW-1025] Wrap up POC implementation
Mar 21, 2022
9f29ee2
[DDW-1025] Fix lockfile
Mar 22, 2022
e52bd6f
[DDW-1025] Sending page navigation events
Mar 29, 2022
4c3e6d9
[DDW-1025] Sending page navigation events
Mar 29, 2022
4f06004
[DDW-1025] Sending page navigation events
Mar 29, 2022
9761aa0
[DDW-1025] Fix minor issues
Mar 29, 2022
7453537
[DDW-1025] Implement action tracking for stake pools and resolve warn…
Mar 30, 2022
3ea509d
[DDW-1025] WIP
Mar 30, 2022
d5f6129
[DDW-1025] WIP
Apr 4, 2022
0f88a9b
Merge remote-tracking branch 'origin/develop' into feature/ddw-809-im…
Apr 4, 2022
162cc5c
Merge branch 'feature/ddw-809-implement-analytics' into feature/ddw-9…
Apr 4, 2022
5530fae
Merge branch 'feature/ddw-904-integrate-google-analytics' into feat/d…
Apr 4, 2022
e2bace4
[DDW-1025] Address PR feedback
Apr 4, 2022
c60d8e8
[DDW-1025] Fix bugs and minor refactoring
Apr 5, 2022
e98e6d9
[DDW-809] UI improvements for analytics
Apr 7, 2022
040a90d
[DDW-809] UI improvements for analytics
Apr 8, 2022
efaaa1b
[DDW-809] Minor improvements and revert of unrelated changes
Apr 8, 2022
ec1c4c5
[DDW-809] Minor improvements
Apr 11, 2022
d76d749
Merge remote-tracking branch 'origin/develop' into feature/ddw-809-im…
Apr 11, 2022
3bafc96
[DDW-809] Remove unused code
Apr 11, 2022
5fb0e3a
Merge remote-tracking branch 'origin/feature/ddw-809-implement-analyt…
Apr 11, 2022
93369d5
[DDW-809] Address UX review feedback - part 1
Apr 11, 2022
108e9c9
[DDW-809] Address UX review feedback - part 2
Apr 12, 2022
6bb6bda
[DDW-809] Address UX review feedback - part 2a
Apr 12, 2022
c309a4c
[DDW-1025] Update the consent screen and settings based on the legal …
May 18, 2022
f176be2
Merge remote-tracking branch 'origin/develop' into feature/ddw-809-im…
May 19, 2022
2228708
Merge branch 'feature/ddw-809-implement-analytics' into feat/ddw-1025…
May 19, 2022
1a38ff7
[DDW-809] Rollback changes which are moved to separate PR
May 19, 2022
7e5fa1d
[DDW-809] Add analytics consent page route again
May 19, 2022
ea485d8
[DDW-809] Move more changes to separate PR
May 19, 2022
401659a
[DDW-809] Move more changes to separate PR
May 19, 2022
c95384d
[DDW-809] Fix merge conflict issues
May 19, 2022
018c591
[DDW-809] Fix merge conflict issues
May 19, 2022
ea9ba7f
[DDW-809] Fix minor issues
May 19, 2022
ea5c94a
Merge remote-tracking branch 'origin/develop' into feat/ddw-1025-mato…
Jun 8, 2022
3fd8fe0
[DDW-1025] Update the settings screen to match latest requirements an…
Jun 9, 2022
c2372e5
[DDW-1025] Address PR feedback
Jun 9, 2022
2447bbb
Merge remote-tracking branch 'origin/develop' into feat/ddw-1025-mato…
Jun 22, 2022
3b6518a
[DDW-809] Use fixed package versions
Jun 22, 2022
ec18b0b
[DDW-809] Fix issues after merging Webpack5
Jun 28, 2022
6163b29
[DDW-809] Fix issues
Jun 28, 2022
6bc78fc
Address PR comments
Jun 28, 2022
409f6c4
Address PR comments
Jun 28, 2022
62a8779
Merge remote-tracking branch 'origin/develop' into feat/ddw-1025-mato…
Jul 4, 2022
efeff61
Merge remote-tracking branch 'origin/develop' into feat/ddw-1025-mato…
Aug 8, 2022
a64c5d1
Merge remote-tracking branch 'origin/develop' into feat/ddw-1025-mato…
Aug 22, 2022
416793a
Fix merge issues
Aug 22, 2022
5da90e4
Merge remote-tracking branch 'origin/develop' into feat/ddw-1025-mato…
Sep 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@
"@types/node": "14.18.1",
"@types/qrcode.react": "1.0.2",
"@types/react": "16.9.56",
"@types/react-router": "5.1.18",
"@types/react-router-dom": "5.3.3",
"@types/react-svg-inline": "2.1.3",
"@types/react-table": "^7.7.9",
"@types/trezor-connect": "8.1.18",
"@types/uuid": "8.3.4",
"@typescript-eslint/eslint-plugin": "5.20.0",
"@typescript-eslint/parser": "5.20.0",
"@xarc/run": "1.1.1",
Expand Down Expand Up @@ -291,6 +294,7 @@
"url": "0.11.0",
"usb-detection": "4.13.0",
"util": "0.12.4",
"uuid": "8.3.2",
"validator": "13.7.0"
},
"devEngines": {
Expand Down
2 changes: 2 additions & 0 deletions source/common/config/electron-store.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const STORAGE_KEYS: Record<string, StorageKey> = {
STAKE_POOLS_LIST_VIEW_TOOLTIP: 'STAKE-POOLS-LIST-VIEW-TOOLTIP',
STAKING_INFO_WAS_OPEN: 'ALONZO-INFO-WAS-OPEN',
TERMS_OF_USE_ACCEPTANCE: 'TERMS-OF-USE-ACCEPTANCE',
ANALYTICS_ACCEPTANCE: 'ANALYTICS-ACCEPTANCE',
USER_ID: 'USER-ID',
THEME: 'THEME',
TOKEN_FAVORITES: 'TOKEN-FAVORITES',
USER_DATE_FORMAT_ENGLISH: 'USER-DATE-FORMAT-ENGLISH',
Expand Down
4 changes: 3 additions & 1 deletion source/common/ipc/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const DIALOGS = {
import { ApplicationDialog } from '../../renderer/app/types/applicationDialogTypes';

export const DIALOGS: Record<string, ApplicationDialog> = {
ABOUT: 'ABOUT_DIALOG',
DAEDALUS_DIAGNOSTICS: 'DAEDALUS_DIAGNOSTICS_DIALOG',
ITN_REWARDS_REDEMPTION: 'ITN_REWARDS_REDEMPTION_DIALOG',
Expand Down
4 changes: 2 additions & 2 deletions source/common/ipc/lib/IpcConversation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isString } from 'lodash';
import uuid from 'uuid';
import { v4 as uuidv4 } from 'uuid';

export type IpcSender = {
send: (channel: string, conversationId: string, ...args: Array<any>) => void;
Expand Down Expand Up @@ -68,7 +68,7 @@ export class IpcConversation<Incoming, Outgoing> {
receiver: IpcReceiver
): Promise<Incoming> {
return new Promise((resolve, reject) => {
const conversationId = uuid();
const conversationId = uuidv4();

const handler = (
event,
Expand Down
2 changes: 2 additions & 0 deletions source/common/types/electron-store.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export type StorageKey =
| 'USER-TIME-FORMAT'
| 'WALLET-MIGRATION-STATUS'
| 'WALLETS'
| 'ANALYTICS-ACCEPTANCE'
| 'USER-ID'
| 'WINDOW-BOUNDS';
export type StoreMessage = {
type: StorageType;
Expand Down
4 changes: 3 additions & 1 deletion source/common/types/environment.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export type Environment = {
mainProcessID: string;
rendererProcessID: string;
os: string;
cpu: string;
system: string;
cpu: Cpu;
ram: number;
hasMetHardwareRequirements: boolean;
installerVersion: string;
Expand All @@ -33,6 +34,7 @@ export type Environment = {
isLinux: boolean;
isBlankScreenFixActive: boolean;
keepLocalClusterRunning: boolean;
analyticsFeatureEnabled: boolean;
};
// constants
export const PRODUCTION = 'production';
Expand Down
2 changes: 2 additions & 0 deletions source/main/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const isPreview = checkIsPreview(NETWORK);
const isShelleyQA = checkIsShelleyQA(NETWORK);
const isSelfnode = checkIsSelfnode(NETWORK);
const isDevelopment = checkIsDevelopment(NETWORK);
const analyticsFeatureEnabled = isMainnet || isStaging || isTestnet;
const keepLocalClusterRunning = process.env.KEEP_LOCAL_CLUSTER_RUNNING;
const API_VERSION = process.env.API_VERSION || 'dev';
const NODE_VERSION = '1.35.3'; // TODO: pick up this value from process.env
Expand Down Expand Up @@ -111,6 +112,7 @@ export const environment: Environment = Object.assign(
isBlankScreenFixActive,
keepLocalClusterRunning,
hasMetHardwareRequirements,
analyticsFeatureEnabled,
},
process.env
);
5 changes: 5 additions & 0 deletions source/renderer/app/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import WalletSettingsPage from './containers/wallet/WalletSettingsPage';
import WalletUtxoPage from './containers/wallet/WalletUtxoPage';
import VotingRegistrationPage from './containers/voting/VotingRegistrationPage';
import { IS_STAKING_INFO_PAGE_AVAILABLE } from './config/stakingConfig';
import AnalyticsConsentPage from './containers/profile/AnalyticsConsentPage';

export const Routes = withRouter(() => (
<Route path={ROUTES.ROOT}>
Expand All @@ -49,6 +50,10 @@ export const Routes = withRouter(() => (
component={InitialSettingsPage}
/>
<Route path={ROUTES.PROFILE.TERMS_OF_USE} component={TermsOfUsePage} />
<Route
path={ROUTES.PROFILE.ANALYTICS}
component={AnalyticsConsentPage}
/>
<Route
path={ROUTES.PROFILE.DATA_LAYER_MIGRATION}
component={DataLayerMigrationPage}
Expand Down
6 changes: 3 additions & 3 deletions source/renderer/app/actions/lib/Action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { bindAll } from 'lodash';
/**
* Listener type as Function that takes specific params <P>
*/
export type Listener<P> = (params: P) => any;
export type Listener<P> = (params: P) => void;
/**
* Action class with typed params
*/
Expand All @@ -30,8 +30,8 @@ export default class Action<Params> {
this.listeners.push(listener);
}

trigger(params?: Params) {
this.listeners.forEach((listener) => listener(params));
async trigger(params?: Params): Promise<void> {
await Promise.all(this.listeners.map((listener) => listener(params)));
}

remove(listener: Listener<Params>) {
Expand Down
4 changes: 3 additions & 1 deletion source/renderer/app/actions/profile-actions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Action from './lib/Action'; // ======= PROFILE ACTIONS =======
import Action from './lib/Action';
import { AnalyticsAcceptanceStatus } from '../analytics/types';

export default class ProfileActions {
acceptAnalytics: Action<AnalyticsAcceptanceStatus> = new Action();
acceptTermsOfUse: Action<any> = new Action();
acceptDataLayerMigration: Action<any> = new Action();
getLogs: Action<any> = new Action();
Expand Down
1 change: 1 addition & 0 deletions source/renderer/app/analytics/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { AnalyticsAcceptanceStatus } from './types';
5 changes: 5 additions & 0 deletions source/renderer/app/analytics/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum AnalyticsAcceptanceStatus {
PENDING = 'PENDING',
ACCEPTED = 'ACCEPTED',
REJECTED = 'REJECTED',
}
30 changes: 27 additions & 3 deletions source/renderer/app/api/utils/localStorage.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/* eslint-disable consistent-return */
import { includes, without, get } from 'lodash';
import { get, includes, without } from 'lodash';
import { v4 as uuidv4 } from 'uuid';
import { toJS } from '../../../../common/utils/helper';
import { electronStoreConversation } from '../../ipc/electronStoreConversation';
import type { WalletMigrationStatus } from '../../stores/WalletMigrationStore';
import { WalletMigrationStatuses } from '../../stores/WalletMigrationStore';
import {
STORAGE_TYPES as types,
STORAGE_KEYS as keys,
STORAGE_TYPES as types,
} from '../../../../common/config/electron-store.config';
import type { NewsTimestamp } from '../news/types';
import type {
Expand All @@ -16,8 +17,8 @@ import type {
import type { StorageKey } from '../../../../common/types/electron-store.types';
import type { Currency, DeprecatedCurrency } from '../../types/currencyTypes';
import {
CURRENCY_IS_ACTIVE_BY_DEFAULT,
CURRENCY_DEFAULT_SELECTED,
CURRENCY_IS_ACTIVE_BY_DEFAULT,
} from '../../config/currencyConfig';
import {
AssetLocalData,
Expand All @@ -27,6 +28,7 @@ import {
UnpairedHardwareWalletData,
WalletLocalData,
} from '../../types/localDataTypes';
import { AnalyticsAcceptanceStatus } from '../../analytics';

export type SetHardwareWalletLocalDataRequestType = {
walletId: string;
Expand Down Expand Up @@ -121,6 +123,28 @@ export default class LocalStorageApi {
LocalStorageApi.set(keys.TERMS_OF_USE_ACCEPTANCE, true);
unsetTermsOfUseAcceptance = (): Promise<void> =>
LocalStorageApi.unset(keys.TERMS_OF_USE_ACCEPTANCE);
getAnalyticsAcceptance = (): Promise<AnalyticsAcceptanceStatus> =>
LocalStorageApi.get(
keys.ANALYTICS_ACCEPTANCE,
AnalyticsAcceptanceStatus.PENDING
);
setAnalyticsAcceptance = (status: AnalyticsAcceptanceStatus): Promise<void> =>
LocalStorageApi.set(keys.ANALYTICS_ACCEPTANCE, status);
unsetAnalyticsAcceptance = (): Promise<void> =>
LocalStorageApi.set(
keys.ANALYTICS_ACCEPTANCE,
AnalyticsAcceptanceStatus.PENDING
);
getUserID = async (): Promise<string> => {
let userId: string = await LocalStorageApi.get(keys.USER_ID, null);

if (!userId) {
userId = uuidv4();
await LocalStorageApi.set(keys.USER_ID, userId);
}

return userId;
};
getUserTheme = (): Promise<string> => LocalStorageApi.get(keys.THEME);
setUserTheme = (theme: string): Promise<void> =>
LocalStorageApi.set(keys.THEME, theme);
Expand Down
44 changes: 0 additions & 44 deletions source/renderer/app/components/dapp/DappTransactionRequest.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,53 +44,9 @@
}
}
}
hr {
border: 0;
border-top: 1px solid var(--theme-dapp-transaction-request-separator);
margin: 20px 0;
opacity: 0.3;
}
.transactionFee {
color: var(--theme-dapp-transaction-request-fees-text-color);
font-family: var(--font-regular);
margin-bottom: 20px;
}
.additionalData,
.metadata {
background-color: var(
--theme-dapp-transaction-request-code-background-color
);
pre {
font-family: var(--font-mono);
font-size: 14px;
line-height: 1.38;
max-height: 250px;
overflow: auto;
padding: 9px 12px;
user-select: text;
white-space: pre-wrap;
word-wrap: break-word;
&::-webkit-scrollbar-corner {
background: transparent !important;
}
&::-webkit-scrollbar-button {
height: 2px !important;
}
}
}
.toggleButton {
background-color: var(
--theme-dapp-transaction-request-toggle-button-background-color
);
border-radius: 4px;
color: var(--theme-label-button-color);
cursor: pointer;
font-family: var(--font-medium);
font-size: 10px;
letter-spacing: 0.5px;
line-height: 1.2;
margin-left: 10px;
padding: 4px 8px;
text-transform: uppercase;
}
}
59 changes: 16 additions & 43 deletions source/renderer/app/components/dapp/DappTransactionRequest.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useState, useCallback, useMemo } from 'react';
import React, { useCallback, useMemo, useState } from 'react';
import BigNumber from 'bignumber.js';
import classnames from 'classnames';
import { Select } from 'react-polymorph/lib/components/Select';
import {
defineMessages,
intlShape,
injectIntl,
FormattedHTMLMessage,
injectIntl,
intlShape,
} from 'react-intl';
import { observer } from 'mobx-react';
import styles from './DappTransactionRequest.scss';
Expand All @@ -18,6 +18,9 @@ import AssetsTransactionConfirmation from '../assets/AssetsTransactionConfirmati
import { formattedWalletAmount } from '../../utils/formatters';
import { isTokenMissingInWallet, tokenHasBalance } from '../../utils/assets';
import type { AssetToken } from '../../api/assets/types';
import { MonospaceTextBlock } from '../widgets/monospace-text-block/MonospaceTextBlock';
import { CollapsibleSection } from '../widgets/collapsible-section/CollapsibleSection';
import { Separator } from '../widgets/separator/Separator';

const messages = defineMessages({
title: {
Expand Down Expand Up @@ -92,16 +95,6 @@ type Props = {
wallets: Array<Wallet>;
};
const DappTransactionRequest = observer((props: Props) => {
const [isAdditionalDataVisible, toggleAdditionalData] = useState<boolean>(
false
);
const [isMetadataVisible, toggleMetadata] = useState<boolean>(false);
// @ts-ignore ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
const getToggleLabel = useCallback((isVisible: boolean) =>
isVisible
? intl.formatMessage(globalMessages.hide)
: intl.formatMessage(globalMessages.view)
);
const {
adaAmount,
address,
Expand Down Expand Up @@ -144,6 +137,7 @@ const DappTransactionRequest = observer((props: Props) => {
}}
/>
) : null;

const walletsDropdownStyles = classnames([
styles.walletsDropdown,
walletsDropdownHasError || hasTokenError ? styles.error : null,
Expand Down Expand Up @@ -200,8 +194,7 @@ const DappTransactionRequest = observer((props: Props) => {
className={styles.addWalletSelect}
/>
)}

<hr />
<Separator />
<p className={styles.label}>
{intl.formatMessage(messages.receiverLabel)}
</p>
Expand All @@ -219,34 +212,14 @@ const DappTransactionRequest = observer((props: Props) => {
<div className={styles.transactionFee}>
+{formattedWalletAmount(transactionFee)}
</div>
<p className={styles.labelData}>
{intl.formatMessage(messages.additionalDataLabel)}
<button
className={styles.toggleButton}
onClick={() => toggleAdditionalData(!isAdditionalDataVisible)}
>
{getToggleLabel(isAdditionalDataVisible)}
</button>
</p>
{isAdditionalDataVisible && (
<div className={styles.additionalData}>
<pre>{additionalData}</pre>
</div>
)}
<p className={styles.labelData}>
{intl.formatMessage(messages.metaDataLabel)}
<button
className={styles.toggleButton}
onClick={() => toggleMetadata(!isMetadataVisible)}
>
{getToggleLabel(isMetadataVisible)}
</button>
</p>
{isMetadataVisible && (
<div className={styles.metadata}>
<pre>{metadata}</pre>
</div>
)}
<CollapsibleSection
header={intl.formatMessage(messages.additionalDataLabel)}
>
<MonospaceTextBlock>{additionalData}</MonospaceTextBlock>
</CollapsibleSection>
<CollapsibleSection header={intl.formatMessage(messages.metaDataLabel)}>
<MonospaceTextBlock>{metadata}</MonospaceTextBlock>
</CollapsibleSection>
</Dialog>
);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';
import AnalyticsConsentForm from './AnalyticsConsentForm';
import StoryDecorator from '../../../../../../storybook/stories/_support/StoryDecorator';

storiesOf('Analytics', module)
.addDecorator(withKnobs)
.addDecorator((story) => <StoryDecorator>{story()}</StoryDecorator>)
.add('Analytics Consent Form', () => <AnalyticsConsentForm />);
Loading