Tweak: remove extra padding for nested groups (#4474)

pull/4470/head
shamoon 4 weeks ago committed by GitHub
parent 7dabd0335f
commit 2d91b2b748
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -15,6 +15,7 @@ export default function ServicesGroup({
disableCollapse, disableCollapse,
useEqualHeights, useEqualHeights,
groupsInitiallyCollapsed, groupsInitiallyCollapsed,
isSubgroup,
}) { }) {
const panel = useRef(); const panel = useRef();
@ -22,14 +23,22 @@ export default function ServicesGroup({
if (layout?.initiallyCollapsed ?? groupsInitiallyCollapsed) panel.current.style.height = `0`; if (layout?.initiallyCollapsed ?? groupsInitiallyCollapsed) panel.current.style.height = `0`;
}, [layout, groupsInitiallyCollapsed]); }, [layout, groupsInitiallyCollapsed]);
let groupMargin = layout?.header === false ? "-my-1" : "";
if (isSubgroup && layout?.header === false) groupMargin = "-my-3";
let groupPadding = layout?.header === false ? "px-1" : "p-1";
if (isSubgroup) groupPadding = "";
return ( return (
<div <div
key={group.name} key={group.name}
className={classNames( className={classNames(
"services-group", "services-group flex-1",
layout?.style === "row" ? "basis-full" : "basis-full md:basis-1/2 lg:basis-1/3 xl:basis-1/4", layout?.style === "row" ? "basis-full" : "basis-full md:basis-1/2 lg:basis-1/3 xl:basis-1/4",
layout?.style !== "row" && fiveColumns ? "3xl:basis-1/5" : "", layout?.style !== "row" && fiveColumns ? "3xl:basis-1/5" : "",
layout?.header === false ? "flex-1 px-1 -my-1" : "flex-1 p-1", groupMargin,
groupPadding,
isSubgroup ? "subgroup" : "",
)} )}
> >
<Disclosure defaultOpen={!(layout?.initiallyCollapsed ?? groupsInitiallyCollapsed) ?? true}> <Disclosure defaultOpen={!(layout?.initiallyCollapsed ?? groupsInitiallyCollapsed) ?? true}>
@ -96,6 +105,7 @@ export default function ServicesGroup({
disableCollapse={disableCollapse} disableCollapse={disableCollapse}
useEqualHeights={useEqualHeights} useEqualHeights={useEqualHeights}
groupsInitiallyCollapsed={groupsInitiallyCollapsed} groupsInitiallyCollapsed={groupsInitiallyCollapsed}
isSubgroup
/> />
))} ))}
</div> </div>

Loading…
Cancel
Save