From a82f5527289e5fae9d0dbea61419df5c5c015168 Mon Sep 17 00:00:00 2001 From: Nikita Elfimov Date: Thu, 25 Jan 2024 21:11:44 +0300 Subject: [PATCH] chore: hide relocation --- landing/app/src/pages/relocation/index.ts | 1 - .../landing-navigation/src/data/navigation.query.ts | 1 + .../landing-navigation/src/navigation.component.tsx | 5 ++++- landing/pages/index-page/src/queries/services.query.ts | 9 +++++++-- 4 files changed, 12 insertions(+), 4 deletions(-) delete mode 100644 landing/app/src/pages/relocation/index.ts diff --git a/landing/app/src/pages/relocation/index.ts b/landing/app/src/pages/relocation/index.ts deleted file mode 100644 index 6b497fcc..00000000 --- a/landing/app/src/pages/relocation/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default, getServerSideProps } from '@landing/relocation-page' diff --git a/landing/fragments/landing-navigation/src/data/navigation.query.ts b/landing/fragments/landing-navigation/src/data/navigation.query.ts index 5a1ba88e..49d0cb4b 100644 --- a/landing/fragments/landing-navigation/src/data/navigation.query.ts +++ b/landing/fragments/landing-navigation/src/data/navigation.query.ts @@ -4,6 +4,7 @@ const GET_NAVIGATION = gql` query GetNavigation { navigationItems { nodes { + id title elementsMenu { externalLink diff --git a/landing/fragments/landing-navigation/src/navigation.component.tsx b/landing/fragments/landing-navigation/src/navigation.component.tsx index d678f259..fc43a154 100644 --- a/landing/fragments/landing-navigation/src/navigation.component.tsx +++ b/landing/fragments/landing-navigation/src/navigation.component.tsx @@ -26,6 +26,9 @@ import { useNavigation } from './data' const Navigation: FC = () => { const navigation = useNavigation() + + const relocationId = ['cG9zdDoxNzgwMA==', 'cG9zdDoxNzc5OQ=='] + const [language, setLanguage] = useLanguage() const { scroll } = useLocomotiveScroll() const [visible, setVisible] = useState(false) @@ -101,7 +104,7 @@ const Navigation: FC = () => { - {navigation[language]?.reverse().map(({ title, elementsMenu, content }) => ( + {navigation[language]?.filter(item => !relocationId.includes(item.id)).reverse().map(({ title, elementsMenu, content }) => ( <> diff --git a/landing/pages/index-page/src/queries/services.query.ts b/landing/pages/index-page/src/queries/services.query.ts index bb1bf6f5..c089d597 100644 --- a/landing/pages/index-page/src/queries/services.query.ts +++ b/landing/pages/index-page/src/queries/services.query.ts @@ -6,6 +6,7 @@ const GET_SERVICES = gql` query GetMainServices { mainServices { nodes { + id contentAddons { image { altText @@ -31,13 +32,17 @@ const runServicesQuery = async () => { query: GET_SERVICES, }) + const relocationId = ['cG9zdDo2MDI=', 'cG9zdDo2MDM='] + + const data = servicesData.mainServices.nodes.filter(node => relocationId[0] !== (node.id) && relocationId[1] !== node.id) + if (servicesData) { return { services: { - RU: servicesData.mainServices.nodes.filter( + RU: data.filter( (servicesFragment) => servicesFragment.language.code === 'RU' ), - EN: servicesData.mainServices.nodes.filter( + EN: data.filter( (servicesFragment) => servicesFragment.language.code === 'EN' ), },