Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added '0' vertical offset for header block #751

Merged
merged 1 commit into from
Dec 11, 2023
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
2 changes: 1 addition & 1 deletion src/blocks/Header/__stories__/Header.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ There could be only one one Header block on the page.

`theme?: default | dark` — Sets the text color (black by default, white for the dark background).

`verticalOffset?: 's' | 'm' | 'l' | 'xl'` — Top and bottom offsets from the text. (Values: 's' - 48px, 'm' - 80px, 'l' - 112px, 'xl' - 144px.)
`verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl'` — Top and bottom offsets from the text. (Values: '0' - 0px, 's' - 48px, 'm' - 80px, 'l' - 112px, 'xl' - 144px.)
</StoryTemplate>

`mediaView?: full | fit` — full is default value, the media content covers all widht and height. Fit - media content has real sizes and locates in the middle
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 @@ -80,6 +80,7 @@ const FitTemplate: StoryFn<HeaderBlockModel> = (args) => (

const VerticalOffsetTemplate: StoryFn<HeaderBlockModel> = (args) => (
<Fragment>
<DefaultTemplate {...args} title={getVerticalOffsetTitle('«0»')} verticalOffset="0" />
<DefaultTemplate {...args} title={getVerticalOffsetTitle('«S»')} verticalOffset="s" />
<DefaultTemplate {...args} title={getVerticalOffsetTitle('«M»')} verticalOffset="m" />
<DefaultTemplate {...args} title={getVerticalOffsetTitle('«L»')} verticalOffset="l" />
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/Header/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const HeaderProperties = {
},
verticalOffset: {
type: 'string',
enum: ['s', 'm', 'l', 'xl'],
enum: ['0', 's', 'm', 'l', 'xl'],
},
background: withTheme(HeaderBackgroundProps),
theme: {
Expand Down
2 changes: 1 addition & 1 deletion src/models/constructor-items/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export interface HeaderBlockProps {
mediaView?: 'fit' | 'full';
background?: ThemedHeaderBlockBackground;
theme?: 'light' | 'dark';
verticalOffset?: 's' | 'm' | 'l' | 'xl';
verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';
breadcrumbs?: HeaderBreadCrumbsProps;
status?: JSX.Element;
renderTitle?: (title: string) => React.ReactNode;
Expand Down
Loading