File tree Expand file tree Collapse file tree 8 files changed +15
-16
lines changed Expand file tree Collapse file tree 8 files changed +15
-16
lines changed Original file line number Diff line number Diff line change 1515 "type" : " blog-feed-block" ,
1616 "resetPaddings" : true ,
1717 "image" : " https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img_8-12_light.png" ,
18- "title" : {
19- "text" : " Blog" ,
20- "textSize" : " l"
21- }
18+ "title" : " Blog"
2219 }
2320 ]
2421 },
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ export const getDefaultStoryArgs = () => {
4242 paddingTop : 'l' ,
4343 text : 'Lorem ipsum dolor' ,
4444 image : 'https://storage.yandexcloud.net/cloud-www-assets/constructor/storybook/images/img_8-12_light.png' ,
45+ title : 'Blog' ,
4546 } ;
4647} ;
4748
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const CONTAINER_ID = 'blog-cards';
2121const PAGE_QUERY = 'page' ;
2222const FIRST_PAGE = 1 ;
2323
24- export const Feed = ( { image} : FeedProps ) => {
24+ export const Feed = ( { image, title } : FeedProps ) => {
2525 const {
2626 posts,
2727 totalCount,
@@ -239,6 +239,7 @@ export const Feed = ({image}: FeedProps) => {
239239 url : image ,
240240 disableCompress : true ,
241241 } }
242+ title = { title }
242243 />
243244 { errorLoad ? (
244245 < PostsError onButtonClick = { handleOnErrorReload } />
Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ The data in this component is taken from contexts.
33| Property | Type | Required | Description |
44| :------- | :------- | :------- | :-------------------- |
55| image | ` string ` | ` true ` | Image for feed header |
6+ | title | ` string ` | ` false ` | Title for feed header |
Original file line number Diff line number Diff line change 11import { validators } from '@gravity-ui/page-constructor' ;
22
33const {
4- common : { TitleProps , BlockBaseProps} ,
4+ common : { BlockBaseProps} ,
55} = validators ;
66
77import { BlockType } from '../../models/common' ;
88
99export const Feed = {
1010 [ BlockType . Feed ] : {
1111 additionalProperties : false ,
12- required : [ ] ,
12+ required : 'image' ,
1313 properties : {
1414 ...BlockBaseProps ,
15- title : TitleProps ,
16- image : {
17- type : 'string' ,
18- } ,
19- description : {
15+ title : {
2016 type : 'string' ,
21- contentType : 'text' ,
2217 } ,
23- size : {
18+ image : {
2419 type : 'string' ,
25- enum : [ 's' , 'm' ] ,
2620 } ,
2721 } ,
2822 } ,
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export const FeedHeader = ({
3131 verticalOffset = 'l' ,
3232 className,
3333 queryParams,
34+ title,
3435} : FeedHeaderContainerProps ) => {
3536 const backgroundThemed = background && getThemedValue ( background , theme as Theme ) ;
3637
@@ -57,6 +58,7 @@ export const FeedHeader = ({
5758 />
5859 ) : null }
5960 < Controls
61+ title = { title }
6062 tags = { tags }
6163 services = { services }
6264 handleLoadData = { handleLoadData }
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export type ControlsProps = {
3131 tags ?: SelectItem [ ] ;
3232 services ?: SelectItem [ ] ;
3333 queryParams : Query ;
34+ title ?: string ;
3435} ;
3536
3637const ICON_SIZE = 16 ;
@@ -42,6 +43,7 @@ export const Controls = ({
4243 tags = [ ] ,
4344 services = [ ] ,
4445 queryParams,
46+ title = i18n ( Keyset . Title ) ,
4547} : ControlsProps ) => {
4648 const { hasLikes} = React . useContext ( LikesContext ) ;
4749 const handleAnalyticsTag = useAnalytics ( DefaultEventNames . Tag ) ;
@@ -142,7 +144,7 @@ export const Controls = ({
142144 return (
143145 < MobileProvider mobile = { false } >
144146 < div className = { b ( 'header' ) } >
145- < h1 className = { b ( 'header-item' , { title : true } ) } > { i18n ( Keyset . Title ) } </ h1 >
147+ < h1 className = { b ( 'header-item' , { title : true } ) } > { title } </ h1 >
146148 < div className = { b ( 'header-item' , { filters : true } ) } >
147149 < div className = { b ( 'filter-item' ) } >
148150 < Search
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ export type YFMProps = {
8484
8585export type FeedProps = {
8686 image : string ;
87+ title ?: string ;
8788} ;
8889
8990export type FormProps = {
You can’t perform that action at this time.
0 commit comments