Skip to content

Commit

Permalink
Merge branch 'develop' into YV-47-alt
Browse files Browse the repository at this point in the history
  • Loading branch information
jorbuedo committed Dec 16, 2024
2 parents cfb056a + 0c05f3a commit f1be897
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 49 deletions.
2 changes: 1 addition & 1 deletion apps/wallet-mobile/.tool-versions
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
nodejs 18.19.1
rust 1.69.0
java adoptopenjdk-17.0.10+7
ruby 3.2.2
ruby 3.1.2
python 3.11.3
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
versionName "5.0.1"
versionCode 732
versionName "5.0.2"
versionCode 738
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.1</string>
<string>5.0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>619</string>
<string>625</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 = 619;
CURRENT_PROJECT_VERSION = 625;
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 = 619;
CURRENT_PROJECT_VERSION = 625;
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 = 619;
CURRENT_PROJECT_VERSION = 625;
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 = 619;
CURRENT_PROJECT_VERSION = 625;
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.1</string>
<string>5.0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>619</string>
<string>625</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.1</string>
<string>5.0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>619</string>
<string>625</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions 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.1",
"version": "5.0.2",
"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 @@ -101,7 +101,7 @@
"@emurgo/csl-mobile-bridge": "^7.1.0",
"@emurgo/msl-mobile-bridge": "^1.0.4",
"@emurgo/react-native-hid": "5.15.8",
"@emurgo/yoroi-lib": "2.2.1",
"@emurgo/yoroi-lib": "2.2.2",
"@formatjs/intl-datetimeformat": "^6.7.0",
"@formatjs/intl-getcanonicallocales": "^2.1.0",
"@formatjs/intl-locale": "^3.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ export const ClipboardProvider = ({children}: Props) => {
const [copied, setCopied] = React.useState<CopiedState | null>(null)
const {height, width} = useWindowDimensions()
const copy: ClipboardContext['copy'] = ({text, feedback = 'Copied', event}) => {
const baseLocationX = (event?.nativeEvent.pageX ?? width * 0.5) - feedback.length * 4
const maxX = width - 20 - feedback.length * 8
const minX = 20 + feedback.length * 8
const locationX = Math.min(Math.max(baseLocationX, minX), maxX)

Clipboard.setString(text)
setCopied({
feedback,
locationY: event ? event.nativeEvent.pageY - 50 : height * 0.85,
locationX: (event?.nativeEvent.pageX ?? width * 0.5) - feedback.length * 4,
locationX,
})
setTimeout(() => setCopied(null), FEEDBACK_TIMEOUT)
}
Expand Down
30 changes: 16 additions & 14 deletions apps/wallet-mobile/src/components/CopyButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {useTheme} from '@yoroi/theme'
import React from 'react'
import {StyleProp, ViewStyle} from 'react-native'
import {StyleProp, View, ViewStyle} from 'react-native'

import {Icon} from '../components/Icon'
import {Button, ButtonType} from './Button/Button'
Expand All @@ -15,22 +15,24 @@ type CopyButtonProps = {
message?: string
}

export const CopyButton = ({title, value, onCopy, message}: CopyButtonProps) => {
export const CopyButton = ({title, value, onCopy, message, style}: CopyButtonProps) => {
const {isCopying, copy} = useCopy()
const {atoms} = useTheme()

return (
<Button
type={ButtonType.SecondaryText}
fontOverride={atoms.body_1_lg_regular}
style={{...atoms.p_0, ...atoms.justify_between}}
title={title}
icon={isCopying ? Icon.CopySuccess : Icon.Copy}
rightIcon
onPress={(event) => {
copy({text: value, feedback: message, event})
onCopy?.()
}}
/>
<View style={style}>
<Button
type={ButtonType.SecondaryText}
fontOverride={atoms.body_1_lg_regular}
style={{...atoms.p_0, ...atoms.justify_between, flexGrow: 0}}
title={title}
icon={isCopying ? Icon.CopySuccess : Icon.Copy}
rightIcon
onPress={(event) => {
copy({text: value, feedback: message, event})
onCopy?.()
}}
/>
</View>
)
}
4 changes: 2 additions & 2 deletions apps/wallet-mobile/src/features/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ const KnowledgeBase = Item
const Catalyst = ({label, left, onPress}: {label: string; left: React.ReactElement; onPress: () => void}) => {
const strings = useStrings()
const {wallet} = useSelectedWallet()
const {canVote, sufficientFunds} = useCanVote(wallet)
const {sufficientFunds} = useCanVote(wallet)
const {openModal} = useModal()
const screenHeight = useWindowDimensions().height
const modalHeight = Math.min(screenHeight * 0.8, 256)
Expand All @@ -200,7 +200,7 @@ const Catalyst = ({label, left, onPress}: {label: string; left: React.ReactEleme
openModal(strings.attention, <InsufficientFundsModal />, modalHeight)
}
}
return <Item label={label} onPress={handlePress} left={left} disabled={!canVote} />
return <Item label={label} onPress={handlePress} left={left} />
}

const SUPPORT_TICKET_LINK = 'https://emurgohelpdesk.zendesk.com/hc/en-us/requests/new?ticket_form_id=360013330335'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const TokenChartComponent = ({dataSources = [], onValueSelected}: Props) => {

const screenWidth = Dimensions.get('window').width
const x0 = 0 // x0 position
const chartWidth = screenWidth - x0
const chartWidth = screenWidth - x0 - 16 // 16 = padding
const xN = x0 + chartWidth // xN position
const xDistance = chartWidth / dataSize // The width of each coordinate point

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const useStrings = () => {
iUnderstandButton: intl.formatMessage(confirmationMessages.commonButtons.iUnderstandButton),
attention: intl.formatMessage(globalMessages.attention),
registrationStart: intl.formatMessage(messages.registrationStart),
snapshotStart: intl.formatMessage(messages.snapshotStart),
votingStart: intl.formatMessage(messages.votingStart),
votingEnd: intl.formatMessage(messages.votingEnd),
votingResults: intl.formatMessage(messages.votingResults),
Expand Down Expand Up @@ -71,6 +72,10 @@ const messages = defineMessages({
id: 'catalyst.registration.start',
defaultMessage: '!!!Registration start',
},
snapshotStart: {
id: 'catalyst.snapshot.start',
defaultMessage: '!!!Snapshot start',
},
votingStart: {
id: 'catalyst.voting.start',
defaultMessage: '!!!Voting start',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@ export const DownloadCatalystAppScreen = () => {
}, [openModal, stakingInfo?.status, strings.attention])

const fundName = fund.info.fundName
const registrationStart = `${formatDate(fund.info.snapshotStart)}: ${strings.registrationStart}`
const registrationStart = `${formatDate(fund.info.snapshotStart)}: ${strings.snapshotStart}`
const votingStart = `${formatDate(fund.info.votingStart)}: ${strings.votingStart}`
const votingEnd = `${formatDate(fund.info.votingEnd)}: ${strings.votingEnd}`
const votingResults = `${formatDate(fund.info.tallyingEnd)}: ${strings.votingResults}`

const disabled = wallet.isMainnet && fund.status.registration !== 'running'

return (
<SafeAreaView edges={['left', 'right', 'bottom']} style={styles.safeAreaView}>
<Stepper title={strings.title} currentStep={1} totalSteps={3} />
Expand Down Expand Up @@ -98,7 +96,7 @@ export const DownloadCatalystAppScreen = () => {
</ScrollView>

<Actions>
<Button onPress={onNext} title={strings.continueButton} disabled={disabled} />
<Button onPress={onNext} title={strings.continueButton} />
</Actions>
</SafeAreaView>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {SafeAreaView} from 'react-native-safe-area-context'

import {Icon} from '../../../../components/Icon'
import {Spacer} from '../../../../components/Spacer/Spacer'
import {isNightly} from '../../../../kernel/env'
import {isDev, isNightly} from '../../../../kernel/env'
import {useLanguage} from '../../../../kernel/i18n'
import {themeNames} from '../../../../kernel/i18n/global-messages'
import {defaultLanguage} from '../../../../kernel/i18n/languages'
Expand Down Expand Up @@ -205,16 +205,16 @@ const CrashReportsSwitch = ({crashReportEnabled}: {crashReportEnabled: boolean})
const onToggleCrashReports = () => {
setIsLocalEnabled((prevState) => {
if (prevState) {
enable()
} else {
disable()
} else {
enable()
}

return !prevState
})
}

return <SettingsSwitch value={isLocalEnabled} onValueChange={onToggleCrashReports} disabled={isNightly} />
return <SettingsSwitch value={isLocalEnabled} onValueChange={onToggleCrashReports} disabled={isNightly || isDev} />
}

// to avoid switch jumps
Expand Down
1 change: 1 addition & 0 deletions apps/wallet-mobile/src/kernel/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"api.error.tooManyRequests": "Too many requests, wait a bit and try again",
"api.error.unauthorized": "You are not authorized to access this resource",
"api.error.unknown": "An error that is unknown for the app happened, please try again",
"catalyst.snapshot.start": "Snapshot start",
"catalyst.registration.start": "Registration start",
"catalyst.voting.start": "Voting start",
"catalyst.voting.end": "Voting end",
Expand Down
7 changes: 3 additions & 4 deletions apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import {Utxos} from '../utils/utils'
const crashReportsStorageKey = 'sendCrashReports'

export const getCrashReportsEnabled = async (storage: AsyncStorageStatic = AsyncStorage) => {
if (isNightly || isDev) return true
const data = await storage.getItem(crashReportsStorageKey)
return parseBoolean(data) ?? false
}
Expand All @@ -46,11 +45,11 @@ const useCrashReportsEnabled = (storage: AsyncStorageStatic = AsyncStorage) => {
suspense: true,
queryKey: [crashReportsStorageKey],
queryFn: () => getCrashReportsEnabled(storage),
enabled: !isNightly && !isDev,
})

if (query.data == null) throw new Error('invalid state')

return query.data
if (isNightly || isDev) return true
return query.data ?? true
}

const useSetCrashReportsEnabled = (storage: AsyncStorageStatic = AsyncStorage) => {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2167,10 +2167,10 @@
"@ledgerhq/logs" "^5.15.0"
rxjs "^6.5.5"

"@emurgo/[email protected].1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@emurgo/yoroi-lib/-/yoroi-lib-2.2.1.tgz#144f182707fa6fa1a1fe19737110f465fdbfd40a"
integrity sha512-+83CcW9FVUsq+N9KhbhHMOzGou3v34gERWRe1sqWp0E+vQADhj7+hh7k+v8fjsTSyB7vJAwo8naI8S9azeWcKw==
"@emurgo/[email protected].2":
version "2.2.2"
resolved "https://registry.yarnpkg.com/@emurgo/yoroi-lib/-/yoroi-lib-2.2.2.tgz#e5575fedb123c36c78a08e28d60149fcb67cde0b"
integrity sha512-XhC+2+F9pa3mUorCKixL9WIFGUjkN/u/MH3tsMHaNKfRwnEaWkXMfQZmN/WAposEi5r5rnwb7I3vRTB94srZow==
dependencies:
"@cardano-foundation/ledgerjs-hw-app-cardano" "^7.1.3"
"@emurgo/cross-csl-core" "6.1.0"
Expand Down

0 comments on commit f1be897

Please sign in to comment.