From b7cc6832dd34219110e163348191765244640cec Mon Sep 17 00:00:00 2001 From: faisolavolut Date: Tue, 18 Mar 2025 14:55:44 +0700 Subject: [PATCH] fix: enhance SidebarBetter and TableList components for improved layout and responsiveness --- components/form/field/TypeRichText.tsx | 2 +- components/partials/SidebarBetter.tsx | 14 +++++++++++--- components/tablelist/TableList.tsx | 11 ++++------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/components/form/field/TypeRichText.tsx b/components/form/field/TypeRichText.tsx index 2fc6635..c0aa767 100644 --- a/components/form/field/TypeRichText.tsx +++ b/components/form/field/TypeRichText.tsx @@ -459,7 +459,7 @@ export const TypeRichText: React.FC = ({ { setUrl(get(e, "currentTarget.value")); }} diff --git a/components/partials/SidebarBetter.tsx b/components/partials/SidebarBetter.tsx index abe36ee..ebb7962 100644 --- a/components/partials/SidebarBetter.tsx +++ b/components/partials/SidebarBetter.tsx @@ -36,6 +36,7 @@ interface TreeMenuItem { interface TreeMenuProps { data: TreeMenuItem[]; minimaze: () => void; + onClick?: () => void; mini: boolean; } @@ -43,6 +44,7 @@ const SidebarBetterTree: React.FC = ({ data, minimaze, mini, + onClick, }) => { const [currentPage, setCurrentPage] = useState(""); const [notification, setNotification] = useState(false as boolean); @@ -325,6 +327,9 @@ const SidebarBetterTree: React.FC = ({ href={item.href} onClick={() => { if (item?.href) setCurrentPage(item.href); + if (typeof onClick === "function") { + onClick(); + } }} className={classNames( "transition-all font-bold relative flex-row flex items-center cursor-pointer items-center text-base flex flex-row ", @@ -393,6 +398,9 @@ const SidebarBetterTree: React.FC = ({ href={item.href} onClick={() => { if (item?.href) setCurrentPage(item.href); + if (typeof onClick === "function") { + onClick(); + } }} className={classNames( "transition-all font-bold relative flex-row flex items-center cursor-pointer items-center text-base flex flex-row ", @@ -460,7 +468,7 @@ const SidebarBetterTree: React.FC = ({