From ae2e75e06cf08e0005c04b90c6b41c5767bb9e0a Mon Sep 17 00:00:00 2001 From: devj-arch Date: Sun, 17 Nov 2024 18:00:02 +0530 Subject: [PATCH 1/2] Update AppBar.jsx --- client/src/components/AppBar.jsx | 83 +++++++++++++++----------------- 1 file changed, 39 insertions(+), 44 deletions(-) diff --git a/client/src/components/AppBar.jsx b/client/src/components/AppBar.jsx index 76134ac..f77cba4 100644 --- a/client/src/components/AppBar.jsx +++ b/client/src/components/AppBar.jsx @@ -1,52 +1,47 @@ -import AppBar from '@mui/material/AppBar'; -import Box from '@mui/material/Box'; -import Toolbar from '@mui/material/Toolbar'; -import Typography from '@mui/material/Typography'; -import Button from '@mui/material/Button'; -import { Link } from 'react-router-dom'; -import { useDispatch, useSelector } from 'react-redux'; -import { setMessage } from '../reducers/messageReducer'; +import { ArgumentScale, Animation } from '@devexpress/dx-react-chart'; +import { scaleBand } from '@devexpress/dx-chart-core'; -const linkStyle = { - textDecoration: 'none', - color: 'white', - cursor: 'pointer' -} +import Paper from '@mui/material/Paper'; +import { + Chart, + BarSeries, + ArgumentAxis, + ValueAxis, + Tooltip, +} from '@devexpress/dx-react-chart-material-ui'; +import { EventTracker } from '@devexpress/dx-react-chart'; +import { Typography } from '@mui/material'; -export default function ButtonAppBar() { - const user = useSelector(state => state.auth.user) - const dispatch = useDispatch() +const TransactionChart = ({chartData}) => { - const logout = () => { - localStorage.removeItem('expenseTrackerToken') - dispatch(setMessage(['User logged out', true])) - setTimeout(() => dispatch(setMessage(null)), 5000) + if(!chartData.length>0){ + return( + + Add a transaction to view chart + + ) } - return ( - - - - - - Expense Tracker - + return ( + //changed width from 80% to 100% + + - {user && - <> - - - - } + + + - {!user && - <> - - - - } - - - - ); + + + + + + + ); } +export default TransactionChart From 228ba5fe210816d7920de26b8dc29a971071fd24 Mon Sep 17 00:00:00 2001 From: devj-arch Date: Sun, 17 Nov 2024 18:00:33 +0530 Subject: [PATCH 2/2] Update TransactionChart.jsx --- client/src/components/TransactionChart.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/components/TransactionChart.jsx b/client/src/components/TransactionChart.jsx index 6166305..f77cba4 100644 --- a/client/src/components/TransactionChart.jsx +++ b/client/src/components/TransactionChart.jsx @@ -18,12 +18,13 @@ const TransactionChart = ({chartData}) => { return( Add a transaction to view chart - + ) } return ( - + //changed width from 80% to 100% +