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
23 changes: 22 additions & 1 deletion src/blocks/Header/Header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ $block: '.#{$ns}header-block';
$backgroundWidth: 1440px;

#{$block} {
$root: &;

position: relative;

&_full-width {
Expand Down Expand Up @@ -36,6 +38,14 @@ $backgroundWidth: 1440px;
color: var(--g-color-text-light-primary);
}
}

#{$block}__additional-info {
.yfm p {
color: var(
--g-color-text-light-secondary
) !important; /* stylelint-disable-line declaration-no-important */ // the selector that interrupts this color is too big;
}
}
}

&_vertical-offset {
Expand Down Expand Up @@ -97,6 +107,17 @@ $backgroundWidth: 1440px;
}
}

&__additional-info {
margin-top: $indentXS;

.yfm p {
@include text-size(body-2);
color: var(
--g-color-text-secondary
) !important; /* stylelint-disable-line declaration-no-important */ // the selector that interrupts this color is too big
}
}

&__buttons {
margin-top: $indentXS;
}
Expand All @@ -106,7 +127,7 @@ $backgroundWidth: 1440px;
margin-top: $indentXS;

&:not(:last-child) {
margin-right: $indentXS;
margin-right: $indentXXS;
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions src/blocks/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>
children,
mediaView = 'full',
centered,
additionalInfo,
} = props;
const isMobile = React.useContext(MobileContext);
const theme = useTheme();
Expand Down Expand Up @@ -165,6 +166,17 @@ export const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>
/>
</div>
)}
{additionalInfo && (
<div className={b('additional-info', {theme: textTheme})}>
<YFMWrapper
content={additionalInfo}
modifiers={{
constructor: true,
constructorTheme: textTheme,
}}
/>
</div>
)}
{buttons && (
<div className={b('buttons')} data-qa="header-buttons">
{buttons.map((button, index) => (
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/blocks/Header/__stories__/Header.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default {
const DefaultArgs = {
...data.default.content,
description: yfmTransform(data.default.content.description),
additionalInfo: yfmTransform(data.default.content.additionalInfo),
};

const DefaultTemplate: StoryFn<HeaderBlockModel> = (args) => (
Expand Down
1 change: 1 addition & 0 deletions src/blocks/Header/__stories__/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"type": "header-block",
"title": "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
"description": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
"additionalInfo": "**Ut enim ad minim veniam** ut aliquip ex ea commodo consequat. Duis aute irure [quis nostrud](https://example.com) dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
"buttons": [
{
"text": "Button\r",
Expand Down
1 change: 1 addition & 0 deletions src/models/constructor-items/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export interface HeaderBlockProps {
title: string;
overtitle?: string | JSX.Element;
description?: string;
additionalInfo?: string;
buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];
width?: HeaderWidth;
/** @deprecated imageSize now depends on width */
Expand Down
2 changes: 1 addition & 1 deletion src/text-transform/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const blockHeaderTransformer = [
parser: parseTitle,
},
{
fields: ['description'],
fields: ['description', 'additionalInfo'],
transformer: yfmTransformer,
},
];
Expand Down