From 1765c52fe29456563666f4ea4a7e7a5716a913f6 Mon Sep 17 00:00:00 2001 From: Przemek Date: Wed, 24 Apr 2024 15:15:40 +0200 Subject: [PATCH] policy for ios --- src/pages/static-page/index.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/pages/static-page/index.tsx b/src/pages/static-page/index.tsx index 5abcb6ae..029f35a6 100644 --- a/src/pages/static-page/index.tsx +++ b/src/pages/static-page/index.tsx @@ -56,8 +56,10 @@ const StaticPage = () => { const removeWord = (text: string) => { return text.replace("Mobile", ""); }; + const mainTabs = useMemo(() => { let items = pages?.list?.data; + if (MOBILE_DEVICE === "true") { items = pages?.list?.data.filter( (item) => @@ -68,11 +70,13 @@ const StaticPage = () => { } return ( items && - items.map((item) => ({ - key: item.slug, - title: removeWord(item.title.substring(0, 50)), - url: item.slug, - })) + items // @ts-ignore + .filter((item) => item.active) + .map((item) => ({ + key: item.slug, + title: removeWord(item.title.substring(0, 50)), + url: item.slug, + })) ); }, [pages]);