Skip to content

Commit

Permalink
Merge branch 'develop' into feat/price-updated-notification
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljscript authored Oct 25, 2024
2 parents 977de01 + 5a8dcc7 commit f1e2e44
Show file tree
Hide file tree
Showing 31 changed files with 569 additions and 377 deletions.
4 changes: 2 additions & 2 deletions apps/wallet-mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ android {
applicationId "com.emurgo"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 723
versionName "5.0.0"
versionName "5.0.1"
versionCode 732
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
Expand Down
4 changes: 2 additions & 2 deletions apps/wallet-mobile/ios/nightly.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.0.0</string>
<string>5.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>610</string>
<string>619</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
Expand Down
8 changes: 4 additions & 4 deletions apps/wallet-mobile/ios/yoroi.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@
CODE_SIGN_ENTITLEMENTS = yoroi/yoroi.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 610;
CURRENT_PROJECT_VERSION = 619;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = F8NVT2G2L4;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -885,7 +885,7 @@
CODE_SIGN_ENTITLEMENTS = yoroi/yoroi.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 610;
CURRENT_PROJECT_VERSION = 619;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = F8NVT2G2L4;
ENVFILE = "$(PODS_ROOT)/../../.env.production";
Expand Down Expand Up @@ -1081,7 +1081,7 @@
CODE_SIGN_ENTITLEMENTS = nightly.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 610;
CURRENT_PROJECT_VERSION = 619;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = F8NVT2G2L4;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -1126,7 +1126,7 @@
CODE_SIGN_ENTITLEMENTS = nightly.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 610;
CURRENT_PROJECT_VERSION = 619;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = F8NVT2G2L4;
ENVFILE = "$(PODS_ROOT)/../../.env.nightly";
Expand Down
4 changes: 2 additions & 2 deletions apps/wallet-mobile/ios/yoroi/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.0.0</string>
<string>5.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>610</string>
<string>619</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
Expand Down
4 changes: 2 additions & 2 deletions apps/wallet-mobile/ios/yoroiTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>5.0.0</string>
<string>5.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>610</string>
<string>619</string>
</dict>
</plist>
3 changes: 2 additions & 1 deletion apps/wallet-mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yoroi/wallet-mobile",
"version": "5.0.0",
"version": "5.0.1",
"private": true,
"scripts": {
"android-bundle": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res",
Expand Down Expand Up @@ -197,6 +197,7 @@
"react-native-skeleton-placeholder": "^5.2.0",
"react-native-svg": "13.8.0",
"react-native-svg-charts": "^5.4.0",
"react-native-system-navigation-bar": "^2.6.4",
"react-native-tab-view": "^3.1.1",
"react-native-timezone": "^2.3.0",
"react-native-url-polyfill": "^2.0.0",
Expand Down
21 changes: 18 additions & 3 deletions apps/wallet-mobile/src/AppNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import {NavigationContainer, NavigationContainerRef} from '@react-navigation/nat
import {createStackNavigator, TransitionPresets} from '@react-navigation/stack'
import {isString} from '@yoroi/common'
import {supportedPrefixes} from '@yoroi/links'
import {useTheme} from '@yoroi/theme'
import {ThemedPalette, useTheme} from '@yoroi/theme'
import * as React from 'react'
import {defineMessages, useIntl} from 'react-intl'
import {Alert, AppState, AppStateStatus, InteractionManager, Platform} from 'react-native'
import RNBootSplash from 'react-native-bootsplash'
import SystemNavigationBar from 'react-native-system-navigation-bar'

import StorybookScreen from '../.storybook'
import {ClipboardProvider} from './components/Clipboard/ClipboardProvider'
Expand Down Expand Up @@ -47,21 +48,35 @@ const Stack = createStackNavigator<AppRoutes>()
const navRef = React.createRef<NavigationContainerRef<ReactNavigation.RootParamList>>()
const prefixes = [...supportedPrefixes]

const changeNavigationBarColor = (colorScheme: 'default-dark' | 'default-light', color: ThemedPalette) => {
const buttonsColor = colorScheme === 'default-dark' ? 'light' : 'dark'
// Using 'transparent' or 'translucent' background breaks KeyboardAvoidingView
// https://github.com/kadiraydinli/react-native-system-navigation-bar/issues/38
SystemNavigationBar.setNavigationColor(color.bg_color_max, buttonsColor, 'navigation')
}

export const AppNavigator = () => {
useInitNotifications({enabled: features.notifications})
useDeepLinkWatcher()
const strings = useStrings()
const [routeName, setRouteName] = React.useState<string>()
useStatusBar(routeName)
useHideScreenInAppSwitcher()
const {atoms, color} = useTheme()
const {atoms, color, colorScheme} = useTheme()

React.useEffect(() => {
changeNavigationBarColor(colorScheme, color)
}, [colorScheme, color])

useAutoLogout()

const {isLoggedIn, isLoggedOut, login} = useAuth()
const {authWithOs} = useAuthWithOs({
onSuccess: login,
onSettled: () => RNBootSplash.hide({fade: true}),
onSettled: async () => {
await RNBootSplash.hide({fade: true})
changeNavigationBarColor(colorScheme, color)
},
})

const firstAction = useFirstAction()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useTheme} from '@yoroi/theme'
import {Image} from 'expo-image'
import * as React from 'react'
import {Linking, StyleSheet, Text, View} from 'react-native'
import {Linking, ScrollView, StyleSheet, Text, View} from 'react-native'

import {Button} from '../../../components/Button/Button'
import {Icon} from '../../../components/Icon'
Expand Down Expand Up @@ -67,7 +67,7 @@ export const ConfirmConnectionModal = ({name, website, onConfirm, logo, showSing
const imageUri = logo.length === 0 ? getDappFallbackLogo(website) : logo

return (
<View style={styles.root}>
<ScrollView style={styles.root} bounces={false}>
<View style={styles.imagesLine}>
<Icon.YoroiApp size={48} />

Expand Down Expand Up @@ -111,7 +111,7 @@ export const ConfirmConnectionModal = ({name, website, onConfirm, logo, showSing
<Spacer height={46} />

<Button title={strings.confirmConnectionModalConnect} onPress={onConfirm} />
</View>
</ScrollView>
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {useTheme} from '@yoroi/theme'
import * as React from 'react'
import {StyleSheet, Text, View} from 'react-native'
import {ScrollView, StyleSheet, Text, View} from 'react-native'
import {useSafeAreaInsets} from 'react-native-safe-area-context'

import {Button} from '../../../components/Button/Button'
Expand Down Expand Up @@ -38,7 +38,7 @@ export const UnverifiedDappModal = ({onConfirm}: Props) => {
const strings = useStrings()

return (
<View style={styles.container}>
<ScrollView style={styles.container} bounces={false}>
<View style={styles.line}>
<Text style={styles.text}>{strings.disclaimerModalText}</Text>
</View>
Expand All @@ -48,7 +48,7 @@ export const UnverifiedDappModal = ({onConfirm}: Props) => {
<View style={styles.actions}>
<Button title={strings.understand} onPress={onConfirm} />
</View>
</View>
</ScrollView>
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ import {useDappConnector} from '@yoroi/dapp-connector'
import {useTheme} from '@yoroi/theme'
import {Image} from 'expo-image'
import * as React from 'react'
import {Alert, Linking, StyleSheet, Text, TouchableOpacity, TouchableWithoutFeedback, View} from 'react-native'
import {
Alert,
Linking,
ScrollView,
StyleSheet,
Text,
TouchableOpacity,
TouchableWithoutFeedback,
View,
} from 'react-native'
import {useSafeAreaInsets} from 'react-native-safe-area-context'
import uuid from 'uuid'

Expand Down Expand Up @@ -93,7 +102,7 @@ export const DAppListItem = ({dApp, connected, onPress}: Props) => {

openModal(
strings.dAppActions,
<View style={styles.rootDialog}>
<ScrollView style={styles.rootDialog} bounces={false}>
<View style={styles.dAppInfo}>
<Image source={{uri: logo}} style={styles.dAppLogoDialog} />

Expand Down Expand Up @@ -127,7 +136,7 @@ export const DAppListItem = ({dApp, connected, onPress}: Props) => {
</View>

<Spacer fill />
</View>,
</ScrollView>,
dialogHeight,
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {useTheme} from '@yoroi/theme'
import * as React from 'react'
import {Image, StyleSheet, Text, View} from 'react-native'
import {Image, ScrollView, StyleSheet, Text, View} from 'react-native'
import {useSafeAreaInsets} from 'react-native-safe-area-context'

import IllustrationDAppImage from '../../../../assets/img/illustration-dapp.png'
Expand Down Expand Up @@ -67,14 +67,14 @@ const Modal = () => {
const {closeModal} = useModal()

return (
<View style={styles.container}>
<ScrollView style={styles.container} bounces={false}>
<Image source={IllustrationDAppImage} style={styles.welcomeImage} />

<Text style={styles.welcomeText}>{strings.welcomeToYoroiDAppExplorerDescription}</Text>

<View style={styles.actions}>
<Button onPress={closeModal} title={strings.next} />
</View>
</View>
</ScrollView>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ export const ReviewTxProvider = ({
dispatch({type: ReviewTxActionType.OnSuccessChanged, onSuccess}),
onErrorChanged: (onError: ReviewTxState['onError']) => dispatch({type: ReviewTxActionType.OnErrorChanged, onError}),
onNotSupportedCIP1694Changed: (onNotSupportedCIP1694: ReviewTxState['onNotSupportedCIP1694']) =>
dispatch({type: ReviewTxActionType.onNotSupportedCIP1694Changed, onNotSupportedCIP1694}),
dispatch({type: ReviewTxActionType.OnNotSupportedCIP1694Changed, onNotSupportedCIP1694}),
onCIP36SupportChangeChanged: (onCIP36SupportChange: ReviewTxState['onCIP36SupportChange']) =>
dispatch({type: ReviewTxActionType.onCIP36SupportChangeChanged, onCIP36SupportChange}),
dispatch({type: ReviewTxActionType.OnCIP36SupportChangeChanged, onCIP36SupportChange}),
reset: () => dispatch({type: ReviewTxActionType.Reset}),
}).current

const context = React.useMemo(
Expand Down Expand Up @@ -78,14 +79,26 @@ const reviewTxReducer = (state: ReviewTxState, action: ReviewTxAction) => {
draft.onError = action.onError
break

case ReviewTxActionType.onNotSupportedCIP1694Changed:
case ReviewTxActionType.OnNotSupportedCIP1694Changed:
draft.onNotSupportedCIP1694 = action.onNotSupportedCIP1694
break

case ReviewTxActionType.onCIP36SupportChangeChanged:
case ReviewTxActionType.OnCIP36SupportChangeChanged:
draft.onCIP36SupportChange = action.onCIP36SupportChange
break

case ReviewTxActionType.Reset:
draft.unsignedTx = castDraft(defaultState.unsignedTx)
draft.cbor = defaultState.cbor
draft.operations = defaultState.operations
draft.customReceiverTitle = defaultState.customReceiverTitle
draft.details = defaultState.details
draft.onSuccess = defaultState.onSuccess
draft.onError = defaultState.onError
draft.onNotSupportedCIP1694 = defaultState.onNotSupportedCIP1694
draft.onCIP36SupportChange = defaultState.onCIP36SupportChange
break

default:
throw new Error('[ReviewTxContext] invalid action')
}
Expand Down Expand Up @@ -122,13 +135,16 @@ type ReviewTxAction =
onError: ReviewTxState['onError']
}
| {
type: ReviewTxActionType.onNotSupportedCIP1694Changed
type: ReviewTxActionType.OnNotSupportedCIP1694Changed
onNotSupportedCIP1694: ReviewTxState['onNotSupportedCIP1694']
}
| {
type: ReviewTxActionType.onCIP36SupportChangeChanged
type: ReviewTxActionType.OnCIP36SupportChangeChanged
onCIP36SupportChange: ReviewTxState['onCIP36SupportChange']
}
| {
type: ReviewTxActionType.Reset
}

export type ReviewTxState = {
unsignedTx: YoroiUnsignedTx | null
Expand All @@ -152,6 +168,7 @@ type ReviewTxActions = {
onErrorChanged: (onError: ReviewTxState['onError']) => void
onNotSupportedCIP1694Changed: (onNotSupportedCIP1694: ReviewTxState['onNotSupportedCIP1694']) => void
onCIP36SupportChangeChanged: (onCIP36SupportChange: ReviewTxState['onCIP36SupportChange']) => void
reset: () => void
}

const defaultState: ReviewTxState = Object.freeze({
Expand Down Expand Up @@ -181,6 +198,7 @@ const initialReviewTxContext: ReviewTxContext = {
onErrorChanged: missingInit,
onNotSupportedCIP1694Changed: missingInit,
onCIP36SupportChangeChanged: missingInit,
reset: missingInit,
}

enum ReviewTxActionType {
Expand All @@ -191,8 +209,9 @@ enum ReviewTxActionType {
DetailsChanged = 'detailsChanged',
OnSuccessChanged = 'onSuccessChanged',
OnErrorChanged = 'onErrorChanged',
onNotSupportedCIP1694Changed = 'onNotSupportedCIP1694Changed',
onCIP36SupportChangeChanged = 'onCIP36SupportChangeChanged',
OnNotSupportedCIP1694Changed = 'onNotSupportedCIP1694Changed',
OnCIP36SupportChangeChanged = 'onCIP36SupportChangeChanged',
Reset = 'reset',
}

type ReviewTxContext = ReviewTxState & ReviewTxActions
Expand Down
Loading

0 comments on commit f1e2e44

Please sign in to comment.