From ced2a99905ce48014bb9ef62a44bbba02e286c67 Mon Sep 17 00:00:00 2001 From: iacopolea Date: Thu, 11 Dec 2025 09:50:09 +0100 Subject: [PATCH 1/9] fix: enable refetching on mount or argument change for user query in JoinPage --- src/pages/JoinPage/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/JoinPage/index.tsx b/src/pages/JoinPage/index.tsx index bad0bf510..3767af436 100644 --- a/src/pages/JoinPage/index.tsx +++ b/src/pages/JoinPage/index.tsx @@ -93,7 +93,9 @@ const LogoWrapper = styled.div` const JoinPage = () => { const { t } = useTranslation(); const [searchParams] = useSearchParams(); - const { isSuccess: isLogged } = useGetUsersMeQuery(); + const { isSuccess: isLogged } = useGetUsersMeQuery(undefined, { + refetchOnMountOrArgChange: true, + }); const navigate = useNavigate(); const { profile, token } = useParams(); const shouldSkipQuery = isLogged || !(profile && token); From 04e60f6cbeedf360236d9f7ecd8163b66975031a Mon Sep 17 00:00:00 2001 From: iacopolea Date: Thu, 11 Dec 2025 11:24:11 +0100 Subject: [PATCH 2/9] fix: change refetching strategy to refetch on focus for user query in JoinPage --- src/pages/JoinPage/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/JoinPage/index.tsx b/src/pages/JoinPage/index.tsx index 3767af436..30b3f7651 100644 --- a/src/pages/JoinPage/index.tsx +++ b/src/pages/JoinPage/index.tsx @@ -94,7 +94,7 @@ const JoinPage = () => { const { t } = useTranslation(); const [searchParams] = useSearchParams(); const { isSuccess: isLogged } = useGetUsersMeQuery(undefined, { - refetchOnMountOrArgChange: true, + refetchOnFocus: true, }); const navigate = useNavigate(); const { profile, token } = useParams(); From 41c4701b098879fa6f72d321b1bf9ebb7d8a4a53 Mon Sep 17 00:00:00 2001 From: iacopolea Date: Fri, 12 Dec 2025 16:39:01 +0100 Subject: [PATCH 3/9] feat: enhance ServiceTiles and context to handle workspace templates and fallback rendering --- src/common/components/ServiceTiles/index.tsx | 29 ++++++++++- src/pages/Dashboard/LaunchCampaignCards.tsx | 11 +++- src/pages/Dashboard/PromoContext.tsx | 51 +++++++++++++++++-- .../empty-state/projectEmptyState.tsx | 8 ++- 4 files changed, 91 insertions(+), 8 deletions(-) diff --git a/src/common/components/ServiceTiles/index.tsx b/src/common/components/ServiceTiles/index.tsx index c81ac4d03..b6438a4ad 100644 --- a/src/common/components/ServiceTiles/index.tsx +++ b/src/common/components/ServiceTiles/index.tsx @@ -20,7 +20,6 @@ interface ServiceTilesProps { const ServiceTiles = ({ onClick, promoTemplates }: ServiceTilesProps) => { if (!promoTemplates?.length) return null; - return ( <> { title="promo-templates" > {promoTemplates.map((template, i) => { - if (!template.strapi) return null; + if (!template.strapi) { + console.log('Missing strapi data, rendering fallback:', template); + const fallbackTitle = template.name; + const fallbackDescription = template.description || ''; + const fallbackBackground = + 'linear-gradient(91deg, #8A0C49 0%, #D81E57 100%)'; + const fallbackPrice = template.price || ''; + const fallbackIcon = {fallbackTitle}; + return ( + + onClick(template.id)} + /> + + ); + } const { title, price, tags, image, background, pre_title } = template.strapi; const outputs = tags.map((output) => { diff --git a/src/pages/Dashboard/LaunchCampaignCards.tsx b/src/pages/Dashboard/LaunchCampaignCards.tsx index ca92c47d9..20893ef84 100644 --- a/src/pages/Dashboard/LaunchCampaignCards.tsx +++ b/src/pages/Dashboard/LaunchCampaignCards.tsx @@ -28,6 +28,8 @@ const LaunchCampaignCards = () => { const { data } = useActiveWorkspaceProjects(); const { promoTemplates, + workspaceNoStrapiTemplates, + workspaceStrapiTemplates, setIsDrawerOpen, setSelectedTemplate, selectedTemplate, @@ -71,7 +73,14 @@ const LaunchCampaignCards = () => { - + {selectedTemplate && ( >; promoTemplates: CpReqTemplate[]; + workspaceStrapiTemplates: CpReqTemplate[]; + workspaceNoStrapiTemplates: CpReqTemplate[]; selectedTemplate?: CpReqTemplate; setSelectedTemplate: Dispatch>; } @@ -30,7 +32,7 @@ export const PromoContextProvider = ({ children }: { children: ReactNode }) => { useState(); const { activeWorkspace } = useActiveWorkspace(); - const { data } = useGetWorkspacesByWidTemplatesQuery( + const { data: promoTemplatesData } = useGetWorkspacesByWidTemplatesQuery( { wid: activeWorkspace?.id.toString() || '', filterBy: { @@ -43,10 +45,23 @@ export const PromoContextProvider = ({ children }: { children: ReactNode }) => { skip: !activeWorkspace, } ); + const { data: workspaceTemplatesData } = useGetWorkspacesByWidTemplatesQuery( + { + wid: activeWorkspace?.id.toString() || '', + filterBy: { + isPromo: 0, + }, + orderBy: 'order', + order: 'asc', + }, + { + skip: !activeWorkspace, + } + ); const promoTemplates = useMemo(() => { - if (!data) return []; - return data.items.reduce( + if (!promoTemplatesData) return []; + return promoTemplatesData.items.reduce( (acc, template) => { if ('strapi' in template) { acc.push(template); @@ -55,13 +70,39 @@ export const PromoContextProvider = ({ children }: { children: ReactNode }) => { }, [] ); - }, [data]); + }, [promoTemplatesData]); + + const workspaceStrapiTemplates = useMemo(() => { + if (!workspaceTemplatesData) return []; + return workspaceTemplatesData.items.reduce< + PromoContextProps['promoTemplates'] + >((acc, template) => { + if ('strapi' in template) { + acc.push(template); + } + return acc; + }, []); + }, [workspaceTemplatesData]); + + const workspaceNoStrapiTemplates = useMemo(() => { + if (!workspaceTemplatesData) return []; + return workspaceTemplatesData.items.reduce< + PromoContextProps['promoTemplates'] + >((acc, template) => { + if (!('strapi' in template)) { + acc.push(template); + } + return acc; + }, []); + }, [workspaceTemplatesData]); const PromoContextValue = useMemo( () => ({ isDrawerOpen, setIsDrawerOpen, promoTemplates, + workspaceStrapiTemplates, + workspaceNoStrapiTemplates, selectedTemplate, setSelectedTemplate, }), @@ -69,6 +110,8 @@ export const PromoContextProvider = ({ children }: { children: ReactNode }) => { isDrawerOpen, setIsDrawerOpen, promoTemplates, + workspaceStrapiTemplates, + workspaceNoStrapiTemplates, selectedTemplate, setSelectedTemplate, ] diff --git a/src/pages/Dashboard/empty-state/projectEmptyState.tsx b/src/pages/Dashboard/empty-state/projectEmptyState.tsx index 99b7b8139..51fb23726 100644 --- a/src/pages/Dashboard/empty-state/projectEmptyState.tsx +++ b/src/pages/Dashboard/empty-state/projectEmptyState.tsx @@ -43,6 +43,8 @@ export const ProjectEmptyState = () => { const canView = useCanAccessToActiveWorkspace(); const { promoTemplates, + workspaceStrapiTemplates, + workspaceNoStrapiTemplates, setIsDrawerOpen, selectedTemplate, isDrawerOpen, @@ -93,7 +95,11 @@ export const ProjectEmptyState = () => {
Date: Thu, 27 Nov 2025 16:12:08 +0100 Subject: [PATCH 4/9] fix: adjust padding in ResponsiveGrid and refactor Controls layout for mobile view --- src/pages/Plan/PlanBody.tsx | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/pages/Plan/PlanBody.tsx b/src/pages/Plan/PlanBody.tsx index 50a0b6cc5..896fd5662 100644 --- a/src/pages/Plan/PlanBody.tsx +++ b/src/pages/Plan/PlanBody.tsx @@ -22,10 +22,24 @@ const ResponsiveGrid = styled(Grid)` padding: ${({ theme }) => theme.space.md}; @media (max-width: ${({ theme }) => theme.breakpoints.sm}) { - padding: ${({ theme }) => theme.space.md} 0; + padding: ${({ theme }) => theme.space.md} 0 + ${({ theme }) => theme.space.xxl}; } `; +const FixedWrapper = styled.div` + position: fixed; + bottom: 0; + left: 0; + width: 100%; + max-width: 100%; + background-color: ${({ theme }) => theme.palette.white}; + border-top: 1px solid ${({ theme }) => theme.palette.grey[100]}; + padding: ${({ theme }) => theme.space.sm} ${({ theme }) => theme.space.md}; + display: flex; + justify-content: center; +`; + export const PlanBody = () => { const { activeTab } = usePlanContext(); const { width } = useWindowSize(); @@ -58,11 +72,9 @@ export const PlanBody = () => { )} {isMobile && ( - - - - - + + + )} From 07c2b59816f32287ccb3c234ef712224395525d4 Mon Sep 17 00:00:00 2001 From: iacopolea Date: Mon, 15 Dec 2025 17:15:10 +0100 Subject: [PATCH 5/9] feat: enhance ServiceTiles with fallback rendering and additional info tags --- src/assets/icons/purchasable.svg | 18 +++++ src/common/components/ServiceTiles/index.tsx | 70 +++++++++++++++---- src/locales/en/translation.json | 3 + src/locales/it/translation.json | 3 + src/pages/Dashboard/LaunchCampaignCards.tsx | 4 +- .../empty-state/projectEmptyState.tsx | 4 +- 6 files changed, 84 insertions(+), 18 deletions(-) create mode 100644 src/assets/icons/purchasable.svg diff --git a/src/assets/icons/purchasable.svg b/src/assets/icons/purchasable.svg new file mode 100644 index 000000000..00c885381 --- /dev/null +++ b/src/assets/icons/purchasable.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/common/components/ServiceTiles/index.tsx b/src/common/components/ServiceTiles/index.tsx index b6438a4ad..e41fdb774 100644 --- a/src/common/components/ServiceTiles/index.tsx +++ b/src/common/components/ServiceTiles/index.tsx @@ -1,9 +1,12 @@ import { ServiceTile, SM, Tag } from '@appquality/unguess-design-system'; -import { t } from 'i18next'; +import { ReactComponent as UserGroupIcon } from '@zendeskgarden/svg-icons/src/12/user-group-stroke.svg'; +import { ReactComponent as RerunIcon } from '@zendeskgarden/svg-icons/src/12/arrow-retweet-stroke.svg'; import { appTheme } from 'src/app/theme'; +import { ReactComponent as FallbackIcon } from 'src/assets/icons/purchasable.svg'; import { ScrollingGrid } from 'src/common/components/ScrollingGrid'; -import { CpReqTemplate } from 'src/features/api'; +import { CpReqTemplate, Module } from 'src/features/api'; +import { Trans, useTranslation } from 'react-i18next'; import styled from 'styled-components'; const AdditionalInfoTag = styled(Tag)` @@ -19,7 +22,9 @@ interface ServiceTilesProps { } const ServiceTiles = ({ onClick, promoTemplates }: ServiceTilesProps) => { + const { t } = useTranslation(); if (!promoTemplates?.length) return null; + const fallbackBackground = 'linear-gradient(91deg, #AD1846 0%, #E05B4B 100%)'; return ( <> { > {promoTemplates.map((template, i) => { if (!template.strapi) { - console.log('Missing strapi data, rendering fallback:', template); const fallbackTitle = template.name; - const fallbackDescription = template.description || ''; - const fallbackBackground = - 'linear-gradient(91deg, #8A0C49 0%, #D81E57 100%)'; + const targetModule: { output: string } | undefined = JSON.parse( + template.config + ).modules.find((module: Module) => module.type === 'target'); const fallbackPrice = template.price || ''; - const fallbackIcon = {fallbackTitle}; + const fallbackIcon = ; + const targetTag = + targetModule?.output && Number(targetModule.output) > 0 ? ( + + + + + ) : null; + const rerunActivityTag = ( + + + {t('__SERVICE_TILES_FALLBACK_RERUN_ACTIVITY')} + + ); return ( { > + {[targetTag, rerunActivityTag]} + + } onClick={() => onClick(template.id)} /> @@ -81,15 +117,21 @@ const ServiceTiles = ({ onClick, promoTemplates }: ServiceTilesProps) => { } + background={background || fallbackBackground} + price={price?.price || template.price || ''} + icon={ + image ? ( + {title + ) : ( + + ) + } superscript={price?.previous_price} isSuperscriptStrikethrough={!!price?.is_strikethrough} additionalInfo={ diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 964a93dcb..8c9fa6f75 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -1324,8 +1324,11 @@ "__SENTIMENT_OVERVIEW_SUBTITLE": "Generated from transcript", "__SENTIMENT_OVERVIEW_TITLE": "Experience Summary", "__SENTIMENT_TOAST_COPY_MESSAGE": "Sentiment copied to clipboard", + "__SERVICE_TILES_FALLBACK_DESCRIPTION": "Custom Template", + "__SERVICE_TILES_FALLBACK_RERUN_ACTIVITY": "Repeat Activity", "__SERVICE_TILES_HEADER": "Explore new ways of testing", "__SERVICE_TILES_SUBTITLE": "Launch lean tests autonomosly, get expert-verified results", + "__SERVICE_TILES_TARGET_OUTPUT": "{{output}} users", "__SIDEBAR_CAMPAIGNS_LABEL": "activities", "__TEMPLATE_CARD_TAILORED_HEADER": "My tailored activities", "__TEMPLATE_CARD_UNGUESS_HEADER": "UNGUESS template", diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json index 98664eaea..24169d54d 100644 --- a/src/locales/it/translation.json +++ b/src/locales/it/translation.json @@ -1360,8 +1360,11 @@ "__SENTIMENT_OVERVIEW_SUBTITLE": "", "__SENTIMENT_OVERVIEW_TITLE": "", "__SENTIMENT_TOAST_COPY_MESSAGE": "", + "__SERVICE_TILES_FALLBACK_DESCRIPTION": "", + "__SERVICE_TILES_FALLBACK_RERUN_ACTIVITY": "", "__SERVICE_TILES_HEADER": "", "__SERVICE_TILES_SUBTITLE": "", + "__SERVICE_TILES_TARGET_OUTPUT": "", "__SIDEBAR_CAMPAIGNS_LABEL": "campagne", "__TEMPLATE_CARD_TAILORED_HEADER": "", "__TEMPLATE_CARD_UNGUESS_HEADER": "", diff --git a/src/pages/Dashboard/LaunchCampaignCards.tsx b/src/pages/Dashboard/LaunchCampaignCards.tsx index 20893ef84..9a05f7565 100644 --- a/src/pages/Dashboard/LaunchCampaignCards.tsx +++ b/src/pages/Dashboard/LaunchCampaignCards.tsx @@ -76,9 +76,9 @@ const LaunchCampaignCards = () => { {selectedTemplate && ( diff --git a/src/pages/Dashboard/empty-state/projectEmptyState.tsx b/src/pages/Dashboard/empty-state/projectEmptyState.tsx index 51fb23726..e870ff99e 100644 --- a/src/pages/Dashboard/empty-state/projectEmptyState.tsx +++ b/src/pages/Dashboard/empty-state/projectEmptyState.tsx @@ -96,9 +96,9 @@ export const ProjectEmptyState = () => { From 37b3f140d991e3a9837a632daa3e76ac79bc558d Mon Sep 17 00:00:00 2001 From: iacopolea Date: Tue, 16 Dec 2025 10:16:39 +0100 Subject: [PATCH 6/9] feat: refactor ServiceTiles to include target output tag in additional info --- src/common/components/ServiceTiles/index.tsx | 43 +++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/src/common/components/ServiceTiles/index.tsx b/src/common/components/ServiceTiles/index.tsx index e41fdb774..c0be0459f 100644 --- a/src/common/components/ServiceTiles/index.tsx +++ b/src/common/components/ServiceTiles/index.tsx @@ -33,29 +33,30 @@ const ServiceTiles = ({ onClick, promoTemplates }: ServiceTilesProps) => { title="promo-templates" > {promoTemplates.map((template, i) => { + const targetModule: { output: string } | undefined = JSON.parse( + template.config + ).modules.find((module: Module) => module.type === 'target'); + const targetTag = + targetModule?.output && Number(targetModule.output) > 0 ? ( + + + + + ) : null; if (!template.strapi) { const fallbackTitle = template.name; - const targetModule: { output: string } | undefined = JSON.parse( - template.config - ).modules.find((module: Module) => module.type === 'target'); const fallbackPrice = template.price || ''; const fallbackIcon = ; - const targetTag = - targetModule?.output && Number(targetModule.output) > 0 ? ( - - - - - ) : null; + const rerunActivityTag = ( { superscript={price?.previous_price} isSuperscriptStrikethrough={!!price?.is_strikethrough} additionalInfo={ -
{outputs}
+
+ {[targetTag, outputs]} +
} onClick={handleClick} /> From ca17f19a422d0f123b097e55d2279e1517185c41 Mon Sep 17 00:00:00 2001 From: iacopolea Date: Tue, 16 Dec 2025 10:39:14 +0100 Subject: [PATCH 7/9] feat: update promo list tests to assert a fixed count of promo items --- tests/e2e/dashboard_home.spec.ts | 4 +--- tests/e2e/project.spec.ts | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/e2e/dashboard_home.spec.ts b/tests/e2e/dashboard_home.spec.ts index 21c62c8ae..015de8f9e 100644 --- a/tests/e2e/dashboard_home.spec.ts +++ b/tests/e2e/dashboard_home.spec.ts @@ -37,9 +37,7 @@ test.describe('Home page', () => { test('should show a list of suggested templates in promo', async () => { await expect(dashboard.elements().title()).toBeVisible(); await expect(promoList.elements().promoList()).toBeVisible(); - await expect(promoList.elements().promoListItems()).toHaveCount( - promoList.promoItems.length - ); + await expect(promoList.elements().promoListItems()).toHaveCount(10); }); test('should open the create plan interface when clicking on a promo item, a more info should go to the single template', async ({ diff --git a/tests/e2e/project.spec.ts b/tests/e2e/project.spec.ts index 1fc120c98..6a446e04e 100644 --- a/tests/e2e/project.spec.ts +++ b/tests/e2e/project.spec.ts @@ -35,9 +35,7 @@ test.describe('project page', () => { project.projectCampaigns.length ); await expect(promoList.elements().promoList()).toBeVisible(); - await expect(promoList.elements().promoListItems()).toHaveCount( - promoList.promoItems.length - ); + await expect(promoList.elements().promoListItems()).toHaveCount(10); }); test('the invite users button should be visible', async () => { @@ -149,9 +147,7 @@ test.describe('project page empty state', () => { test('should display no campaigns, a list of suggested templates in promo', async () => { await expect(project.elements().projectsTable()).not.toBeVisible(); await expect(promoList.elements().promoList()).toBeVisible(); - await expect(promoList.elements().promoListItems()).toHaveCount( - promoList.promoItems.length - ); + await expect(promoList.elements().promoListItems()).toHaveCount(10); }); test('should open the create plan interface when clicking on a promo item, a more info should go to the single template', async ({ From 6044cf57635e632f3cd325345958509ab0e83f9a Mon Sep 17 00:00:00 2001 From: iacopolea Date: Thu, 18 Dec 2025 10:27:22 +0100 Subject: [PATCH 8/9] feat: refactor ServiceTiles and related components to optimize template handling and improve click event management --- src/common/components/ServiceTiles/index.tsx | 11 ++++--- src/pages/Dashboard/LaunchCampaignCards.tsx | 30 +++++++++++-------- .../empty-state/projectEmptyState.tsx | 27 ++++++++++------- 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/src/common/components/ServiceTiles/index.tsx b/src/common/components/ServiceTiles/index.tsx index c0be0459f..169c63268 100644 --- a/src/common/components/ServiceTiles/index.tsx +++ b/src/common/components/ServiceTiles/index.tsx @@ -1,6 +1,6 @@ import { ServiceTile, SM, Tag } from '@appquality/unguess-design-system'; -import { ReactComponent as UserGroupIcon } from '@zendeskgarden/svg-icons/src/12/user-group-stroke.svg'; import { ReactComponent as RerunIcon } from '@zendeskgarden/svg-icons/src/12/arrow-retweet-stroke.svg'; +import { ReactComponent as UserGroupIcon } from '@zendeskgarden/svg-icons/src/12/user-group-stroke.svg'; import { appTheme } from 'src/app/theme'; import { ReactComponent as FallbackIcon } from 'src/assets/icons/purchasable.svg'; import { ScrollingGrid } from 'src/common/components/ScrollingGrid'; @@ -33,6 +33,9 @@ const ServiceTiles = ({ onClick, promoTemplates }: ServiceTilesProps) => { title="promo-templates" > {promoTemplates.map((template, i) => { + const handleClick = () => { + onClick(template.id); + }; const targetModule: { output: string } | undefined = JSON.parse( template.config ).modules.find((module: Module) => module.type === 'target'); @@ -87,7 +90,7 @@ const ServiceTiles = ({ onClick, promoTemplates }: ServiceTilesProps) => { {[targetTag, rerunActivityTag]} } - onClick={() => onClick(template.id)} + onClick={handleClick} />
); @@ -110,10 +113,6 @@ const ServiceTiles = ({ onClick, promoTemplates }: ServiceTilesProps) => { ); }); - const handleClick = () => { - onClick(template.id); - }; - return ( { isDrawerOpen, } = usePromoContext(); + const allTemplates = useMemo(() => { + return [ + ...workspaceNoStrapiTemplates, + ...workspaceStrapiTemplates, + ...promoTemplates, + ]; + }, [promoTemplates, workspaceNoStrapiTemplates, workspaceStrapiTemplates]); + const handleCloseDrawer = () => { setIsDrawerOpen(false); }; - const handleClick = (tid: number) => { - const selected = promoTemplates.find((template) => template.id === tid); - setSelectedTemplate(selected); - setIsDrawerOpen(true); - }; + const handleClick = useCallback( + (tid: number) => { + setSelectedTemplate(allTemplates.find((template) => template.id === tid)); + setIsDrawerOpen(true); + }, + [allTemplates, setSelectedTemplate, setIsDrawerOpen] + ); if (!data) return null; if (!canView) return null; @@ -73,14 +84,7 @@ const LaunchCampaignCards = () => { - + {selectedTemplate && ( { setSelectedTemplate, } = usePromoContext(); + const allTemplates = useMemo(() => { + return [ + ...workspaceNoStrapiTemplates, + ...workspaceStrapiTemplates, + ...promoTemplates, + ]; + }, [promoTemplates, workspaceNoStrapiTemplates, workspaceStrapiTemplates]); + const handleCloseDrawer = useCallback(() => { setIsDrawerOpen(false); }, [setIsDrawerOpen]); - const handleClick = (tid: number) => { - setSelectedTemplate(promoTemplates.find((template) => template.id === tid)); - setIsDrawerOpen(true); - }; + const handleClick = useCallback( + (tid: number) => { + setSelectedTemplate(allTemplates.find((template) => template.id === tid)); + setIsDrawerOpen(true); + }, + [allTemplates, setSelectedTemplate, setIsDrawerOpen] + ); return ( {
Date: Thu, 18 Dec 2025 10:30:31 +0100 Subject: [PATCH 9/9] refactor: streamline allTemplates definition in LaunchCampaignCards and ProjectEmptyState components --- src/pages/Dashboard/LaunchCampaignCards.tsx | 9 +++++---- src/pages/Dashboard/empty-state/projectEmptyState.tsx | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/pages/Dashboard/LaunchCampaignCards.tsx b/src/pages/Dashboard/LaunchCampaignCards.tsx index e813b9553..980aac8a1 100644 --- a/src/pages/Dashboard/LaunchCampaignCards.tsx +++ b/src/pages/Dashboard/LaunchCampaignCards.tsx @@ -37,13 +37,14 @@ const LaunchCampaignCards = () => { isDrawerOpen, } = usePromoContext(); - const allTemplates = useMemo(() => { - return [ + const allTemplates = useMemo( + () => [ ...workspaceNoStrapiTemplates, ...workspaceStrapiTemplates, ...promoTemplates, - ]; - }, [promoTemplates, workspaceNoStrapiTemplates, workspaceStrapiTemplates]); + ], + [promoTemplates, workspaceNoStrapiTemplates, workspaceStrapiTemplates] + ); const handleCloseDrawer = () => { setIsDrawerOpen(false); diff --git a/src/pages/Dashboard/empty-state/projectEmptyState.tsx b/src/pages/Dashboard/empty-state/projectEmptyState.tsx index 2cc7dcb42..400c76ba4 100644 --- a/src/pages/Dashboard/empty-state/projectEmptyState.tsx +++ b/src/pages/Dashboard/empty-state/projectEmptyState.tsx @@ -51,13 +51,14 @@ export const ProjectEmptyState = () => { setSelectedTemplate, } = usePromoContext(); - const allTemplates = useMemo(() => { - return [ + const allTemplates = useMemo( + () => [ ...workspaceNoStrapiTemplates, ...workspaceStrapiTemplates, ...promoTemplates, - ]; - }, [promoTemplates, workspaceNoStrapiTemplates, workspaceStrapiTemplates]); + ], + [promoTemplates, workspaceNoStrapiTemplates, workspaceStrapiTemplates] + ); const handleCloseDrawer = useCallback(() => { setIsDrawerOpen(false);