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:
+13
@@ -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 };
|
||||
};
|
||||
Reference in New Issue
Block a user