Skip to content

Commit

Permalink
Merge branch 'main' into jeanregisser/skeleton-placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanregisser committed Dec 23, 2022
2 parents 999ccfe + cfb8303 commit db4566c
Show file tree
Hide file tree
Showing 25 changed files with 176 additions and 137 deletions.
8 changes: 8 additions & 0 deletions .depcheckrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
ignores: [
"@actions/github",
"@babel/runtime", # enforce specific version for react-native
"@react-native-picker/picker", # react-native-picker-select requires
"@types/*",
"babel-core",
"babel-jest",
"jest-circus",
"jest-html-reporter",
"jest-junit",
"jest-snapshot",
"lokijs", # walletconnect e2e tests requires
"metro-react-native-babel-preset",
"prettier-plugin-java",
"pretty-quick",
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,21 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn || yarn --network-concurrency 1
- run: yarn check-licenses
depcheck:
name: Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
check-latest: true
# https://github.com/actions/cache/blob/main/examples.md#node---lerna
- uses: actions/cache@v3
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn || yarn --network-concurrency 1
- run: yarn depcheck
2 changes: 1 addition & 1 deletion __mocks__/react-native-device-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import mockRNDeviceInfo from 'react-native-device-info/jest/react-native-device-
mockRNDeviceInfo.getBundleId.mockImplementation(() => 'org.celo.mobile.debug')
mockRNDeviceInfo.getVersion.mockImplementation(() => '0.0.1')
mockRNDeviceInfo.getBuildNumber.mockImplementation(() => '1')
mockRNDeviceInfo.getUniqueId.mockImplementation(() => 'abc-def-123')
mockRNDeviceInfo.getUniqueId.mockImplementation(() => Promise.resolve('abc-def-123'))
mockRNDeviceInfo.getDeviceId.mockImplementation(() => 'someDeviceId')
mockRNDeviceInfo.getBrand.mockImplementation(() => 'someBrand')
mockRNDeviceInfo.getModel.mockImplementation(() => 'someModel')
Expand Down
4 changes: 4 additions & 0 deletions locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,10 @@
"noFavorites": {
"title": "Keine Favoriten hinzugefügt",
"description": "Behalte den Überblick über deine meistgenutzten Dapps, indem du auf das Sternsymbol tippst, um sie als Favoriten hinzuzufügen"
},
"favoritedDappToast": {
"message": "Als Favorit hinzugefügt",
"labelCTA": "Favoriten ansehen"
}
},
"dappsScreenHelpDialog": {
Expand Down
4 changes: 4 additions & 0 deletions locales/en-US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,10 @@
"noFavorites": {
"title": "No favorites added",
"description": "Keep track of your most-used Dapps by tapping the star icon to add it as a favorite"
},
"favoritedDappToast": {
"message": "Added as a favorite",
"labelCTA": "View Favorites"
}
},
"dappsScreenHelpDialog": {
Expand Down
4 changes: 4 additions & 0 deletions locales/es-419/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,10 @@
"noFavorites": {
"title": "No se han añadido favoritos",
"description": "Haz un seguimiento de tus Dapps más utilizadas tocando el icono de la estrella para añadirla como favorita"
},
"favoritedDappToast": {
"message": "Añadido como favorito",
"labelCTA": "Ver favoritos"
}
},
"dappsScreenHelpDialog": {
Expand Down
4 changes: 4 additions & 0 deletions locales/fr-FR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,10 @@
"noFavorites": {
"title": "Aucun favori ajouté",
"description": "Garde la trace de tes Dapps les plus utilisées en tapant sur l'icône en forme d'étoile pour les ajouter à tes favoris."
},
"favoritedDappToast": {
"message": "Ajouté comme favori",
"labelCTA": "Voir les favoris"
}
},
"dappsScreenHelpDialog": {
Expand Down
4 changes: 4 additions & 0 deletions locales/it-IT/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,10 @@
"noFavorites": {
"title": "Nessun preferito aggiunto",
"description": "Tieni traccia delle tue Dapp più utilizzate toccando l'icona a forma di stella per aggiungerle ai preferiti."
},
"favoritedDappToast": {
"message": "Aggiunto tra i preferiti",
"labelCTA": "Visualizza i preferiti"
}
},
"dappsScreenHelpDialog": {
Expand Down
4 changes: 4 additions & 0 deletions locales/pl-PL/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,10 @@
"noFavorites": {
"title": "Nie dodano żadnych ulubionych",
"description": "Śledź swoje najczęściej używane aplikacje, dotykając ikony gwiazdki, aby dodać je do ulubionych"
},
"favoritedDappToast": {
"message": "Dodane jako ulubione",
"labelCTA": "Zobacz Ulubione"
}
},
"dappsScreenHelpDialog": {
Expand Down
4 changes: 4 additions & 0 deletions locales/pt-BR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,10 @@
"noFavorites": {
"title": "Sem favoritos adicionados",
"description": "Mantenha-se a par dos seus Dapps mais utilizados, tocando no ícone da estrela para o adicionar como um favorito"
},
"favoritedDappToast": {
"message": "Adicionado como um favorito",
"labelCTA": "Ver Favoritos"
}
},
"dappsScreenHelpDialog": {
Expand Down
4 changes: 4 additions & 0 deletions locales/ru-RU/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,10 @@
"noFavorites": {
"title": "Избранное не добавлено",
"description": "Отслеживай свои самые используемые Dapps, нажимая на значок звезды, чтобы добавить его в избранное"
},
"favoritedDappToast": {
"message": "Добавлено в избранное",
"labelCTA": "Посмотреть избранное"
}
},
"dappsScreenHelpDialog": {
Expand Down
4 changes: 4 additions & 0 deletions locales/th-TH/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,10 @@
"noFavorites": {
"title": "No favorites added",
"description": "Keep track of your most-used Dapps by tapping the star icon to add it as a favorite"
},
"favoritedDappToast": {
"message": "Added as a favorite",
"labelCTA": "View Favorites"
}
},
"dappsScreenHelpDialog": {
Expand Down
4 changes: 4 additions & 0 deletions locales/tr-TR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,10 @@
"noFavorites": {
"title": "Favori eklenmemiş",
"description": "Favori olarak eklemek için yıldız simgesine dokunarak en çok kullandığınız Dapp'leri takip edin"
},
"favoritedDappToast": {
"message": "Favori olarak eklendi",
"labelCTA": "Favorileri Görüntüle"
}
},
"dappsScreenHelpDialog": {
Expand Down
4 changes: 4 additions & 0 deletions locales/uk-UA/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,10 @@
"noFavorites": {
"title": "Немає доданих улюблених",
"description": "Слідкуйте за своїми найпопулярнішими Dapps натиснувши на іконку із зірочкою, щоб додати її в обране"
},
"favoritedDappToast": {
"message": "Додано як улюблене",
"labelCTA": "Переглянути вподобання"
}
},
"dappsScreenHelpDialog": {
Expand Down
4 changes: 4 additions & 0 deletions locales/vi-VN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,10 @@
"noFavorites": {
"title": "No favorites added",
"description": "Keep track of your most-used Dapps by tapping the star icon to add it as a favorite"
},
"favoritedDappToast": {
"message": "Added as a favorite",
"labelCTA": "View Favorites"
}
},
"dappsScreenHelpDialog": {
Expand Down
4 changes: 4 additions & 0 deletions locales/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,10 @@
"noFavorites": {
"title": "没有添加收藏夹",
"description": "追踪你最常用的Dapps,点击星星图标将其添加为最爱。"
},
"favoritedDappToast": {
"message": "添加为收藏夹",
"labelCTA": "查看收藏夹"
}
},
"dappsScreenHelpDialog": {
Expand Down
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"@walletconnect/react-native-compat": "^2.1.3",
"@walletconnect/sign-client": "^2.1.3",
"@walletconnect/utils": "^2.1.3",
"Base64": "^1.0.1",
"Base64": "^1.1.0",
"apollo-boost": "^0.4.9",
"apollo-cache-persist": "^0.1.1",
"await-lock": "^2.1.0",
Expand All @@ -120,7 +120,7 @@
"ethereumjs-util": "^7.1.3",
"fast-shuffle": "^5.0.2",
"fp-ts": "2.1.1",
"fuzzysort": "^1.1.4",
"fuzzysort": "^2.0.4",
"graphql": "^14.1.1",
"i18next": "^19.4.3",
"ibantools": "^4.1.6",
Expand Down Expand Up @@ -183,10 +183,9 @@
"redux-persist-fs-storage": "^1.3.0",
"redux-saga": "^1.1.3",
"reselect": "^4.0.0",
"sleep-promise": "^8.0.1",
"statsig-react-native": "^4.6.0",
"svgs": "^4.2.0",
"tslib": "^1.11.1",
"tslib": "^2.4.1",
"utf8": "^3.0.0",
"uuid": "^8.3.0",
"victory-native": "^36.6.8",
Expand Down Expand Up @@ -255,12 +254,10 @@
"mockdate": "^3.0.5",
"patch-package": "^6.2.2",
"pixelmatch": "^5.2.1",
"postinstall-prepare": "^1.0.1",
"prettier": "2.7.1",
"prettier-plugin-java": "^1.6.2",
"pretty-quick": "^2.0.1",
"react-devtools": "^4.26.0",
"react-native-debugger-open": "^0.3.17",
"react-native-dotenv": "^3.2.0",
"react-native-flipper": "^0.127.0",
"react-native-kill-packager": "^1.0.0",
Expand Down
30 changes: 2 additions & 28 deletions src/account/LicenseDisclaimer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3381,7 +3381,7 @@ This software is dual-licensed under Apache 2.0 and WTFPL
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2015 David Chambers
Copyright 2019 David Chambers

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -3399,7 +3399,7 @@ This software is dual-licensed under Apache 2.0 and WTFPL
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (c) 2011..2012 David Chambers <dc@hashify.me>
Copyright (c) 2011..2019 David Chambers <dc@davidchambers.me>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
Expand Down Expand Up @@ -23572,32 +23572,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,

-----

The following software may be included in this product: sleep-promise. A copy of the source code may be downloaded from https://github.com/brummelte/sleep-promise. This software contains the following license and notice below:

The MIT License (MIT)

Copyright (c) 2015 Jan Brummelte

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

-----

The following software may be included in this product: slice-ansi. A copy of the source code may be downloaded from https://github.com/chalk/slice-ansi.git. This software contains the following license and notice below:

MIT License
Expand Down
37 changes: 35 additions & 2 deletions src/analytics/ValoraAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,36 @@ import { Statsig } from 'statsig-react-native'

const TAG = 'ValoraAnalytics'

async function getDeviceInfo() {
interface DeviceInfoType {
AppName: string
Brand: string
BuildNumber: string
BundleId: string
Carrier: string
DeviceId: string // this is the device model + version
FirstInstallTime: number
FontScale: number
FreeDiskStorage: number
InstallReferrer: string
InstanceID: string
LastUpdateTime: number
Manufacturer: string
MaxMemory: number
Model: string
ReadableVersion: string
SystemName: string
SystemVersion: string
TotalDiskCapacity: number
TotalMemory: number
UniqueID: string // this is the unique id of the device, which maps to deviceId in the data
UserAgent: string
Version: string
isEmulator: boolean
isTablet: boolean
UsedMemory: number
}

async function getDeviceInfo(): Promise<DeviceInfoType> {
return {
AppName: DeviceInfo.getApplicationName(),
Brand: DeviceInfo.getBrand(),
Expand Down Expand Up @@ -71,7 +100,7 @@ const SEGMENT_OPTIONS: analytics.Configuration = {

class ValoraAnalytics {
sessionId: string = ''
deviceInfo: object = {}
deviceInfo: DeviceInfoType | undefined

private currentScreenId: string | undefined
private prevScreenId: string | undefined
Expand Down Expand Up @@ -272,6 +301,10 @@ class ValoraAnalytics {
const prefixedSuperProps = Object.fromEntries(
Object.entries({
...traits,
deviceId: this.deviceInfo?.UniqueID,
appVersion: this.deviceInfo?.Version,
appBuildNumber: this.deviceInfo?.BuildNumber,
appBundleId: this.deviceInfo?.BundleId,
currentScreenId: this.currentScreenId,
prevScreenId: this.prevScreenId,
}).map(([key, value]) => [`s${key.charAt(0).toUpperCase() + key.slice(1)}`, value])
Expand Down
4 changes: 0 additions & 4 deletions src/analytics/selectors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,10 @@ describe('getCurrentUserTraits', () => {
})
expect(getCurrentUserTraits(state)).toStrictEqual({
accountAddress: '0x0000000000000000000000000000000000007E57',
appBuildNumber: '1',
appBundleId: 'org.celo.mobile.debug',
appVersion: '0.0.1',
celoBalance: 0,
ceurBalance: 21,
countryCodeAlpha2: 'US',
cusdBalance: 10,
deviceId: 'abc-def-123',
deviceLanguage: 'en-US',
hasCompletedBackup: false,
hasVerifiedNumber: false,
Expand Down
5 changes: 0 additions & 5 deletions src/analytics/selectors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { getRegionCodeFromCountryCode } from '@celo/phone-utils'
import BigNumber from 'bignumber.js'
import DeviceInfo from 'react-native-device-info'
import * as RNLocalize from 'react-native-localize'
import { createSelector } from 'reselect'
import { defaultCountryCodeSelector, pincodeTypeSelector } from 'src/account/selectors'
Expand Down Expand Up @@ -90,10 +89,6 @@ export const getCurrentUserTraits = createSelector(
localCurrencyCode,
hasVerifiedNumber,
hasCompletedBackup,
deviceId: DeviceInfo.getUniqueId(),
appVersion: DeviceInfo.getVersion(),
appBuildNumber: DeviceInfo.getBuildNumber(),
appBundleId: DeviceInfo.getBundleId(),
pincodeType,
superchargingToken: superchargeInfo.superchargingTokenConfig?.tokenSymbol,
superchargingAmountInUsd: superchargeInfo.superchargeUsdBalance,
Expand Down
1 change: 0 additions & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ declare module '*.json' {
declare module '*.png'
declare module '*.jpg'

declare module 'sleep-promise'
declare module 'dot-prop-immutable'
declare module 'react-native-crypto'
declare module 'react-native-bip39'
Expand Down
2 changes: 1 addition & 1 deletion src/navigator/NavigationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
StackActions,
} from '@react-navigation/native'
import { createRef, MutableRefObject } from 'react'
import sleep from 'sleep-promise'
import { sleep } from '@celo/utils/lib/async'
import { PincodeType } from 'src/account/reducer'
import { pincodeTypeSelector } from 'src/account/selectors'
import { AuthenticationEvents, NavigationEvents, OnboardingEvents } from 'src/analytics/Events'
Expand Down
Loading

0 comments on commit db4566c

Please sign in to comment.