Render missing context provider for layouts (#17349)
## Before <img width="1656" height="892" alt="image" src="https://github.com/user-attachments/assets/05c6ced5-ff13-4987-a978-bae5111da9d4" /> ## After https://github.com/user-attachments/assets/a3b34590-8006-4363-8fa4-b52fb099bbff
This commit is contained in:
committed by
GitHub
parent
fe9c8f1429
commit
267691a403
+14
-2
@@ -6,7 +6,9 @@ import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSi
|
||||
import { useGenerateDepthRecordGqlFieldsFromObject } from '@/object-record/graphql/record-gql-fields/hooks/useGenerateDepthRecordGqlFieldsFromObject';
|
||||
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
|
||||
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
|
||||
import { LayoutRenderingProvider } from '@/ui/layout/contexts/LayoutRenderingContext';
|
||||
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
|
||||
import { PageLayoutType } from '~/generated/graphql';
|
||||
|
||||
export const CommandMenuCalendarEventPage = () => {
|
||||
const { upsertRecordsInStore } = useUpsertRecordsInStore();
|
||||
@@ -50,9 +52,19 @@ export const CommandMenuCalendarEventPage = () => {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<LayoutRenderingProvider
|
||||
value={{
|
||||
targetRecordIdentifier: {
|
||||
id: calendarEvent.id,
|
||||
targetObjectNameSingular: CoreObjectNameSingular.CalendarEvent,
|
||||
},
|
||||
layoutType: PageLayoutType.RECORD_PAGE,
|
||||
isInRightDrawer: true,
|
||||
isLegacyRecordShowPage: true,
|
||||
}}
|
||||
>
|
||||
<CalendarEventDetailsEffect record={calendarEvent} />
|
||||
<CalendarEventDetails calendarEvent={calendarEvent} />
|
||||
</>
|
||||
</LayoutRenderingProvider>
|
||||
);
|
||||
};
|
||||
|
||||
+2
-2
@@ -37,8 +37,8 @@ export const PropertyBox = ({
|
||||
const layoutRenderingContext = useLayoutRenderingContext();
|
||||
|
||||
const isInRecordPageLayout =
|
||||
layoutRenderingContext?.layoutType === PageLayoutType.RECORD_PAGE &&
|
||||
!layoutRenderingContext?.isLegacyRecordShowPage;
|
||||
layoutRenderingContext.layoutType === PageLayoutType.RECORD_PAGE &&
|
||||
!layoutRenderingContext.isLegacyRecordShowPage;
|
||||
|
||||
return (
|
||||
<StyledPropertyBoxContainer
|
||||
|
||||
Reference in New Issue
Block a user