diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 1ef30e6..8fa2691 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -80,7 +80,7 @@ const Navbar: React.FC = () => { > setOpen(!open)} cursor="pointer" maxW="180px" /> - {'Logo + {'Logo {menu} diff --git a/src/pages/Dashboard/components/DoughnutGraph/index.tsx b/src/pages/Dashboard/components/DoughnutGraph/index.tsx index 3ac572a..4d1f79b 100644 --- a/src/pages/Dashboard/components/DoughnutGraph/index.tsx +++ b/src/pages/Dashboard/components/DoughnutGraph/index.tsx @@ -1,4 +1,4 @@ -import { Box, Center, HStack, Text, VStack } from '@chakra-ui/react'; +import { Box, Center, Flex, HStack, Text, VStack, useBreakpointValue } from '@chakra-ui/react'; import { Chart as ChartJS, ChartData, ArcElement, Tooltip, LabelItem } from 'chart.js'; import { Doughnut } from 'react-chartjs-2'; @@ -11,23 +11,17 @@ type Props = { label?: string; values: number[]; labels?: string[]; + direction?: 'row' | 'column'; }; const COLORS = ['#69D6C7', '#4C9AF7', '#6A5CE2', '#A2CF57', '#D96684']; -export const DoughnutGraph: React.FC = ({ showLegend, values, label, subTitle, title, labels }) => { +export const DoughnutGraph: React.FC = ({ showLegend, values, label, subTitle, title, labels, direction }) => { + const isMobile = useBreakpointValue({ base: true, md: false }); + return ( - - {showLegend && ( - - {labels?.map((item, index) => ( - - {item} - - ))} - - )} -
+ +
= ({ showLegend, values, label, subT )}
+ + {showLegend && ( + + {labels?.map((item, index) => ( + + {item} + + ))} + + )} + {label && ( {label} )} - +
); }; diff --git a/src/pages/Dashboard/components/SpeedometerGraph/index.tsx b/src/pages/Dashboard/components/SpeedometerGraph/index.tsx index 1e761b0..72231cc 100644 --- a/src/pages/Dashboard/components/SpeedometerGraph/index.tsx +++ b/src/pages/Dashboard/components/SpeedometerGraph/index.tsx @@ -22,8 +22,8 @@ export const SpeedometerGraph: React.FC = ({ maxValue, value, label }) => }; return ( - -
+ +
{ }; return ( - - + + - + @@ -76,74 +82,71 @@ const DashboardPage: React.FC = () => {
) : ( <> - - - - {t('dashboard.engagement.title')} - - - {t('dashboard.engagement.description')} - - - - - - - - - - - - - - - {t('dashboard.targeted-improvement-areas.title')} - - - {t('dashboard.targeted-improvement-areas.description')} - - + + + {t('dashboard.engagement.title')} + + + {t('dashboard.engagement.description')} + + + + + + + + + item.name)} - values={dashboard.teachingPractices.map((item) => item.data.teachers)} + direction="column" + labels={[t('dashboard.engagement.completed-a-second-coach-session'), 'Without a second coach sessions']} + values={[ + dashboard.engagement.teacherThatCompletedSecondSession, + dashboard.engagement.teachersCoached - dashboard.engagement.teacherThatCompletedSecondSession, + ]} + label={t('dashboard.engagement.completed-a-second-coach-session') || ''} + title={ + (dashboard.engagement.teachersCoached + ? (dashboard.engagement.teacherThatCompletedSecondSession / dashboard.engagement.teachersCoached) * + 100 + : 0 + ).toFixed(0) + '%' + } + subTitle="Of teachers" /> - - + +
+ + + + {t('dashboard.targeted-improvement-areas.title')} + + + {t('dashboard.targeted-improvement-areas.description')} + + + item.name)} + values={dashboard.teachingPractices.map((item) => item.data.teachers)} + /> + - + {t('dashboard.select-teaching-practices-to-show')} @@ -200,10 +203,6 @@ const DashboardPage: React.FC = () => { label={t('dashboard.teachers-and-coaches-chose-to-work-on-improving-this-practice')} value={selected.data.teachers} /> - diff --git a/src/pages/Schools/SchoolForm/RegionSelect/index.tsx b/src/pages/Schools/SchoolForm/RegionSelect/index.tsx index 63f314b..00d0e69 100644 --- a/src/pages/Schools/SchoolForm/RegionSelect/index.tsx +++ b/src/pages/Schools/SchoolForm/RegionSelect/index.tsx @@ -49,7 +49,7 @@ const RegionSelect: React.FC = ({ level, direction, region, onSelect, onC display="flex" flexDir={direction} mt={direction === 'column' ? '12px' : 0} - ml={direction === 'row' ? '12px' : 0} + ml={direction === 'row' ? (level === 0 ? 0 : '12px') : 0} w="full" >