From 8255c49938f1491f171076fdb1c423c9bdffb4bf Mon Sep 17 00:00:00 2001 From: Nevo David Date: Sun, 21 Jul 2024 19:24:38 +0700 Subject: [PATCH] feat: calendar --- .../src/components/launches/calendar.tsx | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/apps/frontend/src/components/launches/calendar.tsx b/apps/frontend/src/components/launches/calendar.tsx index c0129329..3167bf43 100644 --- a/apps/frontend/src/components/launches/calendar.tsx +++ b/apps/frontend/src/components/launches/calendar.tsx @@ -273,20 +273,25 @@ const CalendarColumnRender: FC<{ day: number; hour: string }> = (props) => { }), })); - const getIntegration = useCallback(async (post: Post & { integration: Integration }) => { - return ( - await fetch( - `/integrations/${post.integration.id}?order=${post.submittedForOrderId}`, - { - method: 'GET', - } - ) - ).json(); - }, []); + const getIntegration = useCallback( + async (post: Post & { integration: Integration }) => { + return ( + await fetch( + `/integrations/${post.integration.id}?order=${post.submittedForOrderId}`, + { + method: 'GET', + } + ) + ).json(); + }, + [] + ); const previewPublication = useCallback( async (postInfo: Post & { integration: Integration }) => { - const post = await (await fetch(`/marketplace/posts/${postInfo.id}`)).json(); + const post = await ( + await fetch(`/marketplace/posts/${postInfo.id}`) + ).json(); const integration = await getIntegration(postInfo); modal.openModal({ @@ -327,15 +332,16 @@ const CalendarColumnRender: FC<{ day: number; hour: string }> = (props) => { closeOnEscape: false, withCloseButton: false, classNames: { - modal: 'bg-transparent text-white', + modal: 'w-[100%] max-w-[1400px] bg-transparent text-white', }, children: ( f.id === data.integration - ).map(p => ({ ...p, picture: data.integrationPicture }))} + integrations={integrations + .slice(0) + .filter((f) => f.id === data.integration) + .map((p) => ({ ...p, picture: data.integrationPicture }))} date={getDate} /> @@ -357,7 +363,7 @@ const CalendarColumnRender: FC<{ day: number; hour: string }> = (props) => { }, children: ( ({ ...p }))} + integrations={integrations.slice(0).map((p) => ({ ...p }))} date={getDate} reopenModal={() => ({})} />