fix: Remove incorrect background logic from PageLayoutGridLayout (#16945)

Removes the background color logic that was incorrectly added to
PageLayoutGridLayout in PR #16870. Grid layouts are only used for
dashboards where widgets have their own background colors set in
WidgetCard.tsx, so the container background was causing visual
mismatches in padding/gap areas. The background logic remains correctly
applied in PageLayoutVerticalListViewer and PageLayoutVerticalListEditor
where widgets need to inherit the container background.

---------

Co-authored-by: Devessier <baptiste@devessier.fr>
This commit is contained in:
Abdullah.
2026-01-06 15:19:34 +05:00
committed by GitHub
parent de33d17809
commit 32efaee1bf
5 changed files with 19 additions and 32 deletions
@@ -0,0 +1,13 @@
import { useLayoutRenderingContext } from '@/ui/layout/contexts/LayoutRenderingContext';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import { PageLayoutType } from '~/generated/graphql';
export const usePageLayoutShouldUseWhiteBackground = () => {
const isMobile = useIsMobile();
const { isInRightDrawer, layoutType } = useLayoutRenderingContext();
const shouldUseWhiteBackground =
layoutType === PageLayoutType.RECORD_PAGE && (isMobile || isInRightDrawer);
return { shouldUseWhiteBackground };
};
@@ -1,14 +0,0 @@
import { useIsInPinnedTab } from '@/page-layout/widgets/hooks/useIsInPinnedTab';
import { useLayoutRenderingContext } from '@/ui/layout/contexts/LayoutRenderingContext';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
export const useShouldUseWhiteBackground = () => {
const isMobile = useIsMobile();
const { isInRightDrawer } = useLayoutRenderingContext();
const { isInPinnedTab } = useIsInPinnedTab();
const shouldUseWhiteBackground =
(isMobile || isInRightDrawer) && !isInPinnedTab;
return { shouldUseWhiteBackground };
};