From 8b1d96435ea6ce281208b2ae11a3e6264a29feda Mon Sep 17 00:00:00 2001 From: Javier Bueno Date: Wed, 2 Aug 2023 00:20:08 +0200 Subject: [PATCH 1/5] feature(settings): analytics section --- .../src/components/Analytics/index.ts | 1 + .../src/components/Icon/Analytics.tsx | 17 ++++++++++++ .../src/components/Icon/index.ts | 2 ++ apps/wallet-mobile/src/components/index.ts | 1 + .../ApplicationSettingsScreen.tsx | 27 +++++++++++++------ .../Settings/SettingsScreenNavigator.tsx | 11 +++++++- .../wallet-mobile/src/i18n/locales/en-US.json | 1 + apps/wallet-mobile/src/navigation.tsx | 1 + 8 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 apps/wallet-mobile/src/components/Analytics/index.ts create mode 100644 apps/wallet-mobile/src/components/Icon/Analytics.tsx diff --git a/apps/wallet-mobile/src/components/Analytics/index.ts b/apps/wallet-mobile/src/components/Analytics/index.ts new file mode 100644 index 0000000000..dca5d051e8 --- /dev/null +++ b/apps/wallet-mobile/src/components/Analytics/index.ts @@ -0,0 +1 @@ +export * from './Analytics' diff --git a/apps/wallet-mobile/src/components/Icon/Analytics.tsx b/apps/wallet-mobile/src/components/Icon/Analytics.tsx new file mode 100644 index 0000000000..ed996f4bd9 --- /dev/null +++ b/apps/wallet-mobile/src/components/Icon/Analytics.tsx @@ -0,0 +1,17 @@ +import * as React from 'react' +import Svg, {Path} from 'react-native-svg' + +type Props = {size: number; color?: string} + +export const Analytics = ({size = 24, color}: Props) => { + return ( + + + + ) +} diff --git a/apps/wallet-mobile/src/components/Icon/index.ts b/apps/wallet-mobile/src/components/Icon/index.ts index 12e7a42f04..6480cbd57d 100644 --- a/apps/wallet-mobile/src/components/Icon/index.ts +++ b/apps/wallet-mobile/src/components/Icon/index.ts @@ -1,4 +1,5 @@ import {Ada} from './Ada' +import {Analytics} from './Analytics' import {Assets} from './Assets' import {Bio} from './Bio' import {Bug} from './Bug' @@ -89,6 +90,7 @@ import {YoroiWallet} from './YoroiWallet' export const Icon = { Ada, + Analytics, Assets, Bio, Bug, diff --git a/apps/wallet-mobile/src/components/index.ts b/apps/wallet-mobile/src/components/index.ts index ac7603a006..10a799b68a 100644 --- a/apps/wallet-mobile/src/components/index.ts +++ b/apps/wallet-mobile/src/components/index.ts @@ -1,3 +1,4 @@ +export * from './Analytics' export * from './Banner' export * from './Boundary' export * from './BulletPointItem' diff --git a/apps/wallet-mobile/src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx b/apps/wallet-mobile/src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx index 873510049e..9fe0362388 100644 --- a/apps/wallet-mobile/src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx +++ b/apps/wallet-mobile/src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx @@ -74,6 +74,12 @@ export const ApplicationSettingsScreen = () => { label={strings.termsOfservice} navigateTo="terms-of-use" /> + + } + label={strings.analytics} + navigateTo="analytics" + /> @@ -164,17 +170,10 @@ const useStrings = () => { termsOfservice: intl.formatMessage(messages.termsOfservice), crashReporting: intl.formatMessage(messages.crashReporting), crashReportingInfo: intl.formatMessage(messages.crashReportingInfo), + analytics: intl.formatMessage(messages.analytics), } } -const styles = StyleSheet.create({ - settings: { - flex: 1, - paddingTop: 16, - backgroundColor: '#fff', - }, -}) - const messages = defineMessages({ general: { id: 'components.settings.applicationsettingsscreen.label.general', @@ -228,4 +227,16 @@ const messages = defineMessages({ id: 'components.settings.applicationsettingsscreen.crashReportingInfo', defaultMessage: '!!!Changes to this option will be reflected after restarting the application', }, + analytics: { + id: 'components.settings.applicationsettingsscreen.analytics', + defaultMessage: '!!!Analytics', + }, +}) + +const styles = StyleSheet.create({ + settings: { + flex: 1, + paddingTop: 16, + backgroundColor: '#fff', + }, }) diff --git a/apps/wallet-mobile/src/features/Settings/SettingsScreenNavigator.tsx b/apps/wallet-mobile/src/features/Settings/SettingsScreenNavigator.tsx index 4f52d9372f..3f5a5f1aea 100644 --- a/apps/wallet-mobile/src/features/Settings/SettingsScreenNavigator.tsx +++ b/apps/wallet-mobile/src/features/Settings/SettingsScreenNavigator.tsx @@ -6,7 +6,7 @@ import {defineMessages, useIntl} from 'react-intl' import {ChangePinScreen} from '../../auth' import {EnableLoginWithPin} from '../../auth/EnableLoginWithPin' -import {Boundary} from '../../components' +import {Analytics, Boundary} from '../../components' import globalMessages from '../../i18n/global-messages' import {defaultStackNavigationOptions, SettingsStackRoutes, SettingsTabRoutes} from '../../navigation' import {COLORS} from '../../theme' @@ -117,6 +117,10 @@ export const SettingsScreenNavigator = () => { options={{title: strings.customPinTitle}} component={EnableLoginWithPinWrapper} /> + + + {() => } + ) } @@ -222,6 +226,10 @@ const messages = defineMessages({ id: 'components.settings.applicationsettingsscreen.about', defaultMessage: '!!!About', }, + analytics: { + id: 'components.settings.applicationsettingsscreen.analytics', + defaultMessage: '!!!Analytics', + }, }) const useStrings = () => { @@ -244,5 +252,6 @@ const useStrings = () => { currency: intl.formatMessage(globalMessages.currency), aboutTitle: intl.formatMessage(messages.aboutTitle), appSettingsTitle: intl.formatMessage(messages.appSettingsTitle), + analytics: intl.formatMessage(messages.analytics), } } diff --git a/apps/wallet-mobile/src/i18n/locales/en-US.json b/apps/wallet-mobile/src/i18n/locales/en-US.json index 0dd70d4862..ceb7d056dd 100644 --- a/apps/wallet-mobile/src/i18n/locales/en-US.json +++ b/apps/wallet-mobile/src/i18n/locales/en-US.json @@ -216,6 +216,7 @@ "components.settings.applicationsettingsscreen.crashReporting": "Send crash report to Emurgo", "components.settings.applicationsettingsscreen.appSettingsTitle": "App settings", "components.settings.applicationsettingsscreen.walletType": "Wallet type", + "components.settings.applicationsettingsscreen.analytics": "Analytics", "components.send.sendscreen.submittedTxTitle": "Transaction submitted", "components.send.sendscreen.submittedTxText": "Check this transaction in the list of wallet transactions", "components.send.sendscreen.submittedTxButton": "Go to transactions", diff --git a/apps/wallet-mobile/src/navigation.tsx b/apps/wallet-mobile/src/navigation.tsx index 3199a13042..17fde0501f 100644 --- a/apps/wallet-mobile/src/navigation.tsx +++ b/apps/wallet-mobile/src/navigation.tsx @@ -202,6 +202,7 @@ export type SettingsStackRoutes = { 'change-wallet-name': undefined 'terms-of-use': undefined support: undefined + analytics: undefined 'enable-login-with-os': undefined 'remove-wallet': undefined 'change-language': undefined From 2e1a3bae9090d9918ea254e60993e4f5795f3132 Mon Sep 17 00:00:00 2001 From: Javier Bueno Date: Wed, 2 Aug 2023 00:42:52 +0200 Subject: [PATCH 2/5] analytics icon colors --- apps/wallet-mobile/src/components/Icon/Analytics.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/wallet-mobile/src/components/Icon/Analytics.tsx b/apps/wallet-mobile/src/components/Icon/Analytics.tsx index ed996f4bd9..821260f892 100644 --- a/apps/wallet-mobile/src/components/Icon/Analytics.tsx +++ b/apps/wallet-mobile/src/components/Icon/Analytics.tsx @@ -1,15 +1,15 @@ import * as React from 'react' import Svg, {Path} from 'react-native-svg' -type Props = {size: number; color?: string} +type Props = {size?: number; color?: string} -export const Analytics = ({size = 24, color}: Props) => { +export const Analytics = ({size = 24, color = '#000'}: Props) => { return ( From ce7c76e7375920d8a1616f9a2472a4cdc5580db7 Mon Sep 17 00:00:00 2001 From: Javier Bueno Date: Wed, 2 Aug 2023 03:18:18 +0200 Subject: [PATCH 3/5] CR: update --- .../Settings/SettingsScreenNavigator.tsx | 17 +++++++++++------ apps/wallet-mobile/src/i18n/locales/en-US.json | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/wallet-mobile/src/features/Settings/SettingsScreenNavigator.tsx b/apps/wallet-mobile/src/features/Settings/SettingsScreenNavigator.tsx index 3f5a5f1aea..f32cc6282f 100644 --- a/apps/wallet-mobile/src/features/Settings/SettingsScreenNavigator.tsx +++ b/apps/wallet-mobile/src/features/Settings/SettingsScreenNavigator.tsx @@ -8,7 +8,12 @@ import {ChangePinScreen} from '../../auth' import {EnableLoginWithPin} from '../../auth/EnableLoginWithPin' import {Analytics, Boundary} from '../../components' import globalMessages from '../../i18n/global-messages' -import {defaultStackNavigationOptions, SettingsStackRoutes, SettingsTabRoutes} from '../../navigation' +import { + defaultStackNavigationOptions, + defaultStackNavigationOptionsV2, + SettingsStackRoutes, + SettingsTabRoutes, +} from '../../navigation' import {COLORS} from '../../theme' import {About} from './About' import {ApplicationSettingsScreen} from './ApplicationSettings' @@ -118,7 +123,7 @@ export const SettingsScreenNavigator = () => { component={EnableLoginWithPinWrapper} /> - + {() => } @@ -226,9 +231,9 @@ const messages = defineMessages({ id: 'components.settings.applicationsettingsscreen.about', defaultMessage: '!!!About', }, - analytics: { - id: 'components.settings.applicationsettingsscreen.analytics', - defaultMessage: '!!!Analytics', + userInsights: { + id: 'components.settings.applicationsettingsscreen.analyticsTitle', + defaultMessage: '!!!User Insights', }, }) @@ -252,6 +257,6 @@ const useStrings = () => { currency: intl.formatMessage(globalMessages.currency), aboutTitle: intl.formatMessage(messages.aboutTitle), appSettingsTitle: intl.formatMessage(messages.appSettingsTitle), - analytics: intl.formatMessage(messages.analytics), + userInsights: intl.formatMessage(messages.userInsights), } } diff --git a/apps/wallet-mobile/src/i18n/locales/en-US.json b/apps/wallet-mobile/src/i18n/locales/en-US.json index ceb7d056dd..df134d464d 100644 --- a/apps/wallet-mobile/src/i18n/locales/en-US.json +++ b/apps/wallet-mobile/src/i18n/locales/en-US.json @@ -217,6 +217,7 @@ "components.settings.applicationsettingsscreen.appSettingsTitle": "App settings", "components.settings.applicationsettingsscreen.walletType": "Wallet type", "components.settings.applicationsettingsscreen.analytics": "Analytics", + "components.settings.applicationsettingsscreen.analyticsTitle": "User Insights", "components.send.sendscreen.submittedTxTitle": "Transaction submitted", "components.send.sendscreen.submittedTxText": "Check this transaction in the list of wallet transactions", "components.send.sendscreen.submittedTxButton": "Go to transactions", From 4ad6567edf44c315145527fdca2022338ac9468b Mon Sep 17 00:00:00 2001 From: Javier Bueno Date: Wed, 2 Aug 2023 10:42:49 +0200 Subject: [PATCH 4/5] CR: update --- .../ApplicationSettingsScreen.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/wallet-mobile/src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx b/apps/wallet-mobile/src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx index 9fe0362388..a9f4a1ed20 100644 --- a/apps/wallet-mobile/src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx +++ b/apps/wallet-mobile/src/features/Settings/ApplicationSettings/ApplicationSettingsScreen.tsx @@ -4,6 +4,7 @@ import {ScrollView, StyleSheet, Switch} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' import {Icon, Spacer, StatusBar} from '../../../components' +import {features} from '../../../features' import {useLanguage} from '../../../i18n' import {isNightly} from '../../../legacy/config' import {useWalletNavigation} from '../../../navigation' @@ -75,11 +76,13 @@ export const ApplicationSettingsScreen = () => { navigateTo="terms-of-use" /> - } - label={strings.analytics} - navigateTo="analytics" - /> + {features.analytics && ( + } + label={strings.analytics} + navigateTo="analytics" + /> + )} From 12bfef1c340e634e20028b3d3de37a31df3231f1 Mon Sep 17 00:00:00 2001 From: Javier Bueno Date: Wed, 2 Aug 2023 15:02:21 +0200 Subject: [PATCH 5/5] CR: update --- apps/wallet-mobile/src/components/Icon/Icon.stories.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/wallet-mobile/src/components/Icon/Icon.stories.tsx b/apps/wallet-mobile/src/components/Icon/Icon.stories.tsx index 9d38925ed7..121a0a422a 100644 --- a/apps/wallet-mobile/src/components/Icon/Icon.stories.tsx +++ b/apps/wallet-mobile/src/components/Icon/Icon.stories.tsx @@ -208,6 +208,8 @@ storiesOf('Icon', module).add('Gallery', () => { } title="No NFTs" /> } title="External link" /> + + } title="Analytics" /> )