Skip to content

Commit

Permalink
refactor: address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
yndx-birman committed Jul 20, 2021
1 parent b3446a1 commit 48a661e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/components/DocLeadingPage/DocLeadingPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
&_root {
flex-direction: row;
margin-top: 70px;
margin-bottom: -20px;
margin-bottom: -$blockMarginBottomLarge;
}
}

Expand All @@ -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);
}
}
Expand Down
18 changes: 12 additions & 6 deletions src/components/DocLeadingPage/DocLeadingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
? <a href={href} className={b('links-link')}>{title}</a>
: title;
titleContent = isRoot
? <h2 className={b('links-title', {root: isRoot})}>{titleContent}</h2>
: <div className={b('links-title')}>{titleContent}</div>;
if (href) {
titleContent = <a href={href} className={b('links-link')}>{title}</a>;
} else {
titleContent = title;
}

if (isRoot) {
titleContent = <h2 className={b('links-title', {root: isRoot})}>{titleContent}</h2>;
} else {
titleContent = <div className={b('links-title')}>{titleContent}</div>;
}


return (
Expand Down
4 changes: 1 addition & 3 deletions src/demo/Components/DocLeadingPage/index.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit 48a661e

Please sign in to comment.