diff --git a/app/ui/MonthCard.tsx b/app/ui/MonthCard.tsx index b66db90..706444f 100644 --- a/app/ui/MonthCard.tsx +++ b/app/ui/MonthCard.tsx @@ -18,8 +18,9 @@ export const MonthCard:FC = ({ yearMonth, children, monthlyExpen const router = useRouter(); const elRef = useRef(null); - // setting the `month` will activate the accordion belonging to that month - const handleChange = (event:any) => router.push(`/?year=${yearMonth.year}&month=${yearMonth.month}`); + // Setting the `month` will activate the accordion belonging to that month + // If the accordion is already active, it will collapse it + const handleChange = (event:any) => router.push(expanded ? `/?year=${yearMonth.year}` : `/?year=${yearMonth.year}&month=${yearMonth.month}`); useEffect(() => { if(expanded && elRef.current) { @@ -30,7 +31,7 @@ export const MonthCard:FC = ({ yearMonth, children, monthlyExpen return(
- +
{`${formatYearMonth(yearMonth)}`} { diff --git a/docker-compose-deploy.yml b/docker-compose-deploy.yml index ced4f42..3629f44 100644 --- a/docker-compose-deploy.yml +++ b/docker-compose-deploy.yml @@ -9,7 +9,7 @@ networks: services: web-app: - image: utility-bills-tracker:1.4.0 + image: utility-bills-tracker:1.5.0 networks: - traefik-network - mongo-network