grid fixes

This commit is contained in:
2026-04-04 22:30:30 +05:30
parent 214c0be44e
commit 6abed4e72a

View File

@@ -3,7 +3,6 @@ import {
Box, Box,
Container, Container,
Grid, Grid,
Typography,
CircularProgress, CircularProgress,
Alert, Alert,
ToggleButton, ToggleButton,
@@ -11,7 +10,6 @@ import {
} from "@mui/material"; } from "@mui/material";
import LatestItemsList, { LatestItem } from "./components/LatestItemsList"; import LatestItemsList, { LatestItem } from "./components/LatestItemsList";
import ProgressCard from "./components/ProgressCard";
import HistoryChart from "./components/HistoryChart"; import HistoryChart from "./components/HistoryChart";
import { import {
@@ -76,10 +74,8 @@ export default function Dashboard() {
); );
} }
const themes = ["primary", "secondary", "info", "success", "warning"] as const;
return ( return (
<Container maxWidth="xl" sx={{ mt: 4, mb: 4 }}> <Container sx={{ mt: 4, mb: 4 }}>
{/* -------- TOGGLE -------- */} {/* -------- TOGGLE -------- */}
<Box sx={{ display: "flex", justifyContent: "center", mb: 3 }}> <Box sx={{ display: "flex", justifyContent: "center", mb: 3 }}>
<ToggleButtonGroup <ToggleButtonGroup
@@ -92,9 +88,9 @@ export default function Dashboard() {
</ToggleButtonGroup> </ToggleButtonGroup>
</Box> </Box>
<Grid container spacing={4}> <Grid container spacing={4} direction="row">
{/* Column 1 */} {/* LEFT → 1/3 (4 cols) */}
<Grid item xs={12} md={4}> <Grid size={4}>
<LatestItemsList <LatestItemsList
title="Recent Transactions" title="Recent Transactions"
items={latest} items={latest}
@@ -102,8 +98,8 @@ export default function Dashboard() {
/> />
</Grid> </Grid>
{/* Column 2 */} {/* RIGHT → 2/3 (8 cols) */}
<Grid item xs={12} md={8}> <Grid size={8}>
<HistoryChart <HistoryChart
header={`${mode === "expense" ? "Expense" : "Income"} Breakdown`} header={`${mode === "expense" ? "Expense" : "Income"} Breakdown`}
summary="Interactive chronological tracking" summary="Interactive chronological tracking"
@@ -111,7 +107,6 @@ export default function Dashboard() {
data={aggregated?.chartData || {}} data={aggregated?.chartData || {}}
/> />
</Grid> </Grid>
</Grid> </Grid>
</Container> </Container>
); );