55 DerivedFieldLink ,
66 DerivedFieldLinkProps ,
77 Field ,
8+ FieldContainer ,
89 HasOne ,
910 Stack ,
1011 TextareaField ,
@@ -17,6 +18,7 @@ export interface SeoFieldProps {
1718 field : string
1819 titleDerivedFrom ?: DerivedFieldLinkProps [ 'derivedField' ]
1920 descriptionDerivedFrom ?: DerivedFieldLinkProps [ 'derivedField' ]
21+ compact ?: boolean
2022}
2123
2224const defaultSeoDictionary = {
@@ -93,7 +95,7 @@ export const seoDictionary = {
9395}
9496
9597export const SeoField = Component < SeoFieldProps > (
96- ( { titleDerivedFrom, descriptionDerivedFrom, field } ) => {
98+ ( { titleDerivedFrom, descriptionDerivedFrom, field, compact = true } ) => {
9799 const formatter = useMessageFormatter < SeoDictionary > ( defaultSeoDictionary )
98100
99101 return (
@@ -106,7 +108,7 @@ export const SeoField = Component<SeoFieldProps>(
106108 </ >
107109 ) }
108110 < HasOne field = { field } >
109- < Stack direction = " horizontal" >
111+ < Stack direction = { compact ? ' horizontal' : 'vertical' } >
110112 < Stack direction = "vertical" >
111113 < TextField field = "title" label = { formatter ( 'seo.title.label' ) } />
112114 < TextareaField field = "description" label = { formatter ( 'seo.description.label' ) } />
@@ -116,25 +118,29 @@ export const SeoField = Component<SeoFieldProps>(
116118 < TextareaField field = "ogDescription" label = { formatter ( 'seo.ogDescription.label' ) } />
117119 </ Stack >
118120 </ Stack >
119- < ImageField
120- field = "ogImage"
121- label = { formatter ( 'seo.ogImage.label' ) }
122- description = { formatter ( 'seo.ogImage.description' ) }
123- />
124- < Box heading = { formatter ( 'seo.robots.heading' ) } >
125- < CheckboxField
126- field = "noIndex"
127- label = { formatter ( 'seo.noIndex.label' ) }
128- labelDescription = { formatter ( 'seo.noIndex.description' ) }
129- notNull
121+ < Stack direction = { compact ? 'horizontal-reverse' : 'vertical' } >
122+ < ImageField
123+ field = "ogImage"
124+ label = { formatter ( 'seo.ogImage.label' ) }
125+ description = { formatter ( 'seo.ogImage.description' ) }
130126 />
131- < CheckboxField
132- field = "noFollow"
133- label = { formatter ( 'seo.noFollow.label' ) }
134- labelDescription = { formatter ( 'seo.noFollow.description' ) }
135- notNull
136- />
137- </ Box >
127+ < FieldContainer label = { formatter ( 'seo.robots.heading' ) } >
128+ < Box heading = { undefined } >
129+ < CheckboxField
130+ field = "noIndex"
131+ label = { formatter ( 'seo.noIndex.label' ) }
132+ labelDescription = { formatter ( 'seo.noIndex.description' ) }
133+ notNull
134+ />
135+ < CheckboxField
136+ field = "noFollow"
137+ label = { formatter ( 'seo.noFollow.label' ) }
138+ labelDescription = { formatter ( 'seo.noFollow.description' ) }
139+ notNull
140+ />
141+ </ Box >
142+ </ FieldContainer >
143+ </ Stack >
138144 </ HasOne >
139145 </ Box >
140146 )
0 commit comments