Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/blocks/CardLayout/CardLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import {AnimateBlock, BlockHeader} from '../../components';
import {AnimateBlock, Title} from '../../components';
import {Col, GridColumnSizesType, Row} from '../../grid';
import {CardLayoutBlockProps as CardLayoutBlockParams, WithChildren} from '../../models';
import {block} from '../../utils';
Expand All @@ -24,7 +24,7 @@ const CardLayout: React.FC<CardLayoutBlockProps> = ({
children,
}) => (
<AnimateBlock className={b()} animate={animated}>
<BlockHeader title={title} description={description} />
<Title title={title} subtitle={description} />
<Row>
{React.Children.map(children, (child, index) => (
<Col key={index} sizes={colSizes} className={b('item')}>
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/ExtendedFeatures/ExtendedFeatures.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {useContext} from 'react';

import {AnimateBlock, BlockHeader, HTML} from '../../components/';
import {AnimateBlock, HTML, Title} from '../../components/';
import Image from '../../components/Image/Image';
import {getMediaImage} from '../../components/Media/Image/utils';
import {ThemeValueContext} from '../../context/theme/ThemeValueContext';
Expand Down Expand Up @@ -30,7 +30,7 @@ export const ExtendedFeaturesBlock = ({

return (
<AnimateBlock className={b()} animate={animated}>
<BlockHeader title={title} description={description} className={b('header')} />
<Title title={title} subtitle={description} className={b('header')} />
<div className={b('items')}>
<Row>
{items.map(
Expand Down
6 changes: 3 additions & 3 deletions src/blocks/FilterBlock/FilterBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {useMemo, useState} from 'react';

import {AnimateBlock, BlockHeader} from '../../components';
import {AnimateBlock, Title} from '../../components';
import ButtonTabs, {ButtonTabsItemProps} from '../../components/ButtonTabs/ButtonTabs';
import {ConstructorBlocks} from '../../containers/PageConstructor/components/ConstructorBlocks';
import {Col, Row} from '../../grid';
Expand Down Expand Up @@ -58,10 +58,10 @@ const FilterBlock: React.FC<FilterBlockProps> = ({
return (
<AnimateBlock className={b()} animate={animated}>
{title && (
<BlockHeader
<Title
className={b('title', {centered: centered})}
title={title}
description={description}
subtitle={description}
/>
)}
{tabButtons.length && (
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/Icons/Icons.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {useContext} from 'react';

import {BlockHeader, Image} from '../../components';
import {Image, Title} from '../../components';
import {LocationContext} from '../../context/locationContext';
import {IconsBlockProps} from '../../models';
import {block, getLinkProps} from '../../utils';
Expand All @@ -14,7 +14,7 @@ const Icons = ({title, size = 's', items}: IconsBlockProps) => {

return (
<div className={b({size})}>
{title && <BlockHeader className={b('header')} title={title} colSizes={{all: 12}} />}
{title && <Title className={b('header')} title={title} colSizes={{all: 12}} />}
{items.map((item) => (
<a
className={b('item')}
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/PromoFeaturesBlock/PromoFeaturesBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';

import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
import BalancedMasonry from '../../components/BalancedMasonry/BalancedMasonry';
import BlockHeader from '../../components/BlockHeader/BlockHeader';
import FullWidthBackground from '../../components/FullWidthBackground/FullWidthBackground';
import Media from '../../components/Media/Media';
import Title from '../../components/Title/Title';
import YFMWrapper from '../../components/YFMWrapper/YFMWrapper';
import {BREAKPOINTS} from '../../constants';
import {PromoFeaturesProps} from '../../models';
Expand All @@ -27,7 +27,7 @@ const PromoFeaturesBlock = (props: PromoFeaturesProps) => {
return (
<AnimateBlock className={b({[backgroundTheme]: true})} animate={animated}>
<FullWidthBackground className={b('background', {[backgroundTheme]: true})} />
<BlockHeader title={title} description={description} className={b('header')} />
<Title title={title} subtitle={description} className={b('header')} />
<BalancedMasonry
breakpointCols={breakpointColumns}
className={b('card-container')}
Expand Down
6 changes: 3 additions & 3 deletions src/blocks/Slider/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import SlickSlider, {Settings} from 'react-slick';

import Anchor from '../../components/Anchor/Anchor';
import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
import BlockHeader from '../../components/BlockHeader/BlockHeader';
import OutsideClick from '../../components/OutsideClick/OutsideClick';
import Title from '../../components/Title/Title';
import {BREAKPOINTS} from '../../constants';
import {MobileContext} from '../../context/mobileContext';
import {SSRContext} from '../../context/ssrContext';
Expand Down Expand Up @@ -319,9 +319,9 @@ export const SliderBlock = (props: WithChildren<SliderProps>) => {
)}
>
{anchorId && <Anchor id={anchorId} />}
<BlockHeader
<Title
title={title}
description={description}
subtitle={description}
className={b('header', {'no-description': !description})}
/>
<AnimateBlock className={b('animate-slides')} animate={animated}>
Expand Down
6 changes: 3 additions & 3 deletions src/blocks/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, {Fragment, useContext, useRef, useState} from 'react';

import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
import BlockHeader from '../../components/BlockHeader/BlockHeader';
import ButtonTabs, {ButtonTabsItemProps} from '../../components/ButtonTabs/ButtonTabs';
import FullScreenImage from '../../components/FullscreenImage/FullscreenImage';
import {getMediaImage} from '../../components/Media/Image/utils';
import Media from '../../components/Media/Media';
import Title from '../../components/Title/Title';
import {getHeight} from '../../components/VideoBlock/VideoBlock';
import {ThemeValueContext} from '../../context/theme/ThemeValueContext';
import {Col, GridColumnOrderClasses, Row} from '../../grid';
Expand Down Expand Up @@ -112,9 +112,9 @@ export const TabsBlock = ({

return (
<AnimateBlock className={b()} onScroll={() => setPlay(true)} animate={animated}>
<BlockHeader
<Title
title={title}
description={description}
subtitle={description}
className={b('block-title', {centered: centered})}
/>
<Row>
Expand Down
23 changes: 0 additions & 23 deletions src/components/BlockHeader/BlockHeader.scss

This file was deleted.

48 changes: 0 additions & 48 deletions src/components/BlockHeader/BlockHeader.tsx

This file was deleted.

62 changes: 0 additions & 62 deletions src/components/BlockHeader/__stories__/BlockHeader.stories.tsx

This file was deleted.

43 changes: 0 additions & 43 deletions src/components/BlockHeader/__stories__/data.json

This file was deleted.

9 changes: 7 additions & 2 deletions src/components/MediaBase/MediaBase.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, {ReactElement, useMemo} from 'react';

import AnimateBlock from '../../components/AnimateBlock/AnimateBlock';
import BlockHeader from '../../components/BlockHeader/BlockHeader';
import {Col, Grid, GridColumnSize, Row} from '../../grid';
import {MediaBaseBlockProps, WithChildren} from '../../models';
import {block} from '../../utils';
import Title from '../Title/Title';

import MediaContent from './MediaBaseContent';

Expand Down Expand Up @@ -49,7 +49,12 @@ export const MediaBase = (props: MediaBaseProps) => {
return (
<AnimateBlock className={b()} onScroll={onScroll} animate={animated}>
{mediaOnly && (
<BlockHeader className={b('header')} title={title} description={description} />
<Title
className={b('header')}
title={title}
subtitle={description}
colSizes={{all: 12}}
/>
)}
<Grid>
<Row
Expand Down
14 changes: 10 additions & 4 deletions src/components/Title/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
`type: "title"`

`text: text` — Title text
`title:`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be a description of the prop here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is in the line 13.
Or you mean the title himself?
It's an object with properties below

  • text
  • textSize
  • url
  • resetMargin


`textSize?: 's' | 'm' | 'l'` Title font size
- `text: string` - Title text

`url?: string` — URL for a redirect on clicking the title, an arrow is automatically added at the end.
- `textSize?: 's' | 'm' | 'l'` — Title font size

**Margins:**
- `url?: string` — URL for a redirect on clicking the title, an arrow is automatically added at the end.

- `resetMargin?: boolean` - default `true`. Without this property `margin-top` will be proportional to `textSize` (see section _Margins_ below)

`description: string` - text (with YFM support)

**Margins for title without reset:**

`textSize s - top: m`

Expand Down
Loading