From d3acf13c0aff02c251b6f7659fedea62d31abcb7 Mon Sep 17 00:00:00 2001 From: "pramod.mahajan" Date: Thu, 30 Oct 2025 10:50:45 +0530 Subject: [PATCH] fixed card size for dashboard cards --- public/assets/css/core-extend.css | 33 +++++ .../Dashboard/AttendanceOverview.jsx | 136 ++++++++++++------ src/components/Dashboard/Dashboard.jsx | 2 +- src/components/Dashboard/ExpenseAnalysis.jsx | 6 +- src/components/Dashboard/ExpenseByProject.jsx | 33 ++--- src/components/Dashboard/ExpenseStatus.jsx | 2 +- 6 files changed, 149 insertions(+), 63 deletions(-) diff --git a/public/assets/css/core-extend.css b/public/assets/css/core-extend.css index 5b328e9b..e8854007 100644 --- a/public/assets/css/core-extend.css +++ b/public/assets/css/core-extend.css @@ -94,3 +94,36 @@ .h-screen{ height: 100vh; } .h-min { height: min-content; } .h-max { height: max-content; } + + +/* ------------------------Text------------------------- */ +@media (min-width: 576px) { + .fs-sm-1 { font-size: calc(1.3rem + 1.6vw) !important; } + .fs-sm-2 { font-size: calc(1.2rem + 1.2vw) !important; } + .fs-sm-3 { font-size: calc(1.1rem + 0.8vw) !important; } + .fs-sm-4 { font-size: calc(1rem + 0.5vw) !important; } + .fs-sm-5 { font-size: 1.05rem !important; } + .fs-sm-6 { font-size: 0.9rem !important; } + + .fs-sm-tiny { font-size: 72% !important; } + .fs-sm-big { font-size: 115% !important; } + .fs-sm-large { font-size: 155% !important; } + .fs-sm-xlarge { font-size: 175% !important; } + .fs-sm-xxlarge { font-size: calc(1.6rem + 3.5vw) !important; } +} + +/* 💻 Medium devices (≥768px) */ +@media (min-width: 768px) { + .fs-md-1 { font-size: calc(1.4125rem + 1.95vw) !important; } + .fs-md-2 { font-size: calc(1.3625rem + 1.35vw) !important; } + .fs-md-3 { font-size: calc(1.3rem + 0.6vw) !important; } + .fs-md-4 { font-size: calc(1.275rem + 0.3vw) !important; } + .fs-md-5 { font-size: 1.125rem !important; } + .fs-md-6 { font-size: 0.9375rem !important; } + + .fs-md-tiny { font-size: 70% !important; } + .fs-md-big { font-size: 112% !important; } + .fs-md-large { font-size: 150% !important; } + .fs-md-xlarge { font-size: 170% !important; } + .fs-md-xxlarge { font-size: calc(1.725rem + 5.7vw) !important; } +} \ No newline at end of file diff --git a/src/components/Dashboard/AttendanceOverview.jsx b/src/components/Dashboard/AttendanceOverview.jsx index 06b5220b..522aa193 100644 --- a/src/components/Dashboard/AttendanceOverview.jsx +++ b/src/components/Dashboard/AttendanceOverview.jsx @@ -7,17 +7,17 @@ import ChartSkeleton from "../Charts/Skelton"; import { useSelectedProject } from "../../slices/apiDataManager"; import { formatDate_DayMonth } from "../../utils/dateUtils"; - - const AttendanceOverview = () => { const [dayRange, setDayRange] = useState(7); const [view, setView] = useState("chart"); const selectedProject = useSelectedProject(); - const { data: attendanceOverviewData, isLoading, isError, error } = useAttendanceOverviewData( - selectedProject, - dayRange - ); + const { + data: attendanceOverviewData, + isLoading, + isError, + error, + } = useAttendanceOverviewData(selectedProject, dayRange); // Use empty array while loading const attendanceData = attendanceOverviewData || []; @@ -55,73 +55,129 @@ const AttendanceOverview = () => { })); const chartOptions = { - chart: { type: "bar", stacked: true, height: 400, toolbar: { show: false } }, + chart: { + type: "bar", + stacked: true, + height: 400, + toolbar: { show: false }, + }, plotOptions: { bar: { borderRadius: 2, columnWidth: "60%" } }, xaxis: { categories: tableData.map((row) => row.date) }, - yaxis: { show: true, axisBorder: { show: true, color: "#78909C" }, axisTicks: { show: true, color: "#78909C", width: 6 } }, + yaxis: { + show: true, + axisBorder: { show: true, color: "#78909C" }, + axisTicks: { show: true, color: "#78909C", width: 6 }, + }, legend: { position: "bottom" }, fill: { opacity: 1 }, colors: roles.map((_, i) => flatColors[i % flatColors.length]), }; return ( -
- {/* Optional subtle loading overlay */} - {isLoading && ( -
- Loading... +
+
+
+

Attendance Overview

+

+ Role-wise present count +

- )} - {/* Header */} -
-
-
Attendance Overview
-

Role-wise present count

-
-
- setDayRange(Number(e.target.value))} + > - - + +
+ + + +
- {/* Content */} -
+ {/* Content Section */} +
+ {isLoading && ( +
+ Loading... +
+ )} + {!isLoading && (!attendanceData || attendanceData.length === 0) ? (
No data found
+ style={{ minHeight: "250px" }} + > + No data found +
) : view === "chart" ? (
- +
) : ( -
- - +
+
+ - + {dates.map((date, idx) => ( - + ))} + {roles.map((role) => ( - + {tableData.map((row, idx) => { const value = row[role]; - return ; + return ( + + ); })} ))} @@ -134,4 +190,4 @@ const AttendanceOverview = () => { ); }; -export default AttendanceOverview; \ No newline at end of file +export default AttendanceOverview; diff --git a/src/components/Dashboard/Dashboard.jsx b/src/components/Dashboard/Dashboard.jsx index 64737ebb..36cc6252 100644 --- a/src/components/Dashboard/Dashboard.jsx +++ b/src/components/Dashboard/Dashboard.jsx @@ -45,7 +45,7 @@ const Dashboard = () => { -
+
{!isAllProjectsSelected && (
diff --git a/src/components/Dashboard/ExpenseAnalysis.jsx b/src/components/Dashboard/ExpenseAnalysis.jsx index 3312abdf..6bea4db3 100644 --- a/src/components/Dashboard/ExpenseAnalysis.jsx +++ b/src/components/Dashboard/ExpenseAnalysis.jsx @@ -87,18 +87,18 @@ const ExpenseAnalysis = () => { {/* Header */}
-

Expense Breakdown

+

Expense Breakdown

Category Wise Expense Breakdown

-
+
- {/* Card body */} +
{isLoading && (
{ }, ]; + + const ExpenseCategoryType = [ + {id:1,category:"Category",label:"Category"}, + {id:2,category:"Project",label:"Project"} + ] + return (
{/* Header */}
-
-
-
Monthly Expense -
+
+
+

Monthly Expense -

Detailed project expenses

@@ -85,29 +91,20 @@ const ExpenseByProject = () => { > {viewMode} -
    -
  • +
      + {ExpenseCategoryType.map((cat)=>( +
    • -
    • -
    • -
    • + ))}
diff --git a/src/components/Dashboard/ExpenseStatus.jsx b/src/components/Dashboard/ExpenseStatus.jsx index 82e49e9c..7e0442fe 100644 --- a/src/components/Dashboard/ExpenseStatus.jsx +++ b/src/components/Dashboard/ExpenseStatus.jsx @@ -36,7 +36,7 @@ const ExpenseStatus = () => { <>
-
Expense - By Status
+

Expense - By Status

{projectName}

RoleRole{date} + {date} +
{role}{role} 0 ? { backgroundColor: "#d5d5d5" } : {}}>{value} 0 ? { backgroundColor: "#e9ecef" } : {} + } + > + {value} +