diff --git a/cysync/src/constants/routes.ts b/cysync/src/constants/routes.ts index ead25673..bd09d0d6 100644 --- a/cysync/src/constants/routes.ts +++ b/cysync/src/constants/routes.ts @@ -26,6 +26,9 @@ const routes = { }, tutorial: { index: '/tutorial' + }, + swap: { + index: '/swap' } }; diff --git a/cysync/src/designSystem/iconGroups/changelly.tsx b/cysync/src/designSystem/iconGroups/changelly.tsx new file mode 100644 index 00000000..1a665c4d --- /dev/null +++ b/cysync/src/designSystem/iconGroups/changelly.tsx @@ -0,0 +1,19 @@ +import * as React from 'react'; +import { SVGProps } from 'react'; + +const Changelly = (props: SVGProps) => ( + + + +); + +export default Changelly; diff --git a/cysync/src/designSystem/iconGroups/checkmarkSuccess.tsx b/cysync/src/designSystem/iconGroups/checkmarkSuccess.tsx new file mode 100644 index 00000000..f7698e5d --- /dev/null +++ b/cysync/src/designSystem/iconGroups/checkmarkSuccess.tsx @@ -0,0 +1,13 @@ +import * as React from 'react'; + +const checkmarkSuccess = () => ( + + + + +); + +export default checkmarkSuccess; diff --git a/cysync/src/designSystem/iconGroups/download.tsx b/cysync/src/designSystem/iconGroups/download.tsx new file mode 100644 index 00000000..faf8f6a6 --- /dev/null +++ b/cysync/src/designSystem/iconGroups/download.tsx @@ -0,0 +1,22 @@ +import * as React from 'react'; +import { SVGProps } from 'react'; + +const Download = (props: SVGProps) => ( + + + +); + +export default Download; diff --git a/cysync/src/designSystem/iconGroups/swap.tsx b/cysync/src/designSystem/iconGroups/swap.tsx new file mode 100644 index 00000000..22f0a492 --- /dev/null +++ b/cysync/src/designSystem/iconGroups/swap.tsx @@ -0,0 +1,14 @@ +import React from 'react'; + +const swap = (props: { color: string }) => { + return ( + + + + ); +}; + +export default swap; diff --git a/cysync/src/errors/helpers.ts b/cysync/src/errors/helpers.ts index f8bad5b1..c7a69f04 100644 --- a/cysync/src/errors/helpers.ts +++ b/cysync/src/errors/helpers.ts @@ -129,6 +129,10 @@ const handleWalletErrors = ( export const getMap = (langStrings: I18nStrings): CodeToErrorMap => { return { + [CysyncError.SWAP_TXN_UNKNOWN_ERROR]: { + parent: CysyncError.SWAP_TXN_UNKNOWN_ERROR, + message: 'Swap Transaction Unknown Error' + }, [DeviceErrorType.CONNECTION_CLOSED]: { parent: DeviceErrorType.DEVICE_DISCONNECTED_IN_FLOW, message: 'Device connection closed' diff --git a/cysync/src/errors/types.ts b/cysync/src/errors/types.ts index b2a74118..774662ed 100644 --- a/cysync/src/errors/types.ts +++ b/cysync/src/errors/types.ts @@ -68,6 +68,8 @@ export enum CysyncError { RECEIVE_TXN_CANCEL_FAILED = 'DS_OPTS_1507', RECEIVE_TXN_UNKNOWN_ERROR = 'DS_MISC_5502', + SWAP_TXN_UNKNOWN_ERROR = 'TODO_1234', // TODO: add error code + DEVICE_HAS_INITIAL_FIRMWARE = 'HD_INIT_2100', DEVICE_IN_BOOTLOADER = 'HD_INIT_2101', LAST_DEVICE_AUTH_FAILED = 'HD_INIT_2102', diff --git a/cysync/src/pages/mainApp/index.tsx b/cysync/src/pages/mainApp/index.tsx index 95df3fb7..761b1844 100644 --- a/cysync/src/pages/mainApp/index.tsx +++ b/cysync/src/pages/mainApp/index.tsx @@ -19,6 +19,7 @@ import WalletConnectPopup from './popups/walletConnect'; import Sidebar from './sidebar'; import Portfolio from './sidebar/portfolio'; import Settings from './sidebar/settings'; +import Swap from './sidebar/swap'; import Transaction from './sidebar/transaction'; import Tutorial from './sidebar/tutorial'; import Wallet from './sidebar/wallet'; @@ -144,6 +145,8 @@ const MainApp: React.FC = () => { element={} /> + } /> + } diff --git a/cysync/src/pages/mainApp/sidebar/index.tsx b/cysync/src/pages/mainApp/sidebar/index.tsx index 86616588..9987b3ef 100644 --- a/cysync/src/pages/mainApp/sidebar/index.tsx +++ b/cysync/src/pages/mainApp/sidebar/index.tsx @@ -25,6 +25,7 @@ import colors from '../../../designSystem/designConstants/colors'; import LastTransaction from '../../../designSystem/iconGroups/lastTransaction'; import Portfolio from '../../../designSystem/iconGroups/portfolio'; import Settings from '../../../designSystem/iconGroups/settings'; +import Swap from '../../../designSystem/iconGroups/swap'; import Tutorial from '../../../designSystem/iconGroups/tutorial'; import Wallet from '../../../designSystem/iconGroups/wallet'; import { useFeedback, useWallets } from '../../../store/provider'; @@ -184,6 +185,10 @@ const TabValues = [ tab: 2, route: Routes.wallet.index }, + { + tab: 10, // this is a dummy value for the Swap tab + route: Routes.swap.index //TODO: Update the route + }, { tab: 5, route: Routes.transactions.index @@ -259,7 +264,6 @@ const Sidebar = () => { const handleChange = (_event: React.ChangeEvent | undefined, val: number) => { setValue(val); const tab = TabValues.find(elem => elem.tab === val); - if (tab) { // If wallet tab is selected, route to the first wallet if (tab.tab === 2 && walletData && walletData.length > 0) { @@ -376,6 +380,19 @@ const Sidebar = () => { + } //TODO: Update the icon + /> + } + /> +