From 673761fd0b75bac2ffb6fcb22f30db94873921d4 Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Mon, 3 Jul 2023 20:48:57 +0500 Subject: [PATCH 01/37] added bare bone structure for trade screen --- src/constants/routeNames.js | 1 + src/navigation/stackNavigator.tsx | 2 ++ src/screens/index.js | 2 ++ src/screens/trade/children/index.ts | 1 + src/screens/trade/children/swapInput.tsx | 32 +++++++++++++++++ src/screens/trade/index.ts | 3 ++ src/screens/trade/screen/tradeScreen.tsx | 36 +++++++++++++++++++ .../trade/styles/tradeScreen.styles.ts | 7 ++++ src/screens/transfer/index.js | 1 + 9 files changed, 85 insertions(+) create mode 100644 src/screens/trade/children/index.ts create mode 100644 src/screens/trade/children/swapInput.tsx create mode 100644 src/screens/trade/index.ts create mode 100644 src/screens/trade/screen/tradeScreen.tsx create mode 100644 src/screens/trade/styles/tradeScreen.styles.ts diff --git a/src/constants/routeNames.js b/src/constants/routeNames.js index a2cb3be46..68db7dad1 100644 --- a/src/constants/routeNames.js +++ b/src/constants/routeNames.js @@ -38,6 +38,7 @@ const ROUTES = { EDIT_HISTORY: `EditHistory${SCREEN_SUFFIX}`, WELCOME: `Welcome${SCREEN_SUFFIX}`, BACKUP_KEYS: `BackupKeys${SCREEN_SUFFIX}`, + TRADE: `Trade${SCREEN_SUFFIX}`, }, MODALS: { ASSETS_SELECT: `AssetsSelect${MODAL_SUFFIX}`, diff --git a/src/navigation/stackNavigator.tsx b/src/navigation/stackNavigator.tsx index 47b915313..327f2f81d 100644 --- a/src/navigation/stackNavigator.tsx +++ b/src/navigation/stackNavigator.tsx @@ -22,6 +22,7 @@ import { Settings, SpinGame, Transfer, + TradeScreen, Voters, AccountBoost, TagResult, @@ -67,6 +68,7 @@ const MainStackNavigator = () => { + void; + value: string; + fiatValue: number; + symbol: string; + } + + + +// Reusable component for label, text input, and bottom text +export const SwapInput = ({ label, onChangeText, value, fiatValue, symbol } : SwapInputProps) => { + return ( + + {label} + + {fiatValue} + + ); + }; \ No newline at end of file diff --git a/src/screens/trade/index.ts b/src/screens/trade/index.ts new file mode 100644 index 000000000..fb5e87086 --- /dev/null +++ b/src/screens/trade/index.ts @@ -0,0 +1,3 @@ +import TradeScreen from './screen/tradeScreen'; + +export default TradeScreen; diff --git a/src/screens/trade/screen/tradeScreen.tsx b/src/screens/trade/screen/tradeScreen.tsx new file mode 100644 index 000000000..1d33fa1ed --- /dev/null +++ b/src/screens/trade/screen/tradeScreen.tsx @@ -0,0 +1,36 @@ +import React, { useState } from 'react'; +import { View, Button } from 'react-native'; +import styles from '../styles/tradeScreen.styles'; +import { SwapInput } from '../children'; + + +const TradeScreen = () => { + const [textValue, setTextValue] = useState(''); + + const handleTextChange = (text) => { + setTextValue(text); + }; + + const handleContinue = () => { + // Handle the continue button press + console.log('Continue button pressed'); + }; + + return ( + + + +