diff --git a/src/components/BMDashboard/WeeklyProjectSummary/Financials/CostVarianceTrendGraph.module.css b/src/components/BMDashboard/WeeklyProjectSummary/Financials/CostVarianceTrendGraph.module.css index d7f4d28260..71549877bb 100644 --- a/src/components/BMDashboard/WeeklyProjectSummary/Financials/CostVarianceTrendGraph.module.css +++ b/src/components/BMDashboard/WeeklyProjectSummary/Financials/CostVarianceTrendGraph.module.css @@ -35,7 +35,7 @@ width: 100%; } -@media (max-width: 900px) { +@media (width <= 900px) { .filtersGrid { grid-template-columns: 1fr; } @@ -91,9 +91,9 @@ } .darkDateInput { - background-color: #253342; - color: #fff; - border-color: #2d4059; + background-color: #253342 !important; + color: #fff !important; + border-color: #2d4059 !important; color-scheme: dark; } @@ -174,7 +174,7 @@ } .varianceOverLight { color: #e74c3c !important; } -.varianceOverDark { color: #ff4444 !important; } +.varianceOverDark { color: #f44 !important; } .varianceUnderLight { color: #2ecc71 !important; } .varianceUnderDark { color: #4ade80 !important; } \ No newline at end of file diff --git a/src/components/BMDashboard/WeeklyProjectSummary/GroupedBarGraphInjurySeverity/InjuryCategoryBarChart.jsx b/src/components/BMDashboard/WeeklyProjectSummary/GroupedBarGraphInjurySeverity/InjuryCategoryBarChart.jsx index 6424d238e1..e8fc468a91 100644 --- a/src/components/BMDashboard/WeeklyProjectSummary/GroupedBarGraphInjurySeverity/InjuryCategoryBarChart.jsx +++ b/src/components/BMDashboard/WeeklyProjectSummary/GroupedBarGraphInjurySeverity/InjuryCategoryBarChart.jsx @@ -13,6 +13,7 @@ import Select from 'react-select'; import DatePicker from 'react-datepicker'; import 'react-datepicker/dist/react-datepicker.css'; import styles from './InjuryCategoryBarChart.module.css'; +import { buildChartSelectStyles } from '../sharedSelectStyles'; import { useDispatch, useSelector } from 'react-redux'; import { fetchInjuryData, @@ -48,7 +49,6 @@ function InjuryCategoryBarChart() { const [startDate, setStartDate] = useState(null); const [endDate, setEndDate] = useState(null); - // ✅ NEW: key to force Recharts remount when needed (fixes "renders only on hover") const [chartKey, setChartKey] = useState(0); useEffect(() => { @@ -168,35 +168,7 @@ function InjuryCategoryBarChart() { endDate, ]); - const selectStyles = darkMode && { - control: base => ({ - ...base, - backgroundColor: '#2b3e59', - color: 'white', - }), - menu: base => ({ - ...base, - backgroundColor: '#2b3e59', - color: 'white', - }), - option: (base, state) => ({ - ...base, - color: 'white', - backgroundColor: state.isSelected - ? 'rgba(255, 255, 255, 0.15)' - : state.isFocused - ? 'rgba(255, 255, 255, 0.1)' - : 'transparent', - '&:active': { - backgroundColor: 'rgba(255, 255, 255, 0.2)', - }, - }), - singleValue: base => ({ - ...base, - color: 'white', - }), - }; - // : {}; + const selectStyles = buildChartSelectStyles(darkMode); return (
diff --git a/src/components/BMDashboard/WeeklyProjectSummary/IssuesBreakdownChart.jsx b/src/components/BMDashboard/WeeklyProjectSummary/IssuesBreakdownChart.jsx index 336e038c03..e41514ea0d 100644 --- a/src/components/BMDashboard/WeeklyProjectSummary/IssuesBreakdownChart.jsx +++ b/src/components/BMDashboard/WeeklyProjectSummary/IssuesBreakdownChart.jsx @@ -572,6 +572,7 @@ export default function IssuesBreakdownChart() { { const today = new Date(); @@ -72,12 +73,13 @@ const SupplierPerformanceDashboard = function({ height = 420, onDataLoaded }) { const chartTheme = { textColor: darkMode ? '#e0e0e0' : '#333', axisColor: darkMode ? '#a0a0a0' : '#666', - // UPDATE: Set a lighter grey for dark mode so grid lines are clearly visible gridColor: darkMode ? '#9CA3AF' : '#E2E8F0', barColor: '#4CAF50', labelFill: darkMode ? '#ffffff' : '#333', }; + const selectStyles = buildChartSelectStyles(darkMode); + useEffect(() => { const loadProjects = async () => { try { @@ -124,6 +126,18 @@ const SupplierPerformanceDashboard = function({ height = 420, onDataLoaded }) { fetchData(); }, [dispatch, selectedDateRange, selectedProject, onDataLoaded]); + // Build react-select options + const dateOptions = getDateRangeOptions().map(opt => ({ value: opt.value, label: opt.label })); + const selectedDateOption = + dateOptions.find(opt => opt.value === selectedDateRange) || dateOptions[0]; + + const projectOptions = [ + { value: 'all', label: 'ALL Projects' }, + ...projects.map(p => ({ value: p._id, label: p._id })), + ]; + const selectedProjectOption = + projectOptions.find(opt => opt.value === selectedProject) || projectOptions[0]; + return (
- - setSelectedDateRange(e.target.value)} - className={styles['supplier-performance-select']} - > - {getDateRangeOptions().map(option => ( - - ))} - + + Dates + + setSelectedProject(e.target.value)} - className={styles['supplier-performance-select']} - > - - {projects.map(project => ( - - ))} - + + Project + +