From 48a661e8e5a234a382f5e934b12fd6149e33f202 Mon Sep 17 00:00:00 2001 From: birman111 Date: Tue, 20 Jul 2021 05:35:23 +0300 Subject: [PATCH] refactor: address review feedback --- .../DocLeadingPage/DocLeadingPage.scss | 4 ++-- .../DocLeadingPage/DocLeadingPage.tsx | 18 ++++++++++++------ src/demo/Components/DocLeadingPage/index.tsx | 4 +--- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/components/DocLeadingPage/DocLeadingPage.scss b/src/components/DocLeadingPage/DocLeadingPage.scss index bbbc09fc..6cf56050 100644 --- a/src/components/DocLeadingPage/DocLeadingPage.scss +++ b/src/components/DocLeadingPage/DocLeadingPage.scss @@ -42,7 +42,7 @@ &_root { flex-direction: row; margin-top: 70px; - margin-bottom: -20px; + margin-bottom: -$blockMarginBottomLarge; } } @@ -57,7 +57,7 @@ max-width: 400px; width: calc(50% - 20px); padding-bottom: 40px; - margin-bottom: 20px; + margin-bottom: $blockMarginBottomLarge; border-bottom: 1px solid var(--yc-color-line-generic); } } diff --git a/src/components/DocLeadingPage/DocLeadingPage.tsx b/src/components/DocLeadingPage/DocLeadingPage.tsx index 86d0169e..e957b906 100644 --- a/src/components/DocLeadingPage/DocLeadingPage.tsx +++ b/src/components/DocLeadingPage/DocLeadingPage.tsx @@ -46,13 +46,19 @@ const renderLeft = (data: DocLeadingLinks, isRoot?: boolean) => { const renderRight = (data: DocLeadingLinks, isRoot?: boolean) => { const {title, description, href, links} = data; + let titleContent; - let titleContent = href - ? {title} - : title; - titleContent = isRoot - ?

{titleContent}

- :
{titleContent}
; + if (href) { + titleContent = {title}; + } else { + titleContent = title; + } + + if (isRoot) { + titleContent =

{titleContent}

; + } else { + titleContent =
{titleContent}
; + } return ( diff --git a/src/demo/Components/DocLeadingPage/index.tsx b/src/demo/Components/DocLeadingPage/index.tsx index 22e912d9..16d5672b 100644 --- a/src/demo/Components/DocLeadingPage/index.tsx +++ b/src/demo/Components/DocLeadingPage/index.tsx @@ -1,8 +1,6 @@ import React, {useState} from 'react'; import cn from 'bem-cn-lite'; -import { - DocLeadingPage, -} from '../../../index'; +import {DocLeadingPage} from '../../../index'; import Header from '../Header/Header'; import {DEFAULT_SETTINGS} from '../../../constants'; import {getIsMobile} from '../../controls/settings';