From 263e4e33172340e2139ca84b9e331b20c8e74584 Mon Sep 17 00:00:00 2001 From: jorbuedo Date: Wed, 15 Jan 2025 11:32:55 +0100 Subject: [PATCH 1/7] fix(wallet-mobile): Remove swap info link from open order cancel modal (#3784) --- apps/wallet-mobile/android/build.gradle | 2 +- .../useCases/StartOrderSwapScreen/ListOrders/OpenOrders.tsx | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/wallet-mobile/android/build.gradle b/apps/wallet-mobile/android/build.gradle index 203b15e078..9b1f0500bf 100644 --- a/apps/wallet-mobile/android/build.gradle +++ b/apps/wallet-mobile/android/build.gradle @@ -24,7 +24,7 @@ buildscript { dependencies { classpath "com.android.tools.build:gradle:7.3.1" classpath "com.facebook.react:react-native-gradle-plugin" - classpath "org.mozilla.rust-android-gradle:plugin:0.9.3" + classpath "org.mozilla.rust-android-gradle:plugin:0.9.5" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlinVersion" classpath 'com.google.gms:google-services:4.3.15' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartOrderSwapScreen/ListOrders/OpenOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartOrderSwapScreen/ListOrders/OpenOrders.tsx index 6c4f796678..60280be429 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartOrderSwapScreen/ListOrders/OpenOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartOrderSwapScreen/ListOrders/OpenOrders.tsx @@ -43,7 +43,6 @@ import {LiquidityPool} from '../../../common/LiquidityPool/LiquidityPool' import {useNavigateTo} from '../../../common/navigation' import {PoolIcon} from '../../../common/PoolIcon/PoolIcon' import {useStrings} from '../../../common/strings' -import {SwapInfoLink} from '../../../common/SwapInfoLink/SwapInfoLink' import {getCancellationOrderFee} from './helpers' import {mapOpenOrders, MappedOpenOrder} from './mapOrders' @@ -586,10 +585,6 @@ const ModalContent = ({ - - - - From 46c8118ab476793ed6c5eff05daeb7da27b8165f Mon Sep 17 00:00:00 2001 From: banklesss <105349292+banklesss@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:36:21 +0100 Subject: [PATCH 2/7] fix(wallet-mobile): tx review uat overview tab (#3785) --- .../src/components/Info/Info.tsx | 2 +- .../features/ReviewTx/common/CopiableText.tsx | 5 ++- .../ReviewTx/Overview/OverviewTab.tsx | 37 +++++++++++++------ .../ReviewTxScreen/ReviewTx/ReviewTx.tsx | 6 +-- 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/apps/wallet-mobile/src/components/Info/Info.tsx b/apps/wallet-mobile/src/components/Info/Info.tsx index b4272cc14e..0cad9bef29 100644 --- a/apps/wallet-mobile/src/components/Info/Info.tsx +++ b/apps/wallet-mobile/src/components/Info/Info.tsx @@ -40,7 +40,7 @@ const useStyles = () => { const colors = { yellow: color.sys_orange_500, - blue: color.primary_500, + blue: color.el_primary_medium, } return {colors, styles} as const diff --git a/apps/wallet-mobile/src/features/ReviewTx/common/CopiableText.tsx b/apps/wallet-mobile/src/features/ReviewTx/common/CopiableText.tsx index 45dea2a1e6..e72a49e84a 100644 --- a/apps/wallet-mobile/src/features/ReviewTx/common/CopiableText.tsx +++ b/apps/wallet-mobile/src/features/ReviewTx/common/CopiableText.tsx @@ -4,6 +4,7 @@ import {StyleSheet, TouchableOpacity, View, ViewStyle} from 'react-native' import {useCopy} from '../../../components/Clipboard/ClipboardProvider' import {Icon} from '../../../components/Icon' +import {Space} from '../../../components/Space/Space' export const CopiableText = ({ children, @@ -20,6 +21,8 @@ export const CopiableText = ({ {children} + + ) @@ -30,7 +33,7 @@ export const CopyButton = ({textToCopy}: {textToCopy: string}) => { const {copy} = useCopy() return ( copy({text: textToCopy})} activeOpacity={0.5}> - + ) } diff --git a/apps/wallet-mobile/src/features/ReviewTx/useCases/ReviewTxScreen/ReviewTx/Overview/OverviewTab.tsx b/apps/wallet-mobile/src/features/ReviewTx/useCases/ReviewTxScreen/ReviewTx/Overview/OverviewTab.tsx index 1d42b47eb4..70f3279bf1 100644 --- a/apps/wallet-mobile/src/features/ReviewTx/useCases/ReviewTxScreen/ReviewTx/Overview/OverviewTab.tsx +++ b/apps/wallet-mobile/src/features/ReviewTx/useCases/ReviewTxScreen/ReviewTx/Overview/OverviewTab.tsx @@ -116,7 +116,7 @@ const WalletInfoSection = ({tx, createdBy}: {tx: FormattedTx; createdBy?: React. - + {`${plate} | ${meta.name}`} @@ -177,7 +177,13 @@ const MyWalletSection = ({ {address} - {ownedOutputs[0]?.addressKind === CredKind.Script && } + {ownedOutputs[0]?.addressKind === CredKind.Script && ( + <> + + + + + )} @@ -273,12 +279,7 @@ const OneExternalPartySection = ({ - - {output?.addressKind === CredKind.Script && receiverCustomTitle == null - ? strings.receiveToScriptLabel - : strings.receiveToLabel} - : - + {strings.receiveToLabel}: {receiverCustomTitle ?? ( @@ -290,7 +291,13 @@ const OneExternalPartySection = ({ {address} - {output?.addressKind === CredKind.Script && } + {output?.addressKind === CredKind.Script && ( + <> + + + + + )} )} @@ -320,7 +327,13 @@ const MultiExternalPartiesSection = ({outputs}: {outputs: FormattedOutputs}) => {address} - {output?.addressKind === CredKind.Script && } + {output?.addressKind === CredKind.Script && ( + <> + + + + + )} @@ -489,7 +502,7 @@ export const CreatedByInfoItem = ({logo, url}: {logo?: string; url: string}) => {logo != null && } - + Linking.openURL(url)}> {url.replace(/^https?:\/\//, '').replace(/\/+$/, '')} @@ -678,7 +691,7 @@ const useStyles = () => { }) const colors = { - send: color.primary_500, + send: color.el_primary_medium, received: color.green_static, icon: color.el_gray_medium, } diff --git a/apps/wallet-mobile/src/features/ReviewTx/useCases/ReviewTxScreen/ReviewTx/ReviewTx.tsx b/apps/wallet-mobile/src/features/ReviewTx/useCases/ReviewTxScreen/ReviewTx/ReviewTx.tsx index 00e58ebfab..8b9806c9b5 100644 --- a/apps/wallet-mobile/src/features/ReviewTx/useCases/ReviewTxScreen/ReviewTx/ReviewTx.tsx +++ b/apps/wallet-mobile/src/features/ReviewTx/useCases/ReviewTxScreen/ReviewTx/ReviewTx.tsx @@ -201,10 +201,10 @@ const useStyles = () => { }, indicator: { ...atoms.absolute, - bottom: 0, - height: 2, + bottom: -2, + height: 2.5, width: '100%', - backgroundColor: color.primary_500, + backgroundColor: color.el_primary_medium, }, }) From 2a60c9945be119a9449fdac1e965a764afd35dd9 Mon Sep 17 00:00:00 2001 From: jorbuedo Date: Wed, 15 Jan 2025 12:55:54 +0100 Subject: [PATCH 3/7] fix(wallet-mobile): Adjust staking icons dark background (#3787) --- .../src/components/Icon/TotalAda.tsx | 55 +++++++------- .../src/components/Icon/TotalDelegated.tsx | 73 ++++++++++--------- .../src/components/Icon/TotalReward.tsx | 57 ++++++++------- .../src/legacy/Dashboard/UserSummary.json | 16 ++-- 4 files changed, 108 insertions(+), 93 deletions(-) diff --git a/apps/wallet-mobile/src/components/Icon/TotalAda.tsx b/apps/wallet-mobile/src/components/Icon/TotalAda.tsx index a23c306fbb..f6cab180a1 100644 --- a/apps/wallet-mobile/src/components/Icon/TotalAda.tsx +++ b/apps/wallet-mobile/src/components/Icon/TotalAda.tsx @@ -1,38 +1,43 @@ +import {useTheme} from '@yoroi/theme' import React from 'react' import Svg, {Circle, G, Path} from 'react-native-svg' import {IconProps} from './type' -export const TotalAda = ({size = 44, color = 'black'}: IconProps) => ( - - - - - +export const TotalAda = ({size = 44, color = 'black'}: IconProps) => { + const {color: colors, isDark} = useTheme() - - - + return ( + + + + + - + + - + + + + + - - -) + + ) +} diff --git a/apps/wallet-mobile/src/components/Icon/TotalDelegated.tsx b/apps/wallet-mobile/src/components/Icon/TotalDelegated.tsx index 7bbf2c373d..7e0692e9ce 100644 --- a/apps/wallet-mobile/src/components/Icon/TotalDelegated.tsx +++ b/apps/wallet-mobile/src/components/Icon/TotalDelegated.tsx @@ -1,49 +1,54 @@ +import {useTheme} from '@yoroi/theme' import React from 'react' import Svg, {Circle, G, Path} from 'react-native-svg' import {IconProps} from './type' -export const TotalDelegated = ({size = 44, color = 'black'}: IconProps) => ( - - - - - - - - +export const TotalDelegated = ({size = 44, color = 'black'}: IconProps) => { + const {color: colors, isDark} = useTheme() - - + return ( + + + + + + - - - + + - - + + - - + + - + + + + + + + + - - -) + + ) +} diff --git a/apps/wallet-mobile/src/components/Icon/TotalReward.tsx b/apps/wallet-mobile/src/components/Icon/TotalReward.tsx index 7a80d8824f..5656ed8bd3 100644 --- a/apps/wallet-mobile/src/components/Icon/TotalReward.tsx +++ b/apps/wallet-mobile/src/components/Icon/TotalReward.tsx @@ -1,35 +1,40 @@ +import {useTheme} from '@yoroi/theme' import React from 'react' import Svg, {Circle, G, Path} from 'react-native-svg' import {IconProps} from './type' -export const TotalReward = ({size = 44, color = 'black'}: IconProps) => ( - - - - - +export const TotalReward = ({size = 44, color = 'black'}: IconProps) => { + const {color: colors, isDark} = useTheme() + + return ( + + + + + - - + + - + - + + - - -) + + ) +} diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/UserSummary.json b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/UserSummary.json index 05af0bc668..5b234789f8 100644 --- a/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/UserSummary.json +++ b/apps/wallet-mobile/translations/messages/src/legacy/Dashboard/UserSummary.json @@ -6,12 +6,12 @@ "start": { "line": 163, "column": 9, - "index": 4904 + "index": 4901 }, "end": { "line": 166, "column": 3, - "index": 5006 + "index": 5003 } }, { @@ -21,12 +21,12 @@ "start": { "line": 167, "column": 16, - "index": 5024 + "index": 5021 }, "end": { "line": 170, "column": 3, - "index": 5134 + "index": 5131 } }, { @@ -36,12 +36,12 @@ "start": { "line": 171, "column": 18, - "index": 5154 + "index": 5151 }, "end": { "line": 174, "column": 3, - "index": 5268 + "index": 5265 } }, { @@ -51,12 +51,12 @@ "start": { "line": 175, "column": 23, - "index": 5293 + "index": 5290 }, "end": { "line": 178, "column": 3, - "index": 5405 + "index": 5402 } } ] \ No newline at end of file From 574c6c9c432118486d59cab39f4eda39702804bc Mon Sep 17 00:00:00 2001 From: jorbuedo Date: Wed, 15 Jan 2025 12:56:14 +0100 Subject: [PATCH 4/7] fix(wallet-mobile): Add padding for swap pool actions (#3786) --- .../CreateOrder/EditPool/ShowPoolActions.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartOrderSwapScreen/CreateOrder/EditPool/ShowPoolActions.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartOrderSwapScreen/CreateOrder/EditPool/ShowPoolActions.tsx index 7c12b9f520..96edc8648a 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartOrderSwapScreen/CreateOrder/EditPool/ShowPoolActions.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartOrderSwapScreen/CreateOrder/EditPool/ShowPoolActions.tsx @@ -68,7 +68,7 @@ export const ShowPoolActions = () => { const feeBreakdown = return ( - + @@ -297,8 +297,11 @@ const useStyles = () => { ...atoms.flex_row, ...atoms.align_center, }, - between: { + header: { + ...atoms.flex_row, + ...atoms.align_center, ...atoms.justify_between, + ...atoms.pb_md, }, modalText: { ...atoms.text_left, From 662c2d03692d0d4c041d0be6d8bbf679299faf93 Mon Sep 17 00:00:00 2001 From: banklesss <105349292+banklesss@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:34:09 +0100 Subject: [PATCH 5/7] fix(wallet-mobile): tx review uat token details (#3789) --- .../src/features/ReviewTx/common/TokenDetails.tsx | 8 ++++---- .../src/features/ReviewTx/common/TokenItem.tsx | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/wallet-mobile/src/features/ReviewTx/common/TokenDetails.tsx b/apps/wallet-mobile/src/features/ReviewTx/common/TokenDetails.tsx index fa86831745..57d10d6a3d 100644 --- a/apps/wallet-mobile/src/features/ReviewTx/common/TokenDetails.tsx +++ b/apps/wallet-mobile/src/features/ReviewTx/common/TokenDetails.tsx @@ -140,7 +140,7 @@ const Overview = ({ if (info.type === 'ft') { return ( - + @@ -150,17 +150,17 @@ const Overview = ({ - + ) } return ( - + - + ) } diff --git a/apps/wallet-mobile/src/features/ReviewTx/common/TokenItem.tsx b/apps/wallet-mobile/src/features/ReviewTx/common/TokenItem.tsx index fabea93b81..54423fd055 100644 --- a/apps/wallet-mobile/src/features/ReviewTx/common/TokenItem.tsx +++ b/apps/wallet-mobile/src/features/ReviewTx/common/TokenItem.tsx @@ -1,7 +1,7 @@ import {useTheme} from '@yoroi/theme' import {Portfolio} from '@yoroi/types' import * as React from 'react' -import {StyleSheet, Text, TouchableOpacity, useWindowDimensions} from 'react-native' +import {ScrollView, StyleSheet, Text, TouchableOpacity, useWindowDimensions} from 'react-native' import {useModal} from '../../../components/Modal/ModalContext' import {useStrings} from './hooks/useStrings' @@ -24,7 +24,13 @@ export const TokenItem = ({ const {height: windowHeight} = useWindowDimensions() const handleShowTokenDetails = () => { - openModal(strings.tokenDetailsTitle, , windowHeight * 0.8) + openModal( + strings.tokenDetailsTitle, + + + , + windowHeight * 0.8, + ) } if (!isSent) From 117945716c90e150d58ecb8ae011b08641f0d7a2 Mon Sep 17 00:00:00 2001 From: jorbuedo Date: Wed, 15 Jan 2025 16:38:27 +0100 Subject: [PATCH 6/7] fix(wallet-mobile): Critical button color text (#3788) --- apps/wallet-mobile/src/components/Button/Button.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/wallet-mobile/src/components/Button/Button.tsx b/apps/wallet-mobile/src/components/Button/Button.tsx index 4846925a58..ee9719616d 100644 --- a/apps/wallet-mobile/src/components/Button/Button.tsx +++ b/apps/wallet-mobile/src/components/Button/Button.tsx @@ -96,7 +96,7 @@ const useStyles = ({ pressed: color.text_primary_max, disabled: color.text_primary_min, }, - [ButtonType.Critical]: {idle: color.white_static, pressed: color.white_static, disabled: color.white_static}, + [ButtonType.Critical]: {idle: color.gray_min, pressed: color.gray_min, disabled: color.gray_min}, [ButtonType.Text]: { idle: color.text_primary_medium, pressed: color.text_primary_max, From f4788dc61eccf3c31075ed0dd012ead27b282178 Mon Sep 17 00:00:00 2001 From: banklesss <105349292+banklesss@users.noreply.github.com> Date: Wed, 15 Jan 2025 16:39:14 +0100 Subject: [PATCH 7/7] fix(wallet-mobile): tx review uat utxos tab (#3790) --- .../ReviewTxScreen/ReviewTx/ReviewTx.tsx | 44 +++++++++++++++---- .../ReviewTx/UTxOs/UTxOsTab.tsx | 4 +- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/apps/wallet-mobile/src/features/ReviewTx/useCases/ReviewTxScreen/ReviewTx/ReviewTx.tsx b/apps/wallet-mobile/src/features/ReviewTx/useCases/ReviewTxScreen/ReviewTx/ReviewTx.tsx index 8b9806c9b5..dda6424a28 100644 --- a/apps/wallet-mobile/src/features/ReviewTx/useCases/ReviewTxScreen/ReviewTx/ReviewTx.tsx +++ b/apps/wallet-mobile/src/features/ReviewTx/useCases/ReviewTxScreen/ReviewTx/ReviewTx.tsx @@ -14,7 +14,7 @@ import { import {Button} from '../../../../../components/Button/Button' import {SafeArea} from '../../../../../components/SafeArea' -import {ScrollView} from '../../../../../components/ScrollView/ScrollView' +import {ScrollView, useScrollView} from '../../../../../components/ScrollView/ScrollView' import {isEmptyString} from '../../../../../kernel/utils' import {useStrings} from '../../../common/hooks/useStrings' import {FormattedMetadata, FormattedTx} from '../../../common/types' @@ -25,6 +25,7 @@ import {MintTab} from './Mint/MintTab' import {ReferenceInputsTab} from './ReferenceInputs/ReferenceInputs' const MaterialTab = createMaterialTopTabNavigator() +type Tabs = 'overview' | 'utxos' | 'metadata' | 'mint' | 'reference_inputs' export const ReviewTx = ({ formattedTx, @@ -46,10 +47,11 @@ export const ReviewTx = ({ const {styles} = useStyles() const strings = useStrings() - const tabsData = [ + const tabsData: Array<[string, Tabs]> = [ [strings.overviewTab, 'overview'], [strings.utxosTab, 'utxos'], ] + const [activeTab, setActiveTab] = React.useState(tabsData[0][1]) const showMetadataTab = !isEmptyString(formattedMetadata?.hash) && formattedMetadata?.metadata != null const showMintTab = !!formattedTx.mint @@ -59,12 +61,32 @@ export const ReviewTx = ({ if (showMintTab) tabsData.push([strings.mintTab, 'mint']) if (showReferenceInoutsTab) tabsData.push([strings.referenceInputsTab, 'reference_inputs']) + // intentionally not using ref + const {isScrollBarShown: isOverviewScrollBarShown, setIsScrollBarShown: setOverviewIsScrollBarShown} = useScrollView() + const {isScrollBarShown: isUtxosScrollBarShown, setIsScrollBarShown: setUtxosIsScrollBarShown} = useScrollView() + const {isScrollBarShown: isMetadataScrollBarShown, setIsScrollBarShown: setMetadataIsScrollBarShown} = useScrollView() + const {isScrollBarShown: isMintScrollBarShown, setIsScrollBarShown: setMintIsScrollBarShown} = useScrollView() + const {isScrollBarShown: isReferenceInputsScrollBarShown, setIsScrollBarShown: setReferenceInputsIsScrollBarShown} = + useScrollView() + + const scrollbarActive = + (isOverviewScrollBarShown && activeTab === 'overview') || + (isUtxosScrollBarShown && activeTab === 'utxos') || + (isMetadataScrollBarShown && activeTab === 'metadata') || + (isMintScrollBarShown && activeTab === 'mint') || + (isReferenceInputsScrollBarShown && activeTab === 'reference_inputs') + return ( - }> + { + setActiveTab(tabsData[props.state.index][1]) + return + }} + > {() => ( - + {() => ( - + )} @@ -87,7 +109,7 @@ export const ReviewTx = ({ {showMetadataTab && ( {() => ( - + )} @@ -97,7 +119,7 @@ export const ReviewTx = ({ {showMintTab && ( {() => ( - + )} @@ -107,7 +129,7 @@ export const ReviewTx = ({ {showReferenceInoutsTab && ( {() => ( - + )} @@ -115,7 +137,7 @@ export const ReviewTx = ({ )} - +