From b244d53b1d2b7dbb33b5cd60587784c35672c67d Mon Sep 17 00:00:00 2001 From: OlhaD Date: Mon, 17 Jul 2023 21:43:03 -0400 Subject: [PATCH 1/3] Update mocked data --- src/pages/Wallet/Wallet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Wallet/Wallet.js b/src/pages/Wallet/Wallet.js index 26dfdf1..cbd9bf2 100644 --- a/src/pages/Wallet/Wallet.js +++ b/src/pages/Wallet/Wallet.js @@ -33,7 +33,7 @@ const Wallet = () => { // TODO: get wallet id by decoding the token. We get the token after login, which is not implemented yet. apiClient - .get("/wallets/e63bde5b-49b0-431a-91c7-33f257206fb4") + .get("/wallets/644f4d3b-a53c-457c-8677-42b5b812c23d") .then((response) => { const wallet = mapWallet(response.data); setWallet(wallet); From 4f54c61bff39ef688011f057a12b77f0129c3741 Mon Sep 17 00:00:00 2001 From: Olha Zakharova Date: Mon, 17 Jul 2023 22:08:58 -0400 Subject: [PATCH 2/3] Auto stash before merge of "37-copy" and "v1" --- src/components/Routes/ClientRoutes.js | 24 ++++----- .../layout/Menu/MenuItem/MenuItem.js | 54 ++++++++++++++----- src/pages/MyTransfers/MyTransfers.js | 7 +++ src/pages/SendTokens/SendTokens.js | 26 +++++---- src/pages/TransferStatus/TransferStatus.js | 7 --- 5 files changed, 75 insertions(+), 43 deletions(-) create mode 100644 src/pages/MyTransfers/MyTransfers.js delete mode 100644 src/pages/TransferStatus/TransferStatus.js diff --git a/src/components/Routes/ClientRoutes.js b/src/components/Routes/ClientRoutes.js index d1d2c58..74142eb 100644 --- a/src/components/Routes/ClientRoutes.js +++ b/src/components/Routes/ClientRoutes.js @@ -1,14 +1,14 @@ -import { Routes, Route, Navigate, Outlet } from "react-router-dom"; -import Wallet from "../../pages/Wallet/Wallet"; -import TransferStatus from "../../pages/TransferStatus/TransferStatus"; -import Login from "../../pages/Login/Login"; -import Layout from "../layout/Layout"; -import AuthContext from "../../store/auth-context"; -import SendTokens from "../../pages/SendTokens/SendTokens"; -import NotFound from "../../pages/NotFound/NotFound"; -import { useContext } from "react"; +import { Routes, Route, Navigate, Outlet } from 'react-router-dom'; +import Wallet from '../../pages/Wallet/Wallet'; +import Login from '../../pages/Login/Login'; +import Layout from '../layout/Layout'; +import AuthContext from '../../store/auth-context'; +import SendTokens from '../../pages/SendTokens/SendTokens'; +import NotFound from '../../pages/NotFound/NotFound'; +import { useContext } from 'react'; +import MyTransfers from '../../pages/MyTransfers/MyTransfers'; -const ProtectedRoute = ({ isLoggedIn, redirectPath = "/login" }) => { +const ProtectedRoute = ({ isLoggedIn, redirectPath = '/login' }) => { if (!isLoggedIn) { return ; } @@ -32,11 +32,11 @@ const ClientRoutes = () => { } /> - + } /> diff --git a/src/components/layout/Menu/MenuItem/MenuItem.js b/src/components/layout/Menu/MenuItem/MenuItem.js index 4b0302b..27e9fa7 100644 --- a/src/components/layout/Menu/MenuItem/MenuItem.js +++ b/src/components/layout/Menu/MenuItem/MenuItem.js @@ -1,24 +1,50 @@ +import CompareIcon from '@mui/icons-material/Compare'; import HomeIcon from '@mui/icons-material/Home'; import ThumbsUpDownIcon from '@mui/icons-material/ThumbsUpDown'; +import ListItemText from '@mui/material/ListItemText'; import * as React from 'react'; -// import { Compare } from '@mui/icons-material'; -import LinkItem from './LinkItem'; +import { + ItemButtonStyled, + ItemIconStyled, + LinkItemStyled, +} from './MenuItemStyled'; const MenuItem = ({ open }) => { return ( <> - } - open={open} /> - } - open={open} /> - {/*}*/} - {/* open={open} />*/} + + + + + + + + + + + + + + + + + + + + + + + + ); }; diff --git a/src/pages/MyTransfers/MyTransfers.js b/src/pages/MyTransfers/MyTransfers.js new file mode 100644 index 0000000..07e1ff9 --- /dev/null +++ b/src/pages/MyTransfers/MyTransfers.js @@ -0,0 +1,7 @@ +import React from 'react'; + +const MyTransfers = () => { + return
My Transfers
; +}; + +export default MyTransfers; diff --git a/src/pages/SendTokens/SendTokens.js b/src/pages/SendTokens/SendTokens.js index e82872d..7c4cc0b 100644 --- a/src/pages/SendTokens/SendTokens.js +++ b/src/pages/SendTokens/SendTokens.js @@ -6,12 +6,10 @@ import ErrorMessage from '../../components/UI/components/ErrorMessage/ErrorMessa import InfoCircle from './InfoCircle'; const SendTokens = () => { - const [walletList, setWalletList] = useState({}); const [errorMessage, setErrorMessage] = useState(null); const [isLoading, setIsLoading] = useState(true); - //when the page is first rendered useEffect(() => { const loadWallets = async () => { @@ -31,16 +29,21 @@ const SendTokens = () => { if (isLoading) return ; - const defaultWallet = walletList.length > 0 ? walletList[0] : { - id: '', - logo_url: '', - tokens_in_wallet: 0, - name: '', - }; + const defaultWallet = + walletList.length > 0 + ? walletList[0] + : { + id: '', + logo_url: '', + tokens_in_wallet: 0, + name: '', + }; return ( -
Send Tokens
+
+ Send Tokens +
{errorMessage && ( { )}
- +
diff --git a/src/pages/TransferStatus/TransferStatus.js b/src/pages/TransferStatus/TransferStatus.js deleted file mode 100644 index 6b9f1a6..0000000 --- a/src/pages/TransferStatus/TransferStatus.js +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; - -const TransferStatus = () => { - return
Transfer Status
; -}; - -export default TransferStatus; From 2293aaa37a72fefb51c23397fe3c2a1630aab111 Mon Sep 17 00:00:00 2001 From: Olha Zakharova Date: Mon, 17 Jul 2023 22:15:47 -0400 Subject: [PATCH 3/3] revert MenuItem --- .../layout/Menu/MenuItem/MenuItem.js | 58 ++++++------------- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/src/components/layout/Menu/MenuItem/MenuItem.js b/src/components/layout/Menu/MenuItem/MenuItem.js index 27e9fa7..16abf4c 100644 --- a/src/components/layout/Menu/MenuItem/MenuItem.js +++ b/src/components/layout/Menu/MenuItem/MenuItem.js @@ -1,50 +1,30 @@ import CompareIcon from '@mui/icons-material/Compare'; import HomeIcon from '@mui/icons-material/Home'; import ThumbsUpDownIcon from '@mui/icons-material/ThumbsUpDown'; -import ListItemText from '@mui/material/ListItemText'; import * as React from 'react'; -import { - ItemButtonStyled, - ItemIconStyled, - LinkItemStyled, -} from './MenuItemStyled'; +import LinkItem from './LinkItem'; const MenuItem = ({ open }) => { return ( <> - - - - - - - - - - - - - - - - - - - - - - - - + } + open={open} + /> + } + open={open} + /> + } + open={open} + /> ); };