From 660dcfa2fe837dbe471f1f4cc00728030be5c0ce Mon Sep 17 00:00:00 2001 From: Pavel Kovyrshin Date: Tue, 13 Aug 2024 11:42:05 +0300 Subject: [PATCH 1/3] feat: components menu redesign --- .../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 | 8 +- .../LibraryVersion/LibraryVersion.scss | 1 + .../LibraryVersion/LibraryVersion.tsx | 8 +- .../Navigation/Navigation.scss | 19 ++- .../Navigation/Navigation.tsx | 21 ++- .../NavigationLayout/NavigationLayout.scss | 136 +++++++++++---- .../NavigationLayout/NavigationLayout.tsx | 105 ++++++------ .../SectionBlock/SectionBlock.scss | 44 +++-- .../SectionBlock/SectionBlock.tsx | 158 ++++++++++-------- src/mixins.scss | 22 +++ 14 files changed, 360 insertions(+), 187 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, +}) => ( +