From 67987b3e851be3d86196e1d21c7c9c8c6370faa5 Mon Sep 17 00:00:00 2001 From: Pavel Kovirshin <45898580+PahaN47@users.noreply.github.com> Date: Thu, 22 Aug 2024 16:09:59 +0300 Subject: [PATCH] feat: components menu redesign (#255) * feat: components menu redesign * fix: removed gap between sticky headers * fix: requested changes --- .../components/[libId]/[componentId].tsx | 6 +- .../design/[sectionId]/[articleId].tsx | 6 +- src/components/Footer/Footer.tsx | 9 +- src/components/Layout/Layout.scss | 4 + src/components/Layout/Layout.tsx | 10 +- .../LibraryVersion/LibraryVersion.scss | 1 + .../Navigation/Navigation.scss | 21 ++- .../Navigation/Navigation.tsx | 21 ++- .../NavigationLayout/NavigationLayout.scss | 136 +++++++++++---- .../NavigationLayout/NavigationLayout.tsx | 105 ++++++------ .../SectionBlock/SectionBlock.scss | 43 ++++- .../SectionBlock/SectionBlock.tsx | 158 ++++++++++-------- src/mixins.scss | 22 +++ 13 files changed, 358 insertions(+), 184 deletions(-) diff --git a/src/[locale]/components/[libId]/[componentId].tsx b/src/[locale]/components/[libId]/[componentId].tsx index 4158487cc510..39f383adc074 100644 --- a/src/[locale]/components/[libId]/[componentId].tsx +++ b/src/[locale]/components/[libId]/[componentId].tsx @@ -1,3 +1,4 @@ +import {BREAKPOINTS, useWindowBreakpoint} from '@gravity-ui/page-constructor'; import {GetStaticPaths, GetStaticPathsResult, GetStaticProps} from 'next'; import React from 'react'; import {Section} from 'src/components/NavigationLayout/types'; @@ -81,6 +82,9 @@ export const ComponentPage = ({ const lib = libs.find((item) => item.id === libId); const component = lib?.components.find((item) => item.id === componentId); + const windowBreakpoint = useWindowBreakpoint(); + const isMobile = windowBreakpoint < BREAKPOINTS.lg; + if (!lib || !component) { return null; } @@ -107,7 +111,7 @@ export const ComponentPage = ({ }, []); return ( - + item.id === sectionId); const article = section?.articles.find((item) => item.id === articleId); + const windowBreakpoint = useWindowBreakpoint(); + const isMobile = windowBreakpoint < BREAKPOINTS.lg; + if (!section || !article) { return null; } @@ -72,7 +76,7 @@ export const ArticlePage = ({sectionId, articleId}: {sectionId: string; articleI }, []); return ( - + diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index 7d0feebabec4..acab8b3de9a9 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -1,4 +1,4 @@ -import {Col, Grid, Row} from '@gravity-ui/page-constructor'; +import {Col, Grid, GridProps, Row} from '@gravity-ui/page-constructor'; import {Icon} from 'landing-uikit'; import React from 'react'; @@ -11,8 +11,11 @@ import './Footer.scss'; const b = block('footer'); -export const Footer: React.FC = () => ( - +export const Footer: React.FC> = ({ + className, + containerClass, +}) => ( +