From e554fe3cb231ea91c59e7b32c497f39611e74175 Mon Sep 17 00:00:00 2001 From: Knee Cola Date: Mon, 24 Nov 2025 21:00:28 +0100 Subject: [PATCH] refactor: improve InfoBox and NoteBox components with collapsible design MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Convert InfoBox to collapsible details element with chevron indicators - Add internationalized default title support for InfoBox - Update NoteBox styling to match new design system - Replace custom alert styling with consistent border-based design - Add text-base class to fieldset legends for uniform sizing - Remove className prop from InfoBox and NoteBox (no longer needed) - Update translations for clearer payment instruction descriptions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/ui/InfoBox.tsx | 28 +++++++++++++++++++++------- app/ui/LocationEditForm.tsx | 16 ++++++++-------- app/ui/NoteBox.tsx | 11 ++++++----- app/ui/UserSettingsForm.tsx | 14 +++++++------- messages/en.json | 9 +++++++-- messages/hr.json | 11 +++++++---- 6 files changed, 56 insertions(+), 33 deletions(-) diff --git a/app/ui/InfoBox.tsx b/app/ui/InfoBox.tsx index 7c92cb2..c101ee5 100644 --- a/app/ui/InfoBox.tsx +++ b/app/ui/InfoBox.tsx @@ -1,9 +1,23 @@ +import { ChevronDownIcon, ChevronUpIcon, QuestionMarkCircleIcon } from "@heroicons/react/24/outline"; +import { useTranslations } from "next-intl"; import { FC, ReactNode } from "react"; -export const InfoBox: FC<{ children: ReactNode, className?: string }> = ({ children, className }) => -
- - - - {children} -
\ No newline at end of file +export const InfoBox: FC<{ + children: ReactNode; + title?: string; +}> = ({ children, title }) => { + + const t = useTranslations("info-box"); + + return ( +
+ + {title ?? t("default-title")} + + + +
{children}
+
+ ) +} + diff --git a/app/ui/LocationEditForm.tsx b/app/ui/LocationEditForm.tsx index 185bc37..781812c 100644 --- a/app/ui/LocationEditForm.tsx +++ b/app/ui/LocationEditForm.tsx @@ -86,9 +86,9 @@ export const LocationEditForm: FC = ({ location, yearMont
- {t("tenant-payment-instructions-legend")} + {t("tenant-payment-instructions-legend")} - {t("tenant-payment-instructions-code-info")} + {t("tenant-payment-instructions-code-info")}
{t("tenant-payment-instructions-method--legend")} @@ -217,8 +217,8 @@ export const LocationEditForm: FC = ({ location, yearMont }
- {t("auto-utility-bill-forwarding-legend")} - {t("auto-utility-bill-forwarding-info")} + {t("auto-utility-bill-forwarding-legend")} + {t("auto-utility-bill-forwarding-info")}
- {t("auto-rent-notification-legend")} - {t("auto-rent-notification-info")} + {t("auto-rent-notification-legend")} + {t("auto-rent-notification-info")}