From 8f94dabc421ac8288edea7f4c9903718ac327d6f Mon Sep 17 00:00:00 2001 From: SorinC6 Date: Tue, 17 Oct 2023 14:17:27 +0300 Subject: [PATCH 1/9] swap/copy updates --- .../SelectPoolFromList/SelectPoolFromList.tsx | 12 +- .../Swap/common/SwapInfoLink/SwapInfoLink.tsx | 27 + .../src/features/Swap/common/strings.ts | 12 +- .../CreateOrder/EditPool/ShowPoolActions.tsx | 15 +- .../StartSwapScreen/ListOrders/OpenOrders.tsx | 24 +- .../wallet-mobile/src/i18n/locales/en-US.json | 5 +- .../src/features/Swap/common/strings.json | 819 +++++++++--------- 7 files changed, 477 insertions(+), 437 deletions(-) create mode 100644 apps/wallet-mobile/src/features/Swap/common/SwapInfoLink/SwapInfoLink.tsx diff --git a/apps/wallet-mobile/src/features/Swap/common/SelectPool/SelectPoolFromList/SelectPoolFromList.tsx b/apps/wallet-mobile/src/features/Swap/common/SelectPool/SelectPoolFromList/SelectPoolFromList.tsx index c08a9a9110..2d8799d597 100644 --- a/apps/wallet-mobile/src/features/Swap/common/SelectPool/SelectPoolFromList/SelectPoolFromList.tsx +++ b/apps/wallet-mobile/src/features/Swap/common/SelectPool/SelectPoolFromList/SelectPoolFromList.tsx @@ -99,9 +99,9 @@ export const SelectPoolFromList = ({pools = []}: Props) => { - {`${strings.tvl}, ${ticker}`} + {strings.tvl} - {formattedTvl} + {`${formattedTvl} ${ticker}`} @@ -109,9 +109,9 @@ export const SelectPoolFromList = ({pools = []}: Props) => { - {strings.poolFee}, % + {strings.poolFee} - {pool.fee}% + {`${formattedBatcherFeeInPt} ${ticker}`} @@ -119,9 +119,9 @@ export const SelectPoolFromList = ({pools = []}: Props) => { - {`${strings.batcherFee}, ${ticker}`} + {strings.swapLiquidityFee} - {formattedBatcherFeeInPt} + {pool.fee} % diff --git a/apps/wallet-mobile/src/features/Swap/common/SwapInfoLink/SwapInfoLink.tsx b/apps/wallet-mobile/src/features/Swap/common/SwapInfoLink/SwapInfoLink.tsx new file mode 100644 index 0000000000..899bf1b651 --- /dev/null +++ b/apps/wallet-mobile/src/features/Swap/common/SwapInfoLink/SwapInfoLink.tsx @@ -0,0 +1,27 @@ +import React from 'react' +import {Linking, StyleSheet, Text, TouchableOpacity} from 'react-native' + +import {useStrings} from '../strings' + +export const SwapInfoLink = () => { + const strings = useStrings() + return ( + // TODO: add real link + Linking.openURL('https://yoroi-wallet.com/#/')} style={styles.link}> + {strings.listOrdersSheetLink} + + ) +} + +const styles = StyleSheet.create({ + link: { + alignItems: 'center', + justifyContent: 'center', + }, + linkText: { + color: '#4B6DDE', + fontSize: 16, + textDecorationLine: 'underline', + lineHeight: 22, + }, +}) diff --git a/apps/wallet-mobile/src/features/Swap/common/strings.ts b/apps/wallet-mobile/src/features/Swap/common/strings.ts index d1a4be2a6a..1e739a9c86 100644 --- a/apps/wallet-mobile/src/features/Swap/common/strings.ts +++ b/apps/wallet-mobile/src/features/Swap/common/strings.ts @@ -34,7 +34,8 @@ export const useStrings = () => { swapMinReceived: intl.formatMessage(messages.swapMinReceived), swapMinReceivedTitle: intl.formatMessage(messages.swapMinReceivedTitle), swapFeesTitle: intl.formatMessage(messages.swapFeesTitle), - swapLiquidityFee: (fee: string) => intl.formatMessage(messages.swapLiquidityFee, {fee}), + swapLiquidityFee: intl.formatMessage(messages.swapLiquidityFee), + swapLiquidityFeeInfo: (fee: string) => intl.formatMessage(messages.swapLiquidityFeeInfo, {fee}), swapFees: intl.formatMessage(messages.swapFees), poolVerification: (pool: string) => intl.formatMessage(messages.poolVerification, {pool}), poolVerificationInfo: (pool: string) => intl.formatMessage(messages.poolVerificationInfo, {pool}), @@ -217,7 +218,7 @@ export const messages = defineMessages({ }, changePool: { id: 'swap.swapScreen.changePool', - defaultMessage: '!!!change pool', + defaultMessage: '!!!change dex', }, swapMinAda: { id: 'swap.swapScreen.swapMinAda', @@ -238,7 +239,12 @@ export const messages = defineMessages({ }, swapLiquidityFee: { id: 'swap.swapScreen.swapLiquidityFee', - defaultMessage: `!!!Liquidity provider fee ({fee}%)`, + defaultMessage: '!!!Liq. prov. fee', + }, + swapLiquidityFeeInfo: { + id: 'swap.swapScreen.swapLiquidityFeeInfo', + defaultMessage: + '!!!Liquidity provider fee is a fixed {fee}% operational fee from the whole transaction volume, that is taken to support DEX “liquidity” allowing traders to buy and sell assets on the decentralized Cardano network.', }, swapMinReceived: { id: 'swap.swapScreen.swapMinReceived', diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.tsx index ddc9f35c62..d7f9483185 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.tsx @@ -18,6 +18,7 @@ import {useNavigateTo} from '../../../../common/navigation' import {PoolIcon} from '../../../../common/PoolIcon/PoolIcon' import {useStrings} from '../../../../common/strings' import {useSwapTouched} from '../../../../common/SwapFormProvider' +import {SwapInfoLink} from '../../../../common/SwapInfoLink/SwapInfoLink' export const ShowPoolActions = () => { const navigateTo = useNavigateTo() @@ -155,8 +156,9 @@ const HiddenInfo = ({ info: strings.swapMinReceived, }, { - label: strings.swapLiquidityFee(liquidityFee), + label: strings.swapLiquidityFee, value: `${liquidityFeeValue} ${sellTokenName}`, + info: strings.swapLiquidityFeeInfo(liquidityFee), }, ].map((item) => ( - {bottomSheetState.content} + + {bottomSheetState.content} + + + ) @@ -197,6 +203,11 @@ const styles = StyleSheet.create({ fontWeight: '400', color: '#242838', }, + modalContent: { + flex: 1, + justifyContent: 'space-between', + paddingBottom: 24, + }, change: {color: COLORS.SHELLEY_BLUE, fontWeight: '600', textTransform: 'uppercase'}, bold: { color: COLORS.BLACK, diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx index 1d1fd95609..6637fd8803 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx @@ -38,6 +38,7 @@ import {Counter} from '../../../common/Counter/Counter' import {LiquidityPool} from '../../../common/LiquidityPool/LiquidityPool' 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' @@ -498,7 +499,7 @@ const ModalContent = ({ - + @@ -564,16 +565,6 @@ const ModalContentRow = ({label, value}: {label: string; value: string}) => { ) } -const ModalContentLink = () => { - const strings = useStrings() - return ( - // TODO: add real link - Linking.openURL('https://google.com')} style={styles.link}> - {strings.listOrdersSheetLink} - - ) -} - const ModalContentButtons = ({onBack, onConfirm}: {onBack: () => void; onConfirm: () => void}) => { const strings = useStrings() return ( @@ -643,17 +634,6 @@ const styles = StyleSheet.create({ flexDirection: 'row', alignItems: 'center', }, - link: { - alignItems: 'center', - justifyContent: 'center', - }, - linkText: { - color: '#4B6DDE', - fontFamily: 'Rubik-Medium', - fontSize: 16, - fontWeight: '500', - lineHeight: 22, - }, buttons: { flexDirection: 'row', justifyContent: 'space-between', diff --git a/apps/wallet-mobile/src/i18n/locales/en-US.json b/apps/wallet-mobile/src/i18n/locales/en-US.json index 31ceb8e4ad..b66c950319 100644 --- a/apps/wallet-mobile/src/i18n/locales/en-US.json +++ b/apps/wallet-mobile/src/i18n/locales/en-US.json @@ -158,12 +158,13 @@ "swap.swapScreen.defaultSlippage": "Default Slippage Tolerance", "swap.swapScreen.slippageInfo": "Slippage tolerance is set as a percentage of the total swap value. Your transactions will not be executed if the price moves by more than this amount.", "swap.swapScreen.autoPool": "(auto)", - "swap.swapScreen.changePool": "change pool", + "swap.swapScreen.changePool": "change dex", "swap.swapScreen.swapMinAda": "Min-ADA is the minimum ADA amount required to be contained when holding or sending Cardano native assets.", "swap.swapScreen.swapMinAdaTitle": "Min ADA", "swap.swapScreen.swapFees": "Swap fees include the following:\n • Matchmaker Fee\n • Frontend Fee", "swap.swapScreen.swapFeesTitle": "Fees", - "swap.swapScreen.swapLiquidityFee": "Liquidity provider fee ({fee}%)", + "swap.swapScreen.swapLiquidityFee": "Liq. prov. fee", + "swap.swapScreen.swapLiquidityFeeInfo": "Liquidity provider fee is a fixed {fee}% operational fee from the whole transaction volume, that is taken to support DEX “liquidity” allowing traders to buy and sell assets on the decentralized Cardano network.", "swap.swapScreen.swapMinReceived": "Minimum amount of assets you can get because of the slippage tolerance.", "swap.swapScreen.swapMinReceivedTitle": "Min Received", "swap.swapScreen.enterSlippage": "Enter a value from 0% to 100%. You can also enter up to 1 decimal", diff --git a/apps/wallet-mobile/translations/messages/src/features/Swap/common/strings.json b/apps/wallet-mobile/translations/messages/src/features/Swap/common/strings.json index 6a2eb41305..1209765266 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Swap/common/strings.json +++ b/apps/wallet-mobile/translations/messages/src/features/Swap/common/strings.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!Incorrect password.", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 134, + "line": 135, "column": 24, - "index": 8580 + "index": 8657 }, "end": { - "line": 137, + "line": 138, "column": 3, - "index": 8689 + "index": 8766 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!Swap", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 138, + "line": 139, "column": 13, - "index": 8704 + "index": 8781 }, "end": { - "line": 141, + "line": 142, "column": 3, - "index": 8777 + "index": 8854 } }, { @@ -34,14 +34,14 @@ "defaultMessage": "!!!Token swap", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 142, + "line": 143, "column": 13, - "index": 8792 + "index": 8869 }, "end": { - "line": 145, + "line": 146, "column": 3, - "index": 8874 + "index": 8951 } }, { @@ -49,14 +49,14 @@ "defaultMessage": "!!!Orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 146, + "line": 147, "column": 13, - "index": 8889 + "index": 8966 }, "end": { - "line": 149, + "line": 150, "column": 3, - "index": 8968 + "index": 9045 } }, { @@ -64,14 +64,14 @@ "defaultMessage": "!!!Market Button", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 150, + "line": 151, "column": 16, - "index": 8986 + "index": 9063 }, "end": { - "line": 153, + "line": 154, "column": 3, - "index": 9071 + "index": 9148 } }, { @@ -79,14 +79,14 @@ "defaultMessage": "!!!Limit", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 154, + "line": 155, "column": 15, - "index": 9088 + "index": 9165 }, "end": { - "line": 157, + "line": 158, "column": 3, - "index": 9164 + "index": 9241 } }, { @@ -94,14 +94,14 @@ "defaultMessage": "!!!Swap from", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 158, + "line": 159, "column": 12, - "index": 9178 + "index": 9255 }, "end": { - "line": 161, + "line": 162, "column": 3, - "index": 9255 + "index": 9332 } }, { @@ -109,14 +109,14 @@ "defaultMessage": "!!!Swap to", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 162, + "line": 163, "column": 10, - "index": 9267 + "index": 9344 }, "end": { - "line": 165, + "line": 166, "column": 3, - "index": 9340 + "index": 9417 } }, { @@ -124,14 +124,14 @@ "defaultMessage": "!!!Current Balance", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 166, + "line": 167, "column": 18, - "index": 9360 + "index": 9437 }, "end": { - "line": 169, + "line": 170, "column": 3, - "index": 9449 + "index": 9526 } }, { @@ -139,14 +139,14 @@ "defaultMessage": "!!!Balance", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 170, + "line": 171, "column": 11, - "index": 9462 + "index": 9539 }, "end": { - "line": 173, + "line": 174, "column": 3, - "index": 9536 + "index": 9613 } }, { @@ -154,14 +154,14 @@ "defaultMessage": "!!!Select Token", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 174, + "line": 175, "column": 15, - "index": 9553 + "index": 9630 }, "end": { - "line": 177, + "line": 178, "column": 3, - "index": 9636 + "index": 9713 } }, { @@ -169,14 +169,14 @@ "defaultMessage": "!!!Market Price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 178, + "line": 179, "column": 15, - "index": 9653 + "index": 9730 }, "end": { - "line": 181, + "line": 182, "column": 3, - "index": 9736 + "index": 9813 } }, { @@ -184,14 +184,14 @@ "defaultMessage": "!!!Limit Price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 182, + "line": 183, "column": 14, - "index": 9752 + "index": 9829 }, "end": { - "line": 185, + "line": 186, "column": 3, - "index": 9833 + "index": 9910 } }, { @@ -199,14 +199,14 @@ "defaultMessage": "!!!Slippage Tolerance", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 186, + "line": 187, "column": 21, - "index": 9856 + "index": 9933 }, "end": { - "line": 189, + "line": 190, "column": 3, - "index": 9951 + "index": 10028 } }, { @@ -214,14 +214,14 @@ "defaultMessage": "!!!Slippage must be a number between 0 and 100 and have up to 1 decimal", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 190, + "line": 191, "column": 26, - "index": 9979 + "index": 10056 }, "end": { - "line": 193, + "line": 194, "column": 3, - "index": 10129 + "index": 10206 } }, { @@ -229,14 +229,14 @@ "defaultMessage": "!!!Slippage Tolerance Info", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 194, + "line": 195, "column": 25, - "index": 10156 + "index": 10233 }, "end": { - "line": 197, + "line": 198, "column": 3, - "index": 10260 + "index": 10337 } }, { @@ -244,14 +244,14 @@ "defaultMessage": "!!!Verified by {pool}", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 198, + "line": 199, "column": 14, - "index": 10276 + "index": 10353 }, "end": { - "line": 201, + "line": 202, "column": 3, - "index": 10364 + "index": 10441 } }, { @@ -259,14 +259,14 @@ "defaultMessage": "!!!This asset is in my portfolio", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 202, + "line": 203, "column": 12, - "index": 10378 + "index": 10455 }, "end": { - "line": 205, + "line": 206, "column": 3, - "index": 10475 + "index": 10552 } }, { @@ -274,14 +274,14 @@ "defaultMessage": "!!!Default Slippage Tolerance", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 206, + "line": 207, "column": 19, - "index": 10496 + "index": 10573 }, "end": { - "line": 209, + "line": 210, "column": 3, - "index": 10597 + "index": 10674 } }, { @@ -289,14 +289,14 @@ "defaultMessage": "!!!Slippage tolerance is set as a percentage of the total swap value.", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 210, + "line": 211, "column": 16, - "index": 10615 + "index": 10692 }, "end": { - "line": 213, + "line": 214, "column": 3, - "index": 10753 + "index": 10830 } }, { @@ -304,29 +304,29 @@ "defaultMessage": "!!!(auto)", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 214, + "line": 215, "column": 12, - "index": 10767 + "index": 10844 }, "end": { - "line": 217, + "line": 218, "column": 3, - "index": 10841 + "index": 10918 } }, { "id": "swap.swapScreen.changePool", - "defaultMessage": "!!!change pool", + "defaultMessage": "!!!change dex", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 218, + "line": 219, "column": 14, - "index": 10857 + "index": 10934 }, "end": { - "line": 221, + "line": 222, "column": 3, - "index": 10938 + "index": 11014 } }, { @@ -334,14 +334,14 @@ "defaultMessage": "!!!Min-ADA is the minimum ADA amount required to be contained when holding or sending Cardano native assets.", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 222, + "line": 223, "column": 14, - "index": 10954 + "index": 11030 }, "end": { - "line": 226, + "line": 227, "column": 3, - "index": 11135 + "index": 11211 } }, { @@ -349,14 +349,14 @@ "defaultMessage": "!!!Min ADA", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 227, + "line": 228, "column": 19, - "index": 11156 + "index": 11232 }, "end": { - "line": 230, + "line": 231, "column": 3, - "index": 11238 + "index": 11314 } }, { @@ -364,14 +364,14 @@ "defaultMessage": "!!!Swap fees include the following:\n • Matchmaker Fee\n • Frontend Fee\n • Liquidity Provider Fee", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 231, + "line": 232, "column": 12, - "index": 11252 + "index": 11328 }, "end": { - "line": 234, + "line": 235, "column": 3, - "index": 11415 + "index": 11491 } }, { @@ -379,29 +379,44 @@ "defaultMessage": "!!!Fees", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 235, + "line": 236, "column": 17, - "index": 11434 + "index": 11510 }, "end": { - "line": 238, + "line": 239, "column": 3, - "index": 11511 + "index": 11587 } }, { "id": "swap.swapScreen.swapLiquidityFee", - "defaultMessage": "!!!Liquidity provider fee ({fee}%)", + "defaultMessage": "!!!Liq. prov. fee", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 239, + "line": 240, "column": 20, - "index": 11533 + "index": 11609 + }, + "end": { + "line": 243, + "column": 3, + "index": 11699 + } + }, + { + "id": "swap.swapScreen.swapLiquidityFeeInfo", + "defaultMessage": "!!!Liquidity provider fee is a fixed {fee}% operational fee from the whole transaction volume, that is taken to support DEX “liquidity” allowing traders to buy and sell assets on the decentralized Cardano network.", + "file": "src/features/Swap/common/strings.ts", + "start": { + "line": 244, + "column": 24, + "index": 11725 }, "end": { - "line": 242, + "line": 248, "column": 3, - "index": 11640 + "index": 12021 } }, { @@ -409,14 +424,14 @@ "defaultMessage": "!!!Minimum amount of assets you can get because of the slippage tolerance.", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 243, + "line": 249, "column": 19, - "index": 11661 + "index": 12042 }, "end": { - "line": 246, + "line": 252, "column": 3, - "index": 11807 + "index": 12188 } }, { @@ -424,14 +439,14 @@ "defaultMessage": "!!!Min Received", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 247, + "line": 253, "column": 24, - "index": 11833 + "index": 12214 }, "end": { - "line": 250, + "line": 256, "column": 3, - "index": 11925 + "index": 12306 } }, { @@ -439,14 +454,14 @@ "defaultMessage": "!!!Enter a value from 0% to 100%. You can also enter up to 1 decimal", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 251, + "line": 257, "column": 17, - "index": 11944 + "index": 12325 }, "end": { - "line": 254, + "line": 260, "column": 3, - "index": 12082 + "index": 12463 } }, { @@ -454,14 +469,14 @@ "defaultMessage": "!!!{pool} verification", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 255, + "line": 261, "column": 20, - "index": 12104 + "index": 12485 }, "end": { - "line": 258, + "line": 264, "column": 3, - "index": 12199 + "index": 12580 } }, { @@ -469,14 +484,14 @@ "defaultMessage": "!!!Volume, 24h", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 259, + "line": 265, "column": 10, - "index": 12211 + "index": 12592 }, "end": { - "line": 262, + "line": 268, "column": 3, - "index": 12288 + "index": 12669 } }, { @@ -484,14 +499,14 @@ "defaultMessage": "!!!Cardano projects that list their own tokens can apply for an additional {pool} verification. This verification is a manual validation that {pool} team performs with the help of Cardano Foundation.", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 263, + "line": 269, "column": 24, - "index": 12314 + "index": 12695 }, "end": { - "line": 267, + "line": 273, "column": 3, - "index": 12596 + "index": 12977 } }, { @@ -499,14 +514,14 @@ "defaultMessage": "!!! Price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 268, + "line": 274, "column": 9, - "index": 12607 + "index": 12988 }, "end": { - "line": 271, + "line": 277, "column": 3, - "index": 12669 + "index": 13050 } }, { @@ -514,14 +529,14 @@ "defaultMessage": "!!!No assets found for this pair", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 272, + "line": 278, "column": 17, - "index": 12688 + "index": 13069 }, "end": { - "line": 275, + "line": 281, "column": 3, - "index": 12790 + "index": 13171 } }, { @@ -529,14 +544,14 @@ "defaultMessage": "!!!No assets found for \"{search}\"", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 276, + "line": 282, "column": 20, - "index": 12812 + "index": 13193 }, "end": { - "line": 279, + "line": 285, "column": 3, - "index": 12918 + "index": 13299 } }, { @@ -544,14 +559,14 @@ "defaultMessage": "!!!Each verified tokens gets", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 280, + "line": 286, "column": 21, - "index": 12941 + "index": 13322 }, "end": { - "line": 283, + "line": 289, "column": 3, - "index": 13043 + "index": 13424 } }, { @@ -559,14 +574,14 @@ "defaultMessage": "!!!verified badge", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 284, + "line": 290, "column": 17, - "index": 13062 + "index": 13443 }, "end": { - "line": 287, + "line": 293, "column": 3, - "index": 13149 + "index": 13530 } }, { @@ -574,14 +589,14 @@ "defaultMessage": "!!!Open orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 288, + "line": 294, "column": 14, - "index": 13165 + "index": 13546 }, "end": { - "line": 291, + "line": 297, "column": 3, - "index": 13246 + "index": 13627 } }, { @@ -589,14 +604,14 @@ "defaultMessage": "!!!Completed orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 292, + "line": 298, "column": 19, - "index": 13267 + "index": 13648 }, "end": { - "line": 295, + "line": 301, "column": 3, - "index": 13358 + "index": 13739 } }, { @@ -604,14 +619,14 @@ "defaultMessage": "!!!TVL", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 296, + "line": 302, "column": 7, - "index": 13367 + "index": 13748 }, "end": { - "line": 299, + "line": 305, "column": 3, - "index": 13433 + "index": 13814 } }, { @@ -619,14 +634,14 @@ "defaultMessage": "!!! Dex Fee", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 300, + "line": 306, "column": 11, - "index": 13446 + "index": 13827 }, "end": { - "line": 303, + "line": 309, "column": 3, - "index": 13521 + "index": 13902 } }, { @@ -634,14 +649,14 @@ "defaultMessage": "!!! Batcher Fee", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 304, + "line": 310, "column": 14, - "index": 13537 + "index": 13918 }, "end": { - "line": 307, + "line": 313, "column": 3, - "index": 13619 + "index": 14000 } }, { @@ -649,14 +664,14 @@ "defaultMessage": "!!!Limit price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 308, + "line": 314, "column": 26, - "index": 13647 + "index": 14028 }, "end": { - "line": 311, + "line": 317, "column": 3, - "index": 13740 + "index": 14121 } }, { @@ -664,14 +679,14 @@ "defaultMessage": "!!!Are you sure you want to proceed this order with the limit price that is 10% or more higher than the\nmarket price?", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 312, + "line": 318, "column": 32, - "index": 13774 + "index": 14155 }, "end": { - "line": 317, + "line": 323, "column": 3, - "index": 13994 + "index": 14375 } }, { @@ -679,14 +694,14 @@ "defaultMessage": "!!!Your limit price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 318, + "line": 324, "column": 30, - "index": 14026 + "index": 14407 }, "end": { - "line": 321, + "line": 327, "column": 3, - "index": 14128 + "index": 14509 } }, { @@ -694,14 +709,14 @@ "defaultMessage": "!!!Market price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 322, + "line": 328, "column": 32, - "index": 14162 + "index": 14543 }, "end": { - "line": 325, + "line": 331, "column": 3, - "index": 14262 + "index": 14643 } }, { @@ -709,14 +724,14 @@ "defaultMessage": "!!!Back", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 326, + "line": 332, "column": 25, - "index": 14289 + "index": 14670 }, "end": { - "line": 329, + "line": 335, "column": 3, - "index": 14374 + "index": 14755 } }, { @@ -724,14 +739,14 @@ "defaultMessage": "!!!Swap", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 330, + "line": 336, "column": 28, - "index": 14404 + "index": 14785 }, "end": { - "line": 333, + "line": 339, "column": 3, - "index": 14492 + "index": 14873 } }, { @@ -739,14 +754,14 @@ "defaultMessage": "!!!Transaction submitted", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 334, + "line": 340, "column": 21, - "index": 14515 + "index": 14896 }, "end": { - "line": 337, + "line": 343, "column": 3, - "index": 14613 + "index": 14994 } }, { @@ -754,14 +769,14 @@ "defaultMessage": "!!!Your transactions will be displayed both in the list of transaction and Open swap orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 338, + "line": 344, "column": 22, - "index": 14637 + "index": 15018 }, "end": { - "line": 341, + "line": 347, "column": 3, - "index": 14803 + "index": 15184 } }, { @@ -769,14 +784,14 @@ "defaultMessage": "!!! dex", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 342, + "line": 348, "column": 7, - "index": 14812 + "index": 15193 }, "end": { - "line": 345, + "line": 351, "column": 3, - "index": 14879 + "index": 15260 } }, { @@ -784,14 +799,14 @@ "defaultMessage": "!!!see on explorer", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 346, + "line": 352, "column": 17, - "index": 14898 + "index": 15279 }, "end": { - "line": 349, + "line": 355, "column": 3, - "index": 14986 + "index": 15367 } }, { @@ -799,14 +814,14 @@ "defaultMessage": "!!!GO to Orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 350, + "line": 356, "column": 14, - "index": 15002 + "index": 15383 }, "end": { - "line": 353, + "line": 359, "column": 3, - "index": 15084 + "index": 15465 } }, { @@ -814,14 +829,14 @@ "defaultMessage": "!!!Asset", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 354, + "line": 360, "column": 9, - "index": 15095 + "index": 15476 }, "end": { - "line": 357, + "line": 363, "column": 3, - "index": 15168 + "index": 15549 } }, { @@ -829,14 +844,14 @@ "defaultMessage": "!!!Clear", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 358, + "line": 364, "column": 9, - "index": 15179 + "index": 15560 }, "end": { - "line": 361, + "line": 367, "column": 3, - "index": 15240 + "index": 15621 } }, { @@ -844,14 +859,14 @@ "defaultMessage": "!!!Sign transaction", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 362, + "line": 368, "column": 19, - "index": 15261 + "index": 15642 }, "end": { - "line": 365, + "line": 371, "column": 3, - "index": 15343 + "index": 15724 } }, { @@ -859,14 +874,14 @@ "defaultMessage": "!!!Spending Password", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 366, + "line": 372, "column": 20, - "index": 15365 + "index": 15746 }, "end": { - "line": 369, + "line": 375, "column": 3, - "index": 15449 + "index": 15830 } }, { @@ -874,14 +889,14 @@ "defaultMessage": "!!!Enter spending password to sign this transaction", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 370, + "line": 376, "column": 25, - "index": 15476 + "index": 15857 }, "end": { - "line": 373, + "line": 379, "column": 3, - "index": 15596 + "index": 15977 } }, { @@ -889,14 +904,14 @@ "defaultMessage": "!!!Sign", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 374, + "line": 380, "column": 8, - "index": 15606 + "index": 15987 }, "end": { - "line": 377, + "line": 383, "column": 3, - "index": 15665 + "index": 16046 } }, { @@ -904,14 +919,14 @@ "defaultMessage": "!!!Swap", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 378, + "line": 384, "column": 14, - "index": 15681 + "index": 16062 }, "end": { - "line": 381, + "line": 387, "column": 3, - "index": 15740 + "index": 16121 } }, { @@ -919,14 +934,14 @@ "defaultMessage": "!!!completed orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 382, + "line": 388, "column": 23, - "index": 15765 + "index": 16146 }, "end": { - "line": 385, + "line": 391, "column": 3, - "index": 15850 + "index": 16231 } }, { @@ -934,14 +949,14 @@ "defaultMessage": "!!!open orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 386, + "line": 392, "column": 18, - "index": 15870 + "index": 16251 }, "end": { - "line": 389, + "line": 395, "column": 3, - "index": 15945 + "index": 16326 } }, { @@ -949,14 +964,14 @@ "defaultMessage": "!!!Confirm order cancelation", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 390, + "line": 396, "column": 24, - "index": 15971 + "index": 16352 }, "end": { - "line": 393, + "line": 399, "column": 3, - "index": 16067 + "index": 16448 } }, { @@ -964,14 +979,14 @@ "defaultMessage": "!!!Cancel order", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 394, + "line": 400, "column": 29, - "index": 16098 + "index": 16479 }, "end": { - "line": 397, + "line": 403, "column": 3, - "index": 16185 + "index": 16566 } }, { @@ -979,14 +994,14 @@ "defaultMessage": "!!!Are you sure you want to cancel this order?", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 398, + "line": 404, "column": 31, - "index": 16218 + "index": 16599 }, "end": { - "line": 401, + "line": 407, "column": 3, - "index": 16339 + "index": 16720 } }, { @@ -994,14 +1009,14 @@ "defaultMessage": "!!!Learn more about swap orders in Yoroi", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 402, + "line": 408, "column": 23, - "index": 16364 + "index": 16745 }, "end": { - "line": 405, + "line": 411, "column": 3, - "index": 16471 + "index": 16852 } }, { @@ -1009,14 +1024,14 @@ "defaultMessage": "!!!Asset price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 406, + "line": 412, "column": 29, - "index": 16502 + "index": 16883 }, "end": { - "line": 409, + "line": 415, "column": 3, - "index": 16589 + "index": 16970 } }, { @@ -1024,14 +1039,14 @@ "defaultMessage": "!!!Asset amount", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 410, + "line": 416, "column": 30, - "index": 16621 + "index": 17002 }, "end": { - "line": 413, + "line": 419, "column": 3, - "index": 16710 + "index": 17091 } }, { @@ -1039,14 +1054,14 @@ "defaultMessage": "!!!Total returned", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 414, + "line": 420, "column": 32, - "index": 16744 + "index": 17125 }, "end": { - "line": 417, + "line": 423, "column": 3, - "index": 16837 + "index": 17218 } }, { @@ -1054,14 +1069,14 @@ "defaultMessage": "!!!Cancellation Fee", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 418, + "line": 424, "column": 34, - "index": 16873 + "index": 17254 }, "end": { - "line": 421, + "line": 427, "column": 3, - "index": 16970 + "index": 17351 } }, { @@ -1069,14 +1084,14 @@ "defaultMessage": "!!!Confirm", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 422, + "line": 428, "column": 26, - "index": 16998 + "index": 17379 }, "end": { - "line": 425, + "line": 431, "column": 3, - "index": 17078 + "index": 17459 } }, { @@ -1084,14 +1099,14 @@ "defaultMessage": "!!!Back", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 426, + "line": 432, "column": 23, - "index": 17103 + "index": 17484 }, "end": { - "line": 429, + "line": 435, "column": 3, - "index": 17177 + "index": 17558 } }, { @@ -1099,14 +1114,14 @@ "defaultMessage": "!!!Total", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 430, + "line": 436, "column": 19, - "index": 17198 + "index": 17579 }, "end": { - "line": 433, + "line": 439, "column": 3, - "index": 17268 + "index": 17649 } }, { @@ -1114,14 +1129,14 @@ "defaultMessage": "!!!Liquidity Pool", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 434, + "line": 440, "column": 27, - "index": 17297 + "index": 17678 }, "end": { - "line": 437, + "line": 443, "column": 3, - "index": 17384 + "index": 17765 } }, { @@ -1129,14 +1144,14 @@ "defaultMessage": "!!!Time Created", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 438, + "line": 444, "column": 25, - "index": 17411 + "index": 17792 }, "end": { - "line": 441, + "line": 447, "column": 3, - "index": 17494 + "index": 17875 } }, { @@ -1144,14 +1159,14 @@ "defaultMessage": "!!!Transaction ID", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 442, + "line": 448, "column": 18, - "index": 17514 + "index": 17895 }, "end": { - "line": 445, + "line": 451, "column": 3, - "index": 17592 + "index": 17973 } }, { @@ -1159,14 +1174,14 @@ "defaultMessage": "!!!Choose Connection Method", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 446, + "line": 452, "column": 26, - "index": 17620 + "index": 18001 }, "end": { - "line": 449, + "line": 455, "column": 3, - "index": 17738 + "index": 18119 } }, { @@ -1174,14 +1189,14 @@ "defaultMessage": "!!!Choose this option if you want to connect to a Ledger Nano model X or S using an on-the-go USB cable adaptor:", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 450, + "line": 456, "column": 18, - "index": 17758 + "index": 18139 }, "end": { - "line": 455, + "line": 461, "column": 3, - "index": 17987 + "index": 18368 } }, { @@ -1189,14 +1204,14 @@ "defaultMessage": "!!!Connect with USB", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 456, + "line": 462, "column": 13, - "index": 18002 + "index": 18383 }, "end": { - "line": 459, + "line": 465, "column": 3, - "index": 18116 + "index": 18497 } }, { @@ -1204,14 +1219,14 @@ "defaultMessage": "!!! USB connection is blocked by iOS devices", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 460, + "line": 466, "column": 26, - "index": 18144 + "index": 18525 }, "end": { - "line": 463, + "line": 469, "column": 3, - "index": 18296 + "index": 18677 } }, { @@ -1219,14 +1234,14 @@ "defaultMessage": "!!!Choose this option if you want to connect to a Ledger Nano model X through Bluetooth:", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 464, + "line": 470, "column": 24, - "index": 18322 + "index": 18703 }, "end": { - "line": 467, + "line": 473, "column": 3, - "index": 18516 + "index": 18897 } }, { @@ -1234,14 +1249,14 @@ "defaultMessage": "!!!Connect with Bluetooth", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 468, + "line": 474, "column": 19, - "index": 18537 + "index": 18918 }, "end": { - "line": 471, + "line": 477, "column": 3, - "index": 18663 + "index": 19044 } }, { @@ -1249,14 +1264,14 @@ "defaultMessage": "!!!Connect with Bluetooth", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 472, + "line": 478, "column": 18, - "index": 18683 + "index": 19064 }, "end": { - "line": 475, + "line": 481, "column": 3, - "index": 18793 + "index": 19174 } }, { @@ -1264,14 +1279,14 @@ "defaultMessage": "!!!You have", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 478, + "line": 484, "column": 11, - "index": 18852 + "index": 19233 }, "end": { - "line": 481, + "line": 487, "column": 3, - "index": 18947 + "index": 19328 } }, { @@ -1279,14 +1294,14 @@ "defaultMessage": "!!!No assets found", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 482, + "line": 488, "column": 12, - "index": 18961 + "index": 19342 }, "end": { - "line": 485, + "line": 491, "column": 3, - "index": 19064 + "index": 19445 } }, { @@ -1294,14 +1309,14 @@ "defaultMessage": "!!!found", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 486, + "line": 492, "column": 9, - "index": 19075 + "index": 19456 }, "end": { - "line": 489, + "line": 495, "column": 3, - "index": 19165 + "index": 19546 } }, { @@ -1309,14 +1324,14 @@ "defaultMessage": "!!!Search tokens", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 490, + "line": 496, "column": 16, - "index": 19183 + "index": 19564 }, "end": { - "line": 493, + "line": 499, "column": 3, - "index": 19279 + "index": 19660 } }, { @@ -1324,14 +1339,14 @@ "defaultMessage": "!!!Select asset", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 494, + "line": 500, "column": 20, - "index": 19301 + "index": 19682 }, "end": { - "line": 497, + "line": 503, "column": 3, - "index": 19390 + "index": 19771 } }, { @@ -1339,14 +1354,14 @@ "defaultMessage": "!!!Confirm", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 498, + "line": 504, "column": 11, - "index": 19403 + "index": 19784 }, "end": { - "line": 501, + "line": 507, "column": 3, - "index": 19497 + "index": 19878 } }, { @@ -1354,14 +1369,14 @@ "defaultMessage": "!!!Assign collateral", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 502, + "line": 508, "column": 20, - "index": 19519 + "index": 19900 }, "end": { - "line": 505, + "line": 511, "column": 3, - "index": 19626 + "index": 20007 } }, { @@ -1369,14 +1384,14 @@ "defaultMessage": "!!!Collateral not found", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 506, + "line": 512, "column": 22, - "index": 19650 + "index": 20031 }, "end": { - "line": 509, + "line": 515, "column": 3, - "index": 19762 + "index": 20143 } }, { @@ -1384,14 +1399,14 @@ "defaultMessage": "!!!You don't have an active collateral utxo", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 510, + "line": 516, "column": 22, - "index": 19786 + "index": 20167 }, "end": { - "line": 513, + "line": 519, "column": 3, - "index": 19918 + "index": 20299 } }, { @@ -1399,14 +1414,14 @@ "defaultMessage": "!!!Transaction failed", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 514, + "line": 520, "column": 17, - "index": 19937 + "index": 20318 }, "end": { - "line": 517, + "line": 523, "column": 3, - "index": 20039 + "index": 20420 } }, { @@ -1414,14 +1429,14 @@ "defaultMessage": "!!!Your transaction has not been processed properly due to technical issues", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 518, + "line": 524, "column": 16, - "index": 20057 + "index": 20438 }, "end": { - "line": 521, + "line": 527, "column": 3, - "index": 20212 + "index": 20593 } }, { @@ -1429,14 +1444,14 @@ "defaultMessage": "!!!Try again", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 522, + "line": 528, "column": 18, - "index": 20232 + "index": 20613 }, "end": { - "line": 525, + "line": 531, "column": 3, - "index": 20326 + "index": 20707 } }, { @@ -1444,14 +1459,14 @@ "defaultMessage": "!!!Not enough balance", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 526, + "line": 532, "column": 20, - "index": 20348 + "index": 20729 }, "end": { - "line": 529, + "line": 535, "column": 3, - "index": 20442 + "index": 20823 } }, { @@ -1459,14 +1474,14 @@ "defaultMessage": "!!!Not enough supply in the pool", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 530, + "line": 536, "column": 19, - "index": 20463 + "index": 20844 }, "end": { - "line": 533, + "line": 539, "column": 3, - "index": 20567 + "index": 20948 } }, { @@ -1474,14 +1489,14 @@ "defaultMessage": "!!! This pair is not available in any liquidity pool", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 534, + "line": 540, "column": 10, - "index": 20579 + "index": 20960 }, "end": { - "line": 537, + "line": 543, "column": 3, - "index": 20694 + "index": 21075 } }, { @@ -1489,14 +1504,14 @@ "defaultMessage": "!!!Continue on Ledger", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 538, + "line": 544, "column": 20, - "index": 20716 + "index": 21097 }, "end": { - "line": 541, + "line": 547, "column": 3, - "index": 20816 + "index": 21197 } } ] \ No newline at end of file From 422f2b392d3a1d0fb60b89e9c459fee611cd91bd Mon Sep 17 00:00:00 2001 From: SorinC6 Date: Tue, 17 Oct 2023 16:54:53 +0300 Subject: [PATCH 2/9] fix copy, move time created in main info --- .../src/features/Swap/common/strings.ts | 10 + .../CreateOrder/EditPool/ShowPoolActions.tsx | 5 +- .../ListOrders/CompletedOrders.tsx | 2 +- .../StartSwapScreen/ListOrders/OpenOrders.tsx | 17 +- .../wallet-mobile/src/i18n/locales/en-US.json | 8 +- .../src/features/Swap/common/strings.json | 840 +++++++++--------- 6 files changed, 462 insertions(+), 420 deletions(-) diff --git a/apps/wallet-mobile/src/features/Swap/common/strings.ts b/apps/wallet-mobile/src/features/Swap/common/strings.ts index 1e739a9c86..4aa11aaccc 100644 --- a/apps/wallet-mobile/src/features/Swap/common/strings.ts +++ b/apps/wallet-mobile/src/features/Swap/common/strings.ts @@ -35,6 +35,7 @@ export const useStrings = () => { swapMinReceivedTitle: intl.formatMessage(messages.swapMinReceivedTitle), swapFeesTitle: intl.formatMessage(messages.swapFeesTitle), swapLiquidityFee: intl.formatMessage(messages.swapLiquidityFee), + swapLiqProvFee: intl.formatMessage(messages.swapLiqProvFee), swapLiquidityFeeInfo: (fee: string) => intl.formatMessage(messages.swapLiquidityFeeInfo, {fee}), swapFees: intl.formatMessage(messages.swapFees), poolVerification: (pool: string) => intl.formatMessage(messages.poolVerification, {pool}), @@ -82,6 +83,7 @@ export const useStrings = () => { listOrdersSheetConfirm: intl.formatMessage(messages.listOrdersSheetConfirm), listOrdersSheetBack: intl.formatMessage(messages.listOrdersSheetBack), listOrdersTimeCreated: intl.formatMessage(messages.listOrdersTimeCreated), + listOrdersTimeCompleted: intl.formatMessage(messages.listOrdersTimeCompleted), listOrdersLiquidityPool: intl.formatMessage(messages.listOrdersLiquidityPool), listOrdersTotal: intl.formatMessage(messages.listOrdersTotal), listOrdersTxId: intl.formatMessage(messages.listOrdersTxId), @@ -239,6 +241,10 @@ export const messages = defineMessages({ }, swapLiquidityFee: { id: 'swap.swapScreen.swapLiquidityFee', + defaultMessage: '!!!Liquidity provider fee', + }, + swapLiqProvFee: { + id: 'swap.swapScreen.swapLiqProvFee', defaultMessage: '!!!Liq. prov. fee', }, swapLiquidityFeeInfo: { @@ -445,6 +451,10 @@ export const messages = defineMessages({ id: 'swap.listOrders.timeCreated', defaultMessage: '!!!Time Created', }, + listOrdersTimeCompleted: { + id: 'swap.listOrders.timeCompleted', + defaultMessage: '!!!Time Completed', + }, listOrdersTxId: { id: 'swap.listOrders.txId', defaultMessage: '!!!Transaction ID', diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.tsx index d7f9483185..a5e7717814 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/CreateOrder/EditPool/ShowPoolActions.tsx @@ -156,7 +156,8 @@ const HiddenInfo = ({ info: strings.swapMinReceived, }, { - label: strings.swapLiquidityFee, + label: strings.swapLiqProvFee, + title: strings.swapLiquidityFee, value: `${liquidityFeeValue} ${sellTokenName}`, info: strings.swapLiquidityFeeInfo(liquidityFee), }, @@ -169,7 +170,7 @@ const HiddenInfo = ({ onPress={() => { setBottomSheetSate({ isOpen: true, - title: item.label, + title: item.title ?? item.label, content: item.info, }) }} diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx index 972cabf336..1fa504837f 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx @@ -267,7 +267,7 @@ const MainInfo = ({ {[ {label: strings.listOrdersSheetAssetPrice, value: `${tokenPrice} ${sellLabel}`}, {label: strings.listOrdersSheetAssetAmount, value: tokenAmount}, - {label: strings.listOrdersTimeCreated, value: txTimeCreated}, + {label: strings.listOrdersTimeCompleted, value: txTimeCreated}, ].map((item, index) => ( ))} diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx index 6637fd8803..f30792aaff 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx @@ -269,7 +269,6 @@ export const OpenOrders = () => { txId={order.txId} total={`${order.total} ${order.assetFromLabel}`} txLink={order.txLink} - date={intl.formatDate(new Date(order.date), {dateStyle: 'short', timeStyle: 'short'})} liquidityPoolIcon={liquidityPoolIcon} liquidityPoolName={order.provider ?? ''} poolUrl={order.poolUrl ?? ''} @@ -299,6 +298,7 @@ export const OpenOrders = () => { ) @@ -361,7 +361,6 @@ const HiddenInfo = ({ liquidityPoolIcon, liquidityPoolName, poolUrl, - date, txId, txLink, }: { @@ -369,7 +368,6 @@ const HiddenInfo = ({ liquidityPoolIcon: React.ReactNode liquidityPoolName: string poolUrl: string - date: string txId: string txLink: string }) => { @@ -392,10 +390,7 @@ const HiddenInfo = ({ /> ), }, - { - label: strings.listOrdersTimeCreated, - value: date, - }, + { label: strings.listOrdersTxId, value: , @@ -407,15 +402,19 @@ const HiddenInfo = ({ ) } -const MainInfo = ({tokenPrice, tokenAmount}: {tokenPrice: string; tokenAmount: string}) => { +const MainInfo = ({tokenPrice, tokenAmount, date}: {tokenPrice: string; tokenAmount: string; date: string}) => { const strings = useStrings() return ( {[ {label: strings.listOrdersSheetAssetPrice, value: tokenPrice}, {label: strings.listOrdersSheetAssetAmount, value: tokenAmount}, + { + label: strings.listOrdersTimeCreated, + value: date, + }, ].map((item, index) => ( - + ))} ) diff --git a/apps/wallet-mobile/src/i18n/locales/en-US.json b/apps/wallet-mobile/src/i18n/locales/en-US.json index b66c950319..120485a120 100644 --- a/apps/wallet-mobile/src/i18n/locales/en-US.json +++ b/apps/wallet-mobile/src/i18n/locales/en-US.json @@ -161,9 +161,10 @@ "swap.swapScreen.changePool": "change dex", "swap.swapScreen.swapMinAda": "Min-ADA is the minimum ADA amount required to be contained when holding or sending Cardano native assets.", "swap.swapScreen.swapMinAdaTitle": "Min ADA", - "swap.swapScreen.swapFees": "Swap fees include the following:\n • Matchmaker Fee\n • Frontend Fee", + "swap.swapScreen.swapFees": "Swap fees include the following:\n • DEX Fee\n • Frontend Fee", "swap.swapScreen.swapFeesTitle": "Fees", - "swap.swapScreen.swapLiquidityFee": "Liq. prov. fee", + "swap.swapScreen.swapLiqProvFee": "Liq. prov. fee", + "swap.swapScreen.swapLiquidityFee": "Liquidity provider fee", "swap.swapScreen.swapLiquidityFeeInfo": "Liquidity provider fee is a fixed {fee}% operational fee from the whole transaction volume, that is taken to support DEX “liquidity” allowing traders to buy and sell assets on the decentralized Cardano network.", "swap.swapScreen.swapMinReceived": "Minimum amount of assets you can get because of the slippage tolerance.", "swap.swapScreen.swapMinReceivedTitle": "Min Received", @@ -185,7 +186,8 @@ "swap.listOrders.sheet.back": "Back", "swap.listOrders.total": "Total", "swap.listOrders.liquidityPool": "Liquidity Pool", - "swap.listOrders.timeCreated": "Time Created", + "swap.listOrders.timeCreated": "Time created", + "swap.listOrders.timeCompleted": "Time completed", "swap.listOrders.txId": "Transaction ID", "swap.swapScreen.limitPriceWarningTitle": "Limit price", "swap.swapScreen.limitPriceWarningDescription": "Are you sure you want to proceed this order with the limit price that is 10% or more higher than the market price?", diff --git a/apps/wallet-mobile/translations/messages/src/features/Swap/common/strings.json b/apps/wallet-mobile/translations/messages/src/features/Swap/common/strings.json index 1209765266..a12a3013ef 100644 --- a/apps/wallet-mobile/translations/messages/src/features/Swap/common/strings.json +++ b/apps/wallet-mobile/translations/messages/src/features/Swap/common/strings.json @@ -4,14 +4,14 @@ "defaultMessage": "!!!Incorrect password.", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 135, + "line": 137, "column": 24, - "index": 8657 + "index": 8805 }, "end": { - "line": 138, + "line": 140, "column": 3, - "index": 8766 + "index": 8914 } }, { @@ -19,14 +19,14 @@ "defaultMessage": "!!!Swap", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 139, + "line": 141, "column": 13, - "index": 8781 + "index": 8929 }, "end": { - "line": 142, + "line": 144, "column": 3, - "index": 8854 + "index": 9002 } }, { @@ -34,14 +34,14 @@ "defaultMessage": "!!!Token swap", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 143, + "line": 145, "column": 13, - "index": 8869 + "index": 9017 }, "end": { - "line": 146, + "line": 148, "column": 3, - "index": 8951 + "index": 9099 } }, { @@ -49,14 +49,14 @@ "defaultMessage": "!!!Orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 147, + "line": 149, "column": 13, - "index": 8966 + "index": 9114 }, "end": { - "line": 150, + "line": 152, "column": 3, - "index": 9045 + "index": 9193 } }, { @@ -64,14 +64,14 @@ "defaultMessage": "!!!Market Button", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 151, + "line": 153, "column": 16, - "index": 9063 + "index": 9211 }, "end": { - "line": 154, + "line": 156, "column": 3, - "index": 9148 + "index": 9296 } }, { @@ -79,14 +79,14 @@ "defaultMessage": "!!!Limit", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 155, + "line": 157, "column": 15, - "index": 9165 + "index": 9313 }, "end": { - "line": 158, + "line": 160, "column": 3, - "index": 9241 + "index": 9389 } }, { @@ -94,14 +94,14 @@ "defaultMessage": "!!!Swap from", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 159, + "line": 161, "column": 12, - "index": 9255 + "index": 9403 }, "end": { - "line": 162, + "line": 164, "column": 3, - "index": 9332 + "index": 9480 } }, { @@ -109,14 +109,14 @@ "defaultMessage": "!!!Swap to", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 163, + "line": 165, "column": 10, - "index": 9344 + "index": 9492 }, "end": { - "line": 166, + "line": 168, "column": 3, - "index": 9417 + "index": 9565 } }, { @@ -124,14 +124,14 @@ "defaultMessage": "!!!Current Balance", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 167, + "line": 169, "column": 18, - "index": 9437 + "index": 9585 }, "end": { - "line": 170, + "line": 172, "column": 3, - "index": 9526 + "index": 9674 } }, { @@ -139,14 +139,14 @@ "defaultMessage": "!!!Balance", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 171, + "line": 173, "column": 11, - "index": 9539 + "index": 9687 }, "end": { - "line": 174, + "line": 176, "column": 3, - "index": 9613 + "index": 9761 } }, { @@ -154,14 +154,14 @@ "defaultMessage": "!!!Select Token", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 175, + "line": 177, "column": 15, - "index": 9630 + "index": 9778 }, "end": { - "line": 178, + "line": 180, "column": 3, - "index": 9713 + "index": 9861 } }, { @@ -169,14 +169,14 @@ "defaultMessage": "!!!Market Price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 179, + "line": 181, "column": 15, - "index": 9730 + "index": 9878 }, "end": { - "line": 182, + "line": 184, "column": 3, - "index": 9813 + "index": 9961 } }, { @@ -184,14 +184,14 @@ "defaultMessage": "!!!Limit Price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 183, + "line": 185, "column": 14, - "index": 9829 + "index": 9977 }, "end": { - "line": 186, + "line": 188, "column": 3, - "index": 9910 + "index": 10058 } }, { @@ -199,14 +199,14 @@ "defaultMessage": "!!!Slippage Tolerance", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 187, + "line": 189, "column": 21, - "index": 9933 + "index": 10081 }, "end": { - "line": 190, + "line": 192, "column": 3, - "index": 10028 + "index": 10176 } }, { @@ -214,14 +214,14 @@ "defaultMessage": "!!!Slippage must be a number between 0 and 100 and have up to 1 decimal", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 191, + "line": 193, "column": 26, - "index": 10056 + "index": 10204 }, "end": { - "line": 194, + "line": 196, "column": 3, - "index": 10206 + "index": 10354 } }, { @@ -229,14 +229,14 @@ "defaultMessage": "!!!Slippage Tolerance Info", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 195, + "line": 197, "column": 25, - "index": 10233 + "index": 10381 }, "end": { - "line": 198, + "line": 200, "column": 3, - "index": 10337 + "index": 10485 } }, { @@ -244,14 +244,14 @@ "defaultMessage": "!!!Verified by {pool}", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 199, + "line": 201, "column": 14, - "index": 10353 + "index": 10501 }, "end": { - "line": 202, + "line": 204, "column": 3, - "index": 10441 + "index": 10589 } }, { @@ -259,14 +259,14 @@ "defaultMessage": "!!!This asset is in my portfolio", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 203, + "line": 205, "column": 12, - "index": 10455 + "index": 10603 }, "end": { - "line": 206, + "line": 208, "column": 3, - "index": 10552 + "index": 10700 } }, { @@ -274,14 +274,14 @@ "defaultMessage": "!!!Default Slippage Tolerance", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 207, + "line": 209, "column": 19, - "index": 10573 + "index": 10721 }, "end": { - "line": 210, + "line": 212, "column": 3, - "index": 10674 + "index": 10822 } }, { @@ -289,14 +289,14 @@ "defaultMessage": "!!!Slippage tolerance is set as a percentage of the total swap value.", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 211, + "line": 213, "column": 16, - "index": 10692 + "index": 10840 }, "end": { - "line": 214, + "line": 216, "column": 3, - "index": 10830 + "index": 10978 } }, { @@ -304,14 +304,14 @@ "defaultMessage": "!!!(auto)", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 215, + "line": 217, "column": 12, - "index": 10844 + "index": 10992 }, "end": { - "line": 218, + "line": 220, "column": 3, - "index": 10918 + "index": 11066 } }, { @@ -319,14 +319,14 @@ "defaultMessage": "!!!change dex", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 219, + "line": 221, "column": 14, - "index": 10934 + "index": 11082 }, "end": { - "line": 222, + "line": 224, "column": 3, - "index": 11014 + "index": 11162 } }, { @@ -334,14 +334,14 @@ "defaultMessage": "!!!Min-ADA is the minimum ADA amount required to be contained when holding or sending Cardano native assets.", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 223, + "line": 225, "column": 14, - "index": 11030 + "index": 11178 }, "end": { - "line": 227, + "line": 229, "column": 3, - "index": 11211 + "index": 11359 } }, { @@ -349,14 +349,14 @@ "defaultMessage": "!!!Min ADA", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 228, + "line": 230, "column": 19, - "index": 11232 + "index": 11380 }, "end": { - "line": 231, + "line": 233, "column": 3, - "index": 11314 + "index": 11462 } }, { @@ -364,14 +364,14 @@ "defaultMessage": "!!!Swap fees include the following:\n • Matchmaker Fee\n • Frontend Fee\n • Liquidity Provider Fee", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 232, + "line": 234, "column": 12, - "index": 11328 + "index": 11476 }, "end": { - "line": 235, + "line": 237, "column": 3, - "index": 11491 + "index": 11639 } }, { @@ -379,29 +379,44 @@ "defaultMessage": "!!!Fees", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 236, + "line": 238, "column": 17, - "index": 11510 + "index": 11658 }, "end": { - "line": 239, + "line": 241, "column": 3, - "index": 11587 + "index": 11735 } }, { "id": "swap.swapScreen.swapLiquidityFee", - "defaultMessage": "!!!Liq. prov. fee", + "defaultMessage": "!!!Liquidity provider fee", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 240, + "line": 242, "column": 20, - "index": 11609 + "index": 11757 + }, + "end": { + "line": 245, + "column": 3, + "index": 11855 + } + }, + { + "id": "swap.swapScreen.swapLiqProvFee", + "defaultMessage": "!!!Liq. prov. fee", + "file": "src/features/Swap/common/strings.ts", + "start": { + "line": 246, + "column": 18, + "index": 11875 }, "end": { - "line": 243, + "line": 249, "column": 3, - "index": 11699 + "index": 11963 } }, { @@ -409,14 +424,14 @@ "defaultMessage": "!!!Liquidity provider fee is a fixed {fee}% operational fee from the whole transaction volume, that is taken to support DEX “liquidity” allowing traders to buy and sell assets on the decentralized Cardano network.", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 244, + "line": 250, "column": 24, - "index": 11725 + "index": 11989 }, "end": { - "line": 248, + "line": 254, "column": 3, - "index": 12021 + "index": 12285 } }, { @@ -424,14 +439,14 @@ "defaultMessage": "!!!Minimum amount of assets you can get because of the slippage tolerance.", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 249, + "line": 255, "column": 19, - "index": 12042 + "index": 12306 }, "end": { - "line": 252, + "line": 258, "column": 3, - "index": 12188 + "index": 12452 } }, { @@ -439,14 +454,14 @@ "defaultMessage": "!!!Min Received", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 253, + "line": 259, "column": 24, - "index": 12214 + "index": 12478 }, "end": { - "line": 256, + "line": 262, "column": 3, - "index": 12306 + "index": 12570 } }, { @@ -454,14 +469,14 @@ "defaultMessage": "!!!Enter a value from 0% to 100%. You can also enter up to 1 decimal", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 257, + "line": 263, "column": 17, - "index": 12325 + "index": 12589 }, "end": { - "line": 260, + "line": 266, "column": 3, - "index": 12463 + "index": 12727 } }, { @@ -469,14 +484,14 @@ "defaultMessage": "!!!{pool} verification", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 261, + "line": 267, "column": 20, - "index": 12485 + "index": 12749 }, "end": { - "line": 264, + "line": 270, "column": 3, - "index": 12580 + "index": 12844 } }, { @@ -484,14 +499,14 @@ "defaultMessage": "!!!Volume, 24h", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 265, + "line": 271, "column": 10, - "index": 12592 + "index": 12856 }, "end": { - "line": 268, + "line": 274, "column": 3, - "index": 12669 + "index": 12933 } }, { @@ -499,14 +514,14 @@ "defaultMessage": "!!!Cardano projects that list their own tokens can apply for an additional {pool} verification. This verification is a manual validation that {pool} team performs with the help of Cardano Foundation.", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 269, + "line": 275, "column": 24, - "index": 12695 + "index": 12959 }, "end": { - "line": 273, + "line": 279, "column": 3, - "index": 12977 + "index": 13241 } }, { @@ -514,14 +529,14 @@ "defaultMessage": "!!! Price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 274, + "line": 280, "column": 9, - "index": 12988 + "index": 13252 }, "end": { - "line": 277, + "line": 283, "column": 3, - "index": 13050 + "index": 13314 } }, { @@ -529,14 +544,14 @@ "defaultMessage": "!!!No assets found for this pair", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 278, + "line": 284, "column": 17, - "index": 13069 + "index": 13333 }, "end": { - "line": 281, + "line": 287, "column": 3, - "index": 13171 + "index": 13435 } }, { @@ -544,14 +559,14 @@ "defaultMessage": "!!!No assets found for \"{search}\"", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 282, + "line": 288, "column": 20, - "index": 13193 + "index": 13457 }, "end": { - "line": 285, + "line": 291, "column": 3, - "index": 13299 + "index": 13563 } }, { @@ -559,14 +574,14 @@ "defaultMessage": "!!!Each verified tokens gets", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 286, + "line": 292, "column": 21, - "index": 13322 + "index": 13586 }, "end": { - "line": 289, + "line": 295, "column": 3, - "index": 13424 + "index": 13688 } }, { @@ -574,14 +589,14 @@ "defaultMessage": "!!!verified badge", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 290, + "line": 296, "column": 17, - "index": 13443 + "index": 13707 }, "end": { - "line": 293, + "line": 299, "column": 3, - "index": 13530 + "index": 13794 } }, { @@ -589,14 +604,14 @@ "defaultMessage": "!!!Open orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 294, + "line": 300, "column": 14, - "index": 13546 + "index": 13810 }, "end": { - "line": 297, + "line": 303, "column": 3, - "index": 13627 + "index": 13891 } }, { @@ -604,14 +619,14 @@ "defaultMessage": "!!!Completed orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 298, + "line": 304, "column": 19, - "index": 13648 + "index": 13912 }, "end": { - "line": 301, + "line": 307, "column": 3, - "index": 13739 + "index": 14003 } }, { @@ -619,14 +634,14 @@ "defaultMessage": "!!!TVL", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 302, + "line": 308, "column": 7, - "index": 13748 + "index": 14012 }, "end": { - "line": 305, + "line": 311, "column": 3, - "index": 13814 + "index": 14078 } }, { @@ -634,14 +649,14 @@ "defaultMessage": "!!! Dex Fee", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 306, + "line": 312, "column": 11, - "index": 13827 + "index": 14091 }, "end": { - "line": 309, + "line": 315, "column": 3, - "index": 13902 + "index": 14166 } }, { @@ -649,14 +664,14 @@ "defaultMessage": "!!! Batcher Fee", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 310, + "line": 316, "column": 14, - "index": 13918 + "index": 14182 }, "end": { - "line": 313, + "line": 319, "column": 3, - "index": 14000 + "index": 14264 } }, { @@ -664,14 +679,14 @@ "defaultMessage": "!!!Limit price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 314, + "line": 320, "column": 26, - "index": 14028 + "index": 14292 }, "end": { - "line": 317, + "line": 323, "column": 3, - "index": 14121 + "index": 14385 } }, { @@ -679,14 +694,14 @@ "defaultMessage": "!!!Are you sure you want to proceed this order with the limit price that is 10% or more higher than the\nmarket price?", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 318, + "line": 324, "column": 32, - "index": 14155 + "index": 14419 }, "end": { - "line": 323, + "line": 329, "column": 3, - "index": 14375 + "index": 14639 } }, { @@ -694,14 +709,14 @@ "defaultMessage": "!!!Your limit price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 324, + "line": 330, "column": 30, - "index": 14407 + "index": 14671 }, "end": { - "line": 327, + "line": 333, "column": 3, - "index": 14509 + "index": 14773 } }, { @@ -709,14 +724,14 @@ "defaultMessage": "!!!Market price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 328, + "line": 334, "column": 32, - "index": 14543 + "index": 14807 }, "end": { - "line": 331, + "line": 337, "column": 3, - "index": 14643 + "index": 14907 } }, { @@ -724,14 +739,14 @@ "defaultMessage": "!!!Back", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 332, + "line": 338, "column": 25, - "index": 14670 + "index": 14934 }, "end": { - "line": 335, + "line": 341, "column": 3, - "index": 14755 + "index": 15019 } }, { @@ -739,14 +754,14 @@ "defaultMessage": "!!!Swap", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 336, + "line": 342, "column": 28, - "index": 14785 + "index": 15049 }, "end": { - "line": 339, + "line": 345, "column": 3, - "index": 14873 + "index": 15137 } }, { @@ -754,14 +769,14 @@ "defaultMessage": "!!!Transaction submitted", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 340, + "line": 346, "column": 21, - "index": 14896 + "index": 15160 }, "end": { - "line": 343, + "line": 349, "column": 3, - "index": 14994 + "index": 15258 } }, { @@ -769,14 +784,14 @@ "defaultMessage": "!!!Your transactions will be displayed both in the list of transaction and Open swap orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 344, + "line": 350, "column": 22, - "index": 15018 + "index": 15282 }, "end": { - "line": 347, + "line": 353, "column": 3, - "index": 15184 + "index": 15448 } }, { @@ -784,14 +799,14 @@ "defaultMessage": "!!! dex", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 348, + "line": 354, "column": 7, - "index": 15193 + "index": 15457 }, "end": { - "line": 351, + "line": 357, "column": 3, - "index": 15260 + "index": 15524 } }, { @@ -799,14 +814,14 @@ "defaultMessage": "!!!see on explorer", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 352, + "line": 358, "column": 17, - "index": 15279 + "index": 15543 }, "end": { - "line": 355, + "line": 361, "column": 3, - "index": 15367 + "index": 15631 } }, { @@ -814,14 +829,14 @@ "defaultMessage": "!!!GO to Orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 356, + "line": 362, "column": 14, - "index": 15383 + "index": 15647 }, "end": { - "line": 359, + "line": 365, "column": 3, - "index": 15465 + "index": 15729 } }, { @@ -829,14 +844,14 @@ "defaultMessage": "!!!Asset", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 360, + "line": 366, "column": 9, - "index": 15476 + "index": 15740 }, "end": { - "line": 363, + "line": 369, "column": 3, - "index": 15549 + "index": 15813 } }, { @@ -844,14 +859,14 @@ "defaultMessage": "!!!Clear", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 364, + "line": 370, "column": 9, - "index": 15560 + "index": 15824 }, "end": { - "line": 367, + "line": 373, "column": 3, - "index": 15621 + "index": 15885 } }, { @@ -859,14 +874,14 @@ "defaultMessage": "!!!Sign transaction", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 368, + "line": 374, "column": 19, - "index": 15642 + "index": 15906 }, "end": { - "line": 371, + "line": 377, "column": 3, - "index": 15724 + "index": 15988 } }, { @@ -874,14 +889,14 @@ "defaultMessage": "!!!Spending Password", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 372, + "line": 378, "column": 20, - "index": 15746 + "index": 16010 }, "end": { - "line": 375, + "line": 381, "column": 3, - "index": 15830 + "index": 16094 } }, { @@ -889,14 +904,14 @@ "defaultMessage": "!!!Enter spending password to sign this transaction", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 376, + "line": 382, "column": 25, - "index": 15857 + "index": 16121 }, "end": { - "line": 379, + "line": 385, "column": 3, - "index": 15977 + "index": 16241 } }, { @@ -904,14 +919,14 @@ "defaultMessage": "!!!Sign", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 380, + "line": 386, "column": 8, - "index": 15987 + "index": 16251 }, "end": { - "line": 383, + "line": 389, "column": 3, - "index": 16046 + "index": 16310 } }, { @@ -919,14 +934,14 @@ "defaultMessage": "!!!Swap", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 384, + "line": 390, "column": 14, - "index": 16062 + "index": 16326 }, "end": { - "line": 387, + "line": 393, "column": 3, - "index": 16121 + "index": 16385 } }, { @@ -934,14 +949,14 @@ "defaultMessage": "!!!completed orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 388, + "line": 394, "column": 23, - "index": 16146 + "index": 16410 }, "end": { - "line": 391, + "line": 397, "column": 3, - "index": 16231 + "index": 16495 } }, { @@ -949,14 +964,14 @@ "defaultMessage": "!!!open orders", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 392, + "line": 398, "column": 18, - "index": 16251 + "index": 16515 }, "end": { - "line": 395, + "line": 401, "column": 3, - "index": 16326 + "index": 16590 } }, { @@ -964,14 +979,14 @@ "defaultMessage": "!!!Confirm order cancelation", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 396, + "line": 402, "column": 24, - "index": 16352 + "index": 16616 }, "end": { - "line": 399, + "line": 405, "column": 3, - "index": 16448 + "index": 16712 } }, { @@ -979,14 +994,14 @@ "defaultMessage": "!!!Cancel order", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 400, + "line": 406, "column": 29, - "index": 16479 + "index": 16743 }, "end": { - "line": 403, + "line": 409, "column": 3, - "index": 16566 + "index": 16830 } }, { @@ -994,14 +1009,14 @@ "defaultMessage": "!!!Are you sure you want to cancel this order?", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 404, + "line": 410, "column": 31, - "index": 16599 + "index": 16863 }, "end": { - "line": 407, + "line": 413, "column": 3, - "index": 16720 + "index": 16984 } }, { @@ -1009,14 +1024,14 @@ "defaultMessage": "!!!Learn more about swap orders in Yoroi", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 408, + "line": 414, "column": 23, - "index": 16745 + "index": 17009 }, "end": { - "line": 411, + "line": 417, "column": 3, - "index": 16852 + "index": 17116 } }, { @@ -1024,14 +1039,14 @@ "defaultMessage": "!!!Asset price", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 412, + "line": 418, "column": 29, - "index": 16883 + "index": 17147 }, "end": { - "line": 415, + "line": 421, "column": 3, - "index": 16970 + "index": 17234 } }, { @@ -1039,14 +1054,14 @@ "defaultMessage": "!!!Asset amount", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 416, + "line": 422, "column": 30, - "index": 17002 + "index": 17266 }, "end": { - "line": 419, + "line": 425, "column": 3, - "index": 17091 + "index": 17355 } }, { @@ -1054,14 +1069,14 @@ "defaultMessage": "!!!Total returned", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 420, + "line": 426, "column": 32, - "index": 17125 + "index": 17389 }, "end": { - "line": 423, + "line": 429, "column": 3, - "index": 17218 + "index": 17482 } }, { @@ -1069,14 +1084,14 @@ "defaultMessage": "!!!Cancellation Fee", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 424, + "line": 430, "column": 34, - "index": 17254 + "index": 17518 }, "end": { - "line": 427, + "line": 433, "column": 3, - "index": 17351 + "index": 17615 } }, { @@ -1084,14 +1099,14 @@ "defaultMessage": "!!!Confirm", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 428, + "line": 434, "column": 26, - "index": 17379 + "index": 17643 }, "end": { - "line": 431, + "line": 437, "column": 3, - "index": 17459 + "index": 17723 } }, { @@ -1099,14 +1114,14 @@ "defaultMessage": "!!!Back", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 432, + "line": 438, "column": 23, - "index": 17484 + "index": 17748 }, "end": { - "line": 435, + "line": 441, "column": 3, - "index": 17558 + "index": 17822 } }, { @@ -1114,14 +1129,14 @@ "defaultMessage": "!!!Total", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 436, + "line": 442, "column": 19, - "index": 17579 + "index": 17843 }, "end": { - "line": 439, + "line": 445, "column": 3, - "index": 17649 + "index": 17913 } }, { @@ -1129,14 +1144,14 @@ "defaultMessage": "!!!Liquidity Pool", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 440, + "line": 446, "column": 27, - "index": 17678 + "index": 17942 }, "end": { - "line": 443, + "line": 449, "column": 3, - "index": 17765 + "index": 18029 } }, { @@ -1144,14 +1159,29 @@ "defaultMessage": "!!!Time Created", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 444, + "line": 450, "column": 25, - "index": 17792 + "index": 18056 }, "end": { - "line": 447, + "line": 453, "column": 3, - "index": 17875 + "index": 18139 + } + }, + { + "id": "swap.listOrders.timeCompleted", + "defaultMessage": "!!!Time Completed", + "file": "src/features/Swap/common/strings.ts", + "start": { + "line": 454, + "column": 27, + "index": 18168 + }, + "end": { + "line": 457, + "column": 3, + "index": 18255 } }, { @@ -1159,14 +1189,14 @@ "defaultMessage": "!!!Transaction ID", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 448, + "line": 458, "column": 18, - "index": 17895 + "index": 18275 }, "end": { - "line": 451, + "line": 461, "column": 3, - "index": 17973 + "index": 18353 } }, { @@ -1174,14 +1204,14 @@ "defaultMessage": "!!!Choose Connection Method", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 452, + "line": 462, "column": 26, - "index": 18001 + "index": 18381 }, "end": { - "line": 455, + "line": 465, "column": 3, - "index": 18119 + "index": 18499 } }, { @@ -1189,14 +1219,14 @@ "defaultMessage": "!!!Choose this option if you want to connect to a Ledger Nano model X or S using an on-the-go USB cable adaptor:", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 456, + "line": 466, "column": 18, - "index": 18139 + "index": 18519 }, "end": { - "line": 461, + "line": 471, "column": 3, - "index": 18368 + "index": 18748 } }, { @@ -1204,14 +1234,14 @@ "defaultMessage": "!!!Connect with USB", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 462, + "line": 472, "column": 13, - "index": 18383 + "index": 18763 }, "end": { - "line": 465, + "line": 475, "column": 3, - "index": 18497 + "index": 18877 } }, { @@ -1219,14 +1249,14 @@ "defaultMessage": "!!! USB connection is blocked by iOS devices", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 466, + "line": 476, "column": 26, - "index": 18525 + "index": 18905 }, "end": { - "line": 469, + "line": 479, "column": 3, - "index": 18677 + "index": 19057 } }, { @@ -1234,14 +1264,14 @@ "defaultMessage": "!!!Choose this option if you want to connect to a Ledger Nano model X through Bluetooth:", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 470, + "line": 480, "column": 24, - "index": 18703 + "index": 19083 }, "end": { - "line": 473, + "line": 483, "column": 3, - "index": 18897 + "index": 19277 } }, { @@ -1249,14 +1279,14 @@ "defaultMessage": "!!!Connect with Bluetooth", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 474, + "line": 484, "column": 19, - "index": 18918 + "index": 19298 }, "end": { - "line": 477, + "line": 487, "column": 3, - "index": 19044 + "index": 19424 } }, { @@ -1264,14 +1294,14 @@ "defaultMessage": "!!!Connect with Bluetooth", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 478, + "line": 488, "column": 18, - "index": 19064 + "index": 19444 }, "end": { - "line": 481, + "line": 491, "column": 3, - "index": 19174 + "index": 19554 } }, { @@ -1279,14 +1309,14 @@ "defaultMessage": "!!!You have", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 484, + "line": 494, "column": 11, - "index": 19233 + "index": 19613 }, "end": { - "line": 487, + "line": 497, "column": 3, - "index": 19328 + "index": 19708 } }, { @@ -1294,14 +1324,14 @@ "defaultMessage": "!!!No assets found", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 488, + "line": 498, "column": 12, - "index": 19342 + "index": 19722 }, "end": { - "line": 491, + "line": 501, "column": 3, - "index": 19445 + "index": 19825 } }, { @@ -1309,14 +1339,14 @@ "defaultMessage": "!!!found", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 492, + "line": 502, "column": 9, - "index": 19456 + "index": 19836 }, "end": { - "line": 495, + "line": 505, "column": 3, - "index": 19546 + "index": 19926 } }, { @@ -1324,14 +1354,14 @@ "defaultMessage": "!!!Search tokens", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 496, + "line": 506, "column": 16, - "index": 19564 + "index": 19944 }, "end": { - "line": 499, + "line": 509, "column": 3, - "index": 19660 + "index": 20040 } }, { @@ -1339,14 +1369,14 @@ "defaultMessage": "!!!Select asset", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 500, + "line": 510, "column": 20, - "index": 19682 + "index": 20062 }, "end": { - "line": 503, + "line": 513, "column": 3, - "index": 19771 + "index": 20151 } }, { @@ -1354,14 +1384,14 @@ "defaultMessage": "!!!Confirm", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 504, + "line": 514, "column": 11, - "index": 19784 + "index": 20164 }, "end": { - "line": 507, + "line": 517, "column": 3, - "index": 19878 + "index": 20258 } }, { @@ -1369,14 +1399,14 @@ "defaultMessage": "!!!Assign collateral", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 508, + "line": 518, "column": 20, - "index": 19900 + "index": 20280 }, "end": { - "line": 511, + "line": 521, "column": 3, - "index": 20007 + "index": 20387 } }, { @@ -1384,14 +1414,14 @@ "defaultMessage": "!!!Collateral not found", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 512, + "line": 522, "column": 22, - "index": 20031 + "index": 20411 }, "end": { - "line": 515, + "line": 525, "column": 3, - "index": 20143 + "index": 20523 } }, { @@ -1399,14 +1429,14 @@ "defaultMessage": "!!!You don't have an active collateral utxo", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 516, + "line": 526, "column": 22, - "index": 20167 + "index": 20547 }, "end": { - "line": 519, + "line": 529, "column": 3, - "index": 20299 + "index": 20679 } }, { @@ -1414,14 +1444,14 @@ "defaultMessage": "!!!Transaction failed", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 520, + "line": 530, "column": 17, - "index": 20318 + "index": 20698 }, "end": { - "line": 523, + "line": 533, "column": 3, - "index": 20420 + "index": 20800 } }, { @@ -1429,14 +1459,14 @@ "defaultMessage": "!!!Your transaction has not been processed properly due to technical issues", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 524, + "line": 534, "column": 16, - "index": 20438 + "index": 20818 }, "end": { - "line": 527, + "line": 537, "column": 3, - "index": 20593 + "index": 20973 } }, { @@ -1444,14 +1474,14 @@ "defaultMessage": "!!!Try again", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 528, + "line": 538, "column": 18, - "index": 20613 + "index": 20993 }, "end": { - "line": 531, + "line": 541, "column": 3, - "index": 20707 + "index": 21087 } }, { @@ -1459,14 +1489,14 @@ "defaultMessage": "!!!Not enough balance", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 532, + "line": 542, "column": 20, - "index": 20729 + "index": 21109 }, "end": { - "line": 535, + "line": 545, "column": 3, - "index": 20823 + "index": 21203 } }, { @@ -1474,14 +1504,14 @@ "defaultMessage": "!!!Not enough supply in the pool", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 536, + "line": 546, "column": 19, - "index": 20844 + "index": 21224 }, "end": { - "line": 539, + "line": 549, "column": 3, - "index": 20948 + "index": 21328 } }, { @@ -1489,14 +1519,14 @@ "defaultMessage": "!!! This pair is not available in any liquidity pool", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 540, + "line": 550, "column": 10, - "index": 20960 + "index": 21340 }, "end": { - "line": 543, + "line": 553, "column": 3, - "index": 21075 + "index": 21455 } }, { @@ -1504,14 +1534,14 @@ "defaultMessage": "!!!Continue on Ledger", "file": "src/features/Swap/common/strings.ts", "start": { - "line": 544, + "line": 554, "column": 20, - "index": 21097 + "index": 21477 }, "end": { - "line": 547, + "line": 557, "column": 3, - "index": 21197 + "index": 21577 } } ] \ No newline at end of file From e7191cf8d1cfc164808507904844671f76f5bd1d Mon Sep 17 00:00:00 2001 From: SorinC6 Date: Tue, 17 Oct 2023 17:37:20 +0300 Subject: [PATCH 3/9] add helper to format date as per design requirement --- .../src/features/Swap/common/helpers.ts | 26 +++++++++++++++++++ .../ListOrders/CompletedOrders.tsx | 4 +-- .../StartSwapScreen/ListOrders/OpenOrders.tsx | 3 ++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/apps/wallet-mobile/src/features/Swap/common/helpers.ts b/apps/wallet-mobile/src/features/Swap/common/helpers.ts index 2bb7ce638d..41108d10b4 100644 --- a/apps/wallet-mobile/src/features/Swap/common/helpers.ts +++ b/apps/wallet-mobile/src/features/Swap/common/helpers.ts @@ -98,3 +98,29 @@ export const parseOrderTxMetadata = (metadataJson: string): OrderTxMetadata | nu const parsedMetadata = parseSafe(metadataJson) return isOrderTxMetadata(parsedMetadata) ? parsedMetadata : null } + +export const formatCustomDate = (dateString: string, locale: string): string => { + const date = new Date(dateString) + + // Use Intl.DateTimeFormat to handle locale and time zone conversions + const dateTimeFormatOptions: Intl.DateTimeFormatOptions = { + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + hour12: false, // use 24-hour cycle + } + const formattedParts = new Intl.DateTimeFormat(locale, dateTimeFormatOptions).formatToParts(date) + + const findPart = (type: string) => formattedParts.find((part) => part.type === type)?.value + const day = findPart('day') + const month = findPart('month') + const year = findPart('year') + const hour = findPart('hour') + const minute = findPart('minute') + const second = findPart('second') + + return `${day}/${month}/${year} ${hour}:${minute}:${second}` +} diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx index da027dff77..8ddd34bfc2 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx @@ -25,7 +25,7 @@ import {useSync, useTokenInfo, useTransactionInfos} from '../../../../../yoroi-w import {TransactionInfo, TxMetadataInfo} from '../../../../../yoroi-wallets/types' import {asQuantity, openInExplorer, Quantities} from '../../../../../yoroi-wallets/utils' import {Counter} from '../../../common/Counter/Counter' -import {parseOrderTxMetadata} from '../../../common/helpers' +import {formatCustomDate, parseOrderTxMetadata} from '../../../common/helpers' import {PoolIcon} from '../../../common/PoolIcon/PoolIcon' import {useStrings} from '../../../common/strings' @@ -163,7 +163,7 @@ export const ExpandableOrder = ({order}: {order: MappedRawOrder}) => { tokenPrice={marketPrice} sellLabel={sellLabel} tokenAmount={`${sellQuantity} ${sellLabel}`} - txTimeCreated={intl.formatDate(new Date(order.date), {dateStyle: 'short', timeStyle: 'short'})} + txTimeCreated={formatCustomDate(order.date, intl.locale)} /> ) diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx index f30792aaff..d6b2861126 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx @@ -35,6 +35,7 @@ import {createRawTxSigningKey, generateCIP30UtxoCbor} from '../../../../../yoroi import {useTokenInfos, useTransactionInfos} from '../../../../../yoroi-wallets/hooks' import {ConfirmRawTx} from '../../../common/ConfirmRawTx/ConfirmRawTx' import {Counter} from '../../../common/Counter/Counter' +import {formatCustomDate} from '../../../common/helpers' import {LiquidityPool} from '../../../common/LiquidityPool/LiquidityPool' import {PoolIcon} from '../../../common/PoolIcon/PoolIcon' import {useStrings} from '../../../common/strings' @@ -298,7 +299,7 @@ export const OpenOrders = () => { ) From 2e6bdb066a6f8b79238161f9ca31ba96766dce53 Mon Sep 17 00:00:00 2001 From: SorinC6 Date: Wed, 18 Oct 2023 10:00:26 +0300 Subject: [PATCH 4/9] refactor: extract info into array --- .../ListOrders/CompletedOrders.tsx | 13 +++++++------ .../StartSwapScreen/ListOrders/OpenOrders.tsx | 19 ++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx index 8ddd34bfc2..712b73d8c9 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx @@ -256,14 +256,15 @@ const MainInfo = ({ txTimeCreated: string }) => { const strings = useStrings() + const orderInfo = [ + {label: strings.listOrdersSheetAssetPrice, value: `${tokenPrice} ${sellLabel}`}, + {label: strings.listOrdersSheetAssetAmount, value: tokenAmount}, + {label: strings.listOrdersTimeCompleted, value: txTimeCreated}, + ] return ( - {[ - {label: strings.listOrdersSheetAssetPrice, value: `${tokenPrice} ${sellLabel}`}, - {label: strings.listOrdersSheetAssetAmount, value: tokenAmount}, - {label: strings.listOrdersTimeCompleted, value: txTimeCreated}, - ].map((item, index) => ( - + {orderInfo.map((item, index) => ( + ))} ) diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx index d6b2861126..f91f73b5fd 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx @@ -405,17 +405,18 @@ const HiddenInfo = ({ const MainInfo = ({tokenPrice, tokenAmount, date}: {tokenPrice: string; tokenAmount: string; date: string}) => { const strings = useStrings() + const orderInfo = [ + {label: strings.listOrdersSheetAssetPrice, value: tokenPrice}, + {label: strings.listOrdersSheetAssetAmount, value: tokenAmount}, + { + label: strings.listOrdersTimeCreated, + value: date, + }, + ] return ( - {[ - {label: strings.listOrdersSheetAssetPrice, value: tokenPrice}, - {label: strings.listOrdersSheetAssetAmount, value: tokenAmount}, - { - label: strings.listOrdersTimeCreated, - value: date, - }, - ].map((item, index) => ( - + {orderInfo.map((item, index) => ( + ))} ) From 79212037a3dfcfe18b45cd86d14e814d07363809 Mon Sep 17 00:00:00 2001 From: SorinC6 Date: Wed, 18 Oct 2023 10:05:06 +0300 Subject: [PATCH 5/9] fix: condition to not show the cancel orders --- .../useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx index 712b73d8c9..d1020f82bd 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx @@ -56,7 +56,11 @@ const findCompletedOrderTx = (transactions: TransactionInfo[]): MappedRawOrder[] const result: TxMetadataInfo = {} receivedTransactions.forEach((receivedTx) => { receivedTx.inputs.forEach((input) => { - if (Boolean(input.id) && input?.id?.slice(0, -1) === sentTx?.id && receivedTx.metadata?.['674'] !== null) { + if ( + Boolean(input.id) && + input?.id?.slice(0, -1) === sentTx?.id && + receivedTx.metadata?.['674'] !== undefined + ) { result['id'] = sentTx?.id result['date'] = receivedTx?.lastUpdatedAt const metadata = parseOrderTxMetadata(sentTx?.metadata?.['674']) From f59baaf7dcb47b9bebc6c8b7f03e6048d025e834 Mon Sep 17 00:00:00 2001 From: SorinC6 Date: Wed, 18 Oct 2023 11:02:46 +0300 Subject: [PATCH 6/9] fix date display --- .../src/features/Swap/common/helpers.ts | 26 ------------------- .../ListOrders/CompletedOrders.tsx | 8 ++++-- .../StartSwapScreen/ListOrders/OpenOrders.tsx | 7 +++-- 3 files changed, 11 insertions(+), 30 deletions(-) diff --git a/apps/wallet-mobile/src/features/Swap/common/helpers.ts b/apps/wallet-mobile/src/features/Swap/common/helpers.ts index 41108d10b4..2bb7ce638d 100644 --- a/apps/wallet-mobile/src/features/Swap/common/helpers.ts +++ b/apps/wallet-mobile/src/features/Swap/common/helpers.ts @@ -98,29 +98,3 @@ export const parseOrderTxMetadata = (metadataJson: string): OrderTxMetadata | nu const parsedMetadata = parseSafe(metadataJson) return isOrderTxMetadata(parsedMetadata) ? parsedMetadata : null } - -export const formatCustomDate = (dateString: string, locale: string): string => { - const date = new Date(dateString) - - // Use Intl.DateTimeFormat to handle locale and time zone conversions - const dateTimeFormatOptions: Intl.DateTimeFormatOptions = { - year: 'numeric', - month: '2-digit', - day: '2-digit', - hour: '2-digit', - minute: '2-digit', - second: '2-digit', - hour12: false, // use 24-hour cycle - } - const formattedParts = new Intl.DateTimeFormat(locale, dateTimeFormatOptions).formatToParts(date) - - const findPart = (type: string) => formattedParts.find((part) => part.type === type)?.value - const day = findPart('day') - const month = findPart('month') - const year = findPart('year') - const hour = findPart('hour') - const minute = findPart('minute') - const second = findPart('second') - - return `${day}/${month}/${year} ${hour}:${minute}:${second}` -} diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx index d1020f82bd..8cb7e318aa 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/CompletedOrders.tsx @@ -25,7 +25,7 @@ import {useSync, useTokenInfo, useTransactionInfos} from '../../../../../yoroi-w import {TransactionInfo, TxMetadataInfo} from '../../../../../yoroi-wallets/types' import {asQuantity, openInExplorer, Quantities} from '../../../../../yoroi-wallets/utils' import {Counter} from '../../../common/Counter/Counter' -import {formatCustomDate, parseOrderTxMetadata} from '../../../common/helpers' +import {parseOrderTxMetadata} from '../../../common/helpers' import {PoolIcon} from '../../../common/PoolIcon/PoolIcon' import {useStrings} from '../../../common/strings' @@ -167,7 +167,11 @@ export const ExpandableOrder = ({order}: {order: MappedRawOrder}) => { tokenPrice={marketPrice} sellLabel={sellLabel} tokenAmount={`${sellQuantity} ${sellLabel}`} - txTimeCreated={formatCustomDate(order.date, intl.locale)} + txTimeCreated={intl.formatDate(new Date(order.date), { + dateStyle: 'short', + timeStyle: 'medium', + hour12: false, + })} /> ) diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx index f91f73b5fd..1609f8245b 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/OpenOrders.tsx @@ -35,7 +35,6 @@ import {createRawTxSigningKey, generateCIP30UtxoCbor} from '../../../../../yoroi import {useTokenInfos, useTransactionInfos} from '../../../../../yoroi-wallets/hooks' import {ConfirmRawTx} from '../../../common/ConfirmRawTx/ConfirmRawTx' import {Counter} from '../../../common/Counter/Counter' -import {formatCustomDate} from '../../../common/helpers' import {LiquidityPool} from '../../../common/LiquidityPool/LiquidityPool' import {PoolIcon} from '../../../common/PoolIcon/PoolIcon' import {useStrings} from '../../../common/strings' @@ -299,7 +298,11 @@ export const OpenOrders = () => { ) From 5839584dcd115364ee8d016da97ffaa9bbfe54f8 Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 18 Oct 2023 09:04:45 +0200 Subject: [PATCH 7/9] feat(swap): Add explorer to confirmation screen and change layout (#2789) --- .../src/features/Send/common/navigation.ts | 2 +- .../useCases/ConfirmTx/ConfirmTxScreen.tsx | 2 +- .../src/features/Swap/common/navigation.ts | 2 +- .../useCases/ConfirmTxScreen/ConfirmTx.tsx | 4 +- .../ConfirmTxScreen/ConfirmTxScreen.tsx | 10 ++-- .../ConfirmTxScreen/ConfirmTxWithHW.tsx | 4 +- .../ConfirmTxScreen/ConfirmTxWithPassword.tsx | 14 +++-- .../ShowSubmittedTxScreen.tsx | 51 +++++++++++++++++-- apps/wallet-mobile/src/navigation.tsx | 4 +- 9 files changed, 72 insertions(+), 21 deletions(-) diff --git a/apps/wallet-mobile/src/features/Send/common/navigation.ts b/apps/wallet-mobile/src/features/Send/common/navigation.ts index 1073308216..f28dabe328 100644 --- a/apps/wallet-mobile/src/features/Send/common/navigation.ts +++ b/apps/wallet-mobile/src/features/Send/common/navigation.ts @@ -14,7 +14,7 @@ export const useNavigateTo = () => { confirmTx: () => navigation.navigate('send-confirm-tx'), editAmount: () => navigation.navigate('send-edit-amount'), reader: () => navigation.navigate('send-read-qr-code'), - submittedTx: () => navigation.navigate('send-submitted-tx'), + submittedTx: (txId: string) => navigation.navigate('send-submitted-tx', {txId}), failedTx: () => navigation.navigate('send-failed-tx'), startTxAfterReset: () => navigation.reset({ diff --git a/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/ConfirmTxScreen.tsx b/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/ConfirmTxScreen.tsx index 163abda8e6..02cc4537b0 100644 --- a/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/ConfirmTxScreen.tsx +++ b/apps/wallet-mobile/src/features/Send/useCases/ConfirmTx/ConfirmTxScreen.tsx @@ -55,7 +55,7 @@ export const ConfirmTxScreen = () => { const onSuccess = (signedTx: YoroiSignedTx) => { track.sendSummarySubmitted(assetsToSendProperties({tokens, amounts})) - navigateTo.submittedTx() + navigateTo.submittedTx(signedTx.signedTx.id) if (memo.length > 0) { saveMemo({txId: signedTx.signedTx.id, memo: memo.trim()}) diff --git a/apps/wallet-mobile/src/features/Swap/common/navigation.ts b/apps/wallet-mobile/src/features/Swap/common/navigation.ts index 14966e1ea0..f0bb20e41c 100644 --- a/apps/wallet-mobile/src/features/Swap/common/navigation.ts +++ b/apps/wallet-mobile/src/features/Swap/common/navigation.ts @@ -13,7 +13,7 @@ export const useNavigateTo = () => { selectSellToken: () => navigation.navigate('swap-select-sell-token'), startSwap: () => navigation.navigate('swap-start-swap'), confirmTx: () => navigation.navigate('swap-confirm-tx'), - submittedTx: () => navigation.navigate('swap-submitted-tx'), + submittedTx: (txId: string) => navigation.navigate('swap-submitted-tx', {txId}), failedTx: () => navigation.navigate('swap-failed-tx'), swapOpenOrders: () => navigation.reset({ diff --git a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTx.tsx b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTx.tsx index d0dc7e460e..cea185da98 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTx.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTx.tsx @@ -2,7 +2,7 @@ import React from 'react' import {ErrorBoundary} from 'react-error-boundary' import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' -import {YoroiUnsignedTx} from '../../../../yoroi-wallets/types' +import {YoroiSignedTx, YoroiUnsignedTx} from '../../../../yoroi-wallets/types' import {ModalError} from '../../common/ModalError/ModalError' import {ConfirmTxWithHW} from './ConfirmTxWithHW' import {ConfirmTxWithPassword} from './ConfirmTxWithPassword' @@ -11,7 +11,7 @@ type Props = { wallet: YoroiWallet unsignedTx: YoroiUnsignedTx onCancel: () => void - onSuccess: () => void + onSuccess: (signedTx: YoroiSignedTx) => void } export const ConfirmTx = ({wallet, onSuccess, onCancel, unsignedTx}: Props) => { diff --git a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxScreen.tsx b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxScreen.tsx index 40a345869a..0f02304d9e 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxScreen.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxScreen.tsx @@ -1,6 +1,6 @@ import {useSwap} from '@yoroi/swap' import React from 'react' -import {StyleSheet, View, ViewProps} from 'react-native' +import {InteractionManager, StyleSheet, View, ViewProps} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' import {Button, Spacer} from '../../../../components' @@ -59,8 +59,6 @@ export const ConfirmTxScreen = () => { pool_source: orderData.selectedPoolCalculation.pool.provider, swap_fees: Number(orderData.selectedPoolCalculation.cost.batcherFee), }) - - navigate.submittedTx() }, onError: () => { navigate.failedTx() @@ -93,9 +91,11 @@ export const ConfirmTxScreen = () => { { + onSuccess={(signedTx) => { closeModal() - navigate.submittedTx() + InteractionManager.runAfterInteractions(() => { + navigate.submittedTx(signedTx.signedTx.id) + }) }} onCancel={closeModal} /> diff --git a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxWithHW.tsx b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxWithHW.tsx index 79f4d78462..c84e043e71 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxWithHW.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxWithHW.tsx @@ -6,7 +6,7 @@ import {LedgerConnect} from '../../../../HW' import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' import {useSignWithHwAndSubmitTx} from '../../../../yoroi-wallets/hooks' import {DeviceId, DeviceObj, withBLE, withUSB} from '../../../../yoroi-wallets/hw' -import {YoroiUnsignedTx} from '../../../../yoroi-wallets/types' +import {YoroiSignedTx, YoroiUnsignedTx} from '../../../../yoroi-wallets/types' import {walletManager} from '../../../../yoroi-wallets/walletManager' import {useStrings} from '../../common/strings' import {LedgerTransportSwitch} from './LedgerTransportSwitch' @@ -15,7 +15,7 @@ type Props = { wallet: YoroiWallet unsignedTx: YoroiUnsignedTx onCancel?: () => void - onSuccess: () => void + onSuccess: (signedTx: YoroiSignedTx) => void } type TransportType = 'USB' | 'BLE' diff --git a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxWithPassword.tsx b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxWithPassword.tsx index 334d26507a..f2f3c13f38 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxWithPassword.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTxWithPassword.tsx @@ -3,7 +3,7 @@ import React from 'react' import {WrongPassword} from '../../../../yoroi-wallets/cardano/errors' import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' import {useSignWithPasswordAndSubmitTx} from '../../../../yoroi-wallets/hooks' -import {YoroiUnsignedTx} from '../../../../yoroi-wallets/types' +import {YoroiSignedTx, YoroiUnsignedTx} from '../../../../yoroi-wallets/types' import {ConfirmWithSpendingPassword} from '../../common/ConfirmWithSpendingPassword' import {ErrorData} from '../../common/ConfirmWithSpendingPassword/ConfirmWithSpendingPassword' import {useStrings} from '../../common/strings' @@ -11,7 +11,7 @@ import {useStrings} from '../../common/strings' type Props = { wallet: YoroiWallet unsignedTx: YoroiUnsignedTx - onSuccess: () => void + onSuccess: (signedTx: YoroiSignedTx) => void onCancel?: () => void } @@ -21,10 +21,18 @@ export const ConfirmTxWithPassword = ({wallet, onSuccess, unsignedTx}: Props) => errorLogs: '', }) const strings = useStrings() + const signedTxRef = React.useRef(undefined) const {signAndSubmitTx, isLoading} = useSignWithPasswordAndSubmitTx( {wallet}, // - {submitTx: {onSuccess}}, + { + submitTx: {onSuccess: () => signedTxRef.current && onSuccess(signedTxRef.current)}, + signTx: { + onSuccess: (signedTx) => { + signedTxRef.current = signedTx + }, + }, + }, ) const showError = ({errorMessage, errorLogs}: ErrorData) => { diff --git a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ShowSubmittedTxScreen/ShowSubmittedTxScreen.tsx b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ShowSubmittedTxScreen/ShowSubmittedTxScreen.tsx index abbfd266b2..985fce3f52 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ShowSubmittedTxScreen/ShowSubmittedTxScreen.tsx +++ b/apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ShowSubmittedTxScreen/ShowSubmittedTxScreen.tsx @@ -1,17 +1,33 @@ +import {createTypeGuardFromSchema, isString} from '@yoroi/common' import React from 'react' -import {StyleSheet, View} from 'react-native' +import {Linking, StyleSheet, View} from 'react-native' +import {z} from 'zod' import {Button, Spacer, Text} from '../../../../../components' -import {useBlockGoBack} from '../../../../../navigation' +import {useBlockGoBack, useUnsafeParams} from '../../../../../navigation' +import {useSelectedWallet} from '../../../../../SelectedWallet' import {COLORS} from '../../../../../theme' +import {getNetworkConfigById} from '../../../../../yoroi-wallets/cardano/networks' import {useNavigateTo} from '../../../common/navigation' import {useStrings} from '../../../common/strings' import {SubmittedTxImage} from './SubmittedTxImage' +const schema = z.object({txId: z.string()}) +const isParams = createTypeGuardFromSchema(schema) + export const ShowSubmittedTxScreen = () => { useBlockGoBack() const strings = useStrings() const navigate = useNavigateTo() + const wallet = useSelectedWallet() + + const unsafeParams = useUnsafeParams() + const params = isParams(unsafeParams) ? unsafeParams : null + + const navigateToExplorer = () => { + const txId = params?.txId ?? '' + Linking.openURL(getNetworkConfigById(wallet.networkId).EXPLORER_URL_FOR_TX(txId)) + } return ( @@ -21,14 +37,38 @@ export const ShowSubmittedTxScreen = () => { {strings.transactionDisplay} - + + + {isString(params?.txId) && ( +