Skip to content

Commit

Permalink
Merge branch 'develop' into fix/setup-wallet-dialog-space
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss authored May 24, 2024
2 parents b999df1 + e05bbc7 commit 5a7076d
Show file tree
Hide file tree
Showing 540 changed files with 10,649 additions and 5,349 deletions.
2 changes: 0 additions & 2 deletions apps/wallet-mobile/.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ BUILD_VARIANT=STAGING
SENTRY_DSN=https://[email protected]/4505319746764800

DISABLE_LOGBOX=true
SHOW_PROD_POOLS_IN_DEV=true
USE_TESTNET=true

WALLET_1_MNEMONIC=abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon address
WALLET_1_NETWORK_ID=300
Expand Down
2 changes: 0 additions & 2 deletions apps/wallet-mobile/.env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ BUILD_VARIANT=STAGING
SENTRY_DSN=https://[email protected]/4505319746764800

USE_TESTNET=true
DISABLE_LOG_BOX=true
SHOW_PROD_POOLS_IN_DEV=true

WALLET_1_MNEMONIC=abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon address
WALLET_1_NETWORK_ID=300
Expand Down
30 changes: 16 additions & 14 deletions apps/wallet-mobile/.storybook/storybook.requires.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/wallet-mobile/ampli.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"Platform": "React Native",
"Language": "TypeScript",
"SDK": "@amplitude/analytics-react-native@^1.0",
"Path": "./src/metrics/ampli",
"Path": "./src/kernel/metrics/ampli",
"InstanceNames": [
"track"
]
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/i18n-unused.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
localesPath: 'src/i18n/locales/',
localesPath: 'src/kernel/i18n/locales/',
srcPath: 'src'
}
6 changes: 2 additions & 4 deletions apps/wallet-mobile/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import './polyfills'
import 'react-native-url-polyfill/auto'
import 'react-native-gesture-handler' // required by react-navigation
import './global'
import './src/i18n/polyfills' // https://formatjs.io/docs/polyfills

import 'react-native-gesture-handler' // required by react-navigation
import BigNumber from 'bignumber.js'
import {enableMapSet} from 'immer'

import {AppRegistry} from 'react-native'

import {name} from './app.json'
Expand Down
8 changes: 2 additions & 6 deletions apps/wallet-mobile/jestSetup.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
/* eslint-env jest */
/* This module sets up Jest */
import 'react-native-gesture-handler/jestSetup'

import fetch from 'node-fetch'

import {Logger, LogLevel} from './src/legacy/logging'
import * as YoroiLogging from './src/yoroi-wallets/logging'
import {logger} from './src/kernel/logger/logger'
logger.disable()

global.fetch = fetch
Logger.setLogLevel(LogLevel.Warn)

jest.mock('react-native-device-info', () => ({getVersion: () => '1.5.1'}))
jest.mock('react-native-randombytes', () => require('crypto').randomBytes)
Expand Down Expand Up @@ -60,5 +58,3 @@ jest.mock('react-native-localize', () => ({
usesAutoTimeZone: () => true,
}))

Logger.setLogLevel(LogLevel.Nothing)
YoroiLogging.Logger.setLogLevel(YoroiLogging.LogLevel.Nothing)
2 changes: 1 addition & 1 deletion apps/wallet-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"@emurgo/csl-mobile-bridge": "6.0.0-alpha.9",
"@emurgo/react-native-blockies-svg": "^0.0.2",
"@emurgo/react-native-hid": "^5.15.6",
"@emurgo/yoroi-lib": "0.15.4-alpha.6",
"@emurgo/yoroi-lib": "0.15.4-alpha.7",
"@formatjs/intl-datetimeformat": "^6.7.0",
"@formatjs/intl-getcanonicallocales": "^2.1.0",
"@formatjs/intl-locale": "^3.2.1",
Expand Down
2 changes: 2 additions & 0 deletions apps/wallet-mobile/polyfills.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import {Buffer} from 'buffer'
import 'react-native-url-polyfill/auto'
import './src/kernel/i18n/polyfills' // https://formatjs.io/docs/polyfills

Object.fromEntries = Object.fromEntries || ((arr) => arr.reduce((acc, [k, v]) => ((acc[k] = v), acc), {}))

Expand Down
18 changes: 9 additions & 9 deletions apps/wallet-mobile/src/AppNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import {Alert, AppState, AppStateStatus, InteractionManager, Platform} from 'rea
import RNBootSplash from 'react-native-bootsplash'

import StorybookScreen from '../.storybook'
import {OsLoginScreen, PinLoginScreen, useBackgroundTimeout} from './auth'
import {useAuth} from './auth/AuthProvider'
import {supportsAndroidFingerprintOverlay} from './auth/biometrics'
import {EnableLoginWithPin} from './auth/EnableLoginWithPin'
import {useStatusBar} from './components/hooks/useStatusBar'
import {ModalProvider} from './components/Modal/ModalContext'
import {ModalScreen} from './components/Modal/ModalScreen'
import {OsLoginScreen, PinLoginScreen, useBackgroundTimeout} from './features/Auth'
import {useAuth} from './features/Auth/AuthProvider'
import {supportsAndroidFingerprintOverlay} from './features/Auth/common/biometrics'
import {AuthSetting, useAuthSetting, useAuthWithOs, useIsAuthOsSupported} from './features/Auth/common/hooks'
import {EnableLoginWithPin} from './features/Auth/EnableLoginWithPin'
import {DeveloperScreen} from './features/Dev/DeveloperScreen'
import {AgreementChangedNavigator, InitializationNavigator} from './features/Initialization'
import {LegalAgreement, useLegalAgreement} from './features/Initialization/common'
import {useDeepLinkWatcher} from './features/Links/common/useDeepLinkWatcher'
Expand All @@ -26,12 +28,10 @@ import {
useShowBiometricsScreen,
} from './features/SetupWallet/useCases/ChooseBiometricLogin/ChooseBiometricLoginScreen'
import {useWalletManager} from './features/WalletManager/context/WalletManagerContext'
import {CONFIG} from './legacy/config'
import {DeveloperScreen} from './legacy/DeveloperScreen'
import {AppRoutes} from './navigation'
import {agreementDate} from './kernel/config'
import {AppRoutes} from './kernel/navigation'
import {SearchProvider} from './Search/SearchContext'
import {WalletNavigator} from './WalletNavigator'
import {AuthSetting, useAuthSetting, useAuthWithOs, useIsAuthOsSupported} from './yoroi-wallets/auth'
import {useHasWallets} from './yoroi-wallets/hooks'

const Stack = createStackNavigator<AppRoutes>()
Expand Down Expand Up @@ -280,7 +280,7 @@ const getFirstAction = (
authSetting: AuthSetting,
legalAgreement: LegalAgreement | undefined | null,
): FirstAction => {
const hasAccepted = legalAgreement?.latestAcceptedAgreementsDate === CONFIG.AGREEMENT_DATE
const hasAccepted = legalAgreement?.latestAcceptedAgreementsDate === agreementDate

if (isString(authSetting) && !hasAccepted) return 'show-agreement-changed-notice'

Expand Down
4 changes: 2 additions & 2 deletions apps/wallet-mobile/src/Catalyst/ConfirmPin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {SafeAreaView} from 'react-native-safe-area-context'

import {ProgressStep, Spacer} from '../components'
import {BACKSPACE, NumericKeyboard} from '../components/NumericKeyboard'
import {showErrorDialog} from '../dialogs'
import {errorMessages} from '../i18n/global-messages'
import {showErrorDialog} from '../kernel/dialogs'
import {errorMessages} from '../kernel/i18n/global-messages'
import {Description, PinBox, Row, Title} from './components'

const PIN_LENGTH = 4
Expand Down
4 changes: 2 additions & 2 deletions apps/wallet-mobile/src/Catalyst/ConfirmVotingTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {ConfirmTx} from '../components/ConfirmTx'
import {debugWalletInfo, features} from '../features'
import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext'
import {Instructions as HWInstructions} from '../HW'
import {errorMessages, txLabels} from '../i18n/global-messages'
import LocalizableError from '../i18n/LocalizableError'
import {errorMessages, txLabels} from '../kernel/i18n/global-messages'
import LocalizableError from '../kernel/i18n/LocalizableError'
import {formatTokenWithSymbol} from '../legacy/format'
import {useVotingRegTx} from '../yoroi-wallets/hooks'
import {Amounts} from '../yoroi-wallets/utils'
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/Catalyst/DisplayPin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {ScrollView, StyleSheet} from 'react-native'
import {SafeAreaView} from 'react-native-safe-area-context'

import {Button, ProgressStep, Spacer} from '../components'
import {confirmationMessages} from '../i18n/global-messages'
import {confirmationMessages} from '../kernel/i18n/global-messages'
import {Actions, Description, PinBox, Row, Title} from './components'
import {useCountdown} from './hooks'

Expand Down
15 changes: 3 additions & 12 deletions apps/wallet-mobile/src/Catalyst/DownloadCatalyst.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import AppDownload from '../assets/img/pic-catalyst-step1.png'
import {Button, ProgressStep, Spacer, StandardModal, Text} from '../components'
import {useStakingInfo} from '../Dashboard/StakePoolInfos'
import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext'
import globalMessages, {confirmationMessages} from '../i18n/global-messages'
import {Logger} from '../legacy/logging'
import globalMessages, {confirmationMessages} from '../kernel/i18n/global-messages'
import {Actions, Row} from './components'

type Props = {
Expand Down Expand Up @@ -77,11 +76,7 @@ const Tip = (props: ViewProps) => <View {...props} style={styles.tip} />

const PlayStoreButton = () => {
const openPlayStore = async () => {
try {
await Linking.openURL('https://play.google.com/store/apps/details?id=io.iohk.vitvoting')
} catch (e) {
Logger.error(e as any)
}
await Linking.openURL('https://play.google.com/store/apps/details?id=io.iohk.vitvoting')
}

return (
Expand All @@ -93,11 +88,7 @@ const PlayStoreButton = () => {

const AppStoreButton = () => {
const openAppStore = async () => {
try {
await Linking.openURL('https://apps.apple.com/kg/app/catalyst-voting/id1517473397')
} catch (e) {
Logger.error(e as any)
}
await Linking.openURL('https://apps.apple.com/kg/app/catalyst-voting/id1517473397')
}

return (
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/Catalyst/InsufficientFundsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {StyleSheet, Text, View} from 'react-native'

import {StandardModal} from '../components'
import {useSelectedWallet} from '../features/WalletManager/context/SelectedWalletContext'
import globalMessages, {confirmationMessages} from '../i18n/global-messages'
import globalMessages, {confirmationMessages} from '../kernel/i18n/global-messages'
import {formatTokenWithText} from '../legacy/format'
import {CATALYST} from '../yoroi-wallets/cardano/utils'
import {useBalances} from '../yoroi-wallets/hooks'
Expand Down
4 changes: 2 additions & 2 deletions apps/wallet-mobile/src/Catalyst/QrCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import QRCodeSVG from 'react-native-qrcode-svg'
import {SafeAreaView} from 'react-native-safe-area-context'

import {Button, CopyButton, ProgressStep, Spacer, Text} from '../components'
import {confirmationMessages} from '../i18n/global-messages'
import {useBlockGoBack} from '../navigation'
import {confirmationMessages} from '../kernel/i18n/global-messages'
import {useBlockGoBack} from '../kernel/navigation'
import {useAllowScreenshots} from '../utils'
import {Actions, Description, Title} from './components'
import {useCountdown} from './hooks'
Expand Down
Loading

0 comments on commit 5a7076d

Please sign in to comment.