diff --git a/packages/plugin-seo/src/fields/MetaDescription.tsx b/packages/plugin-seo/src/fields/MetaDescription.tsx index 326af2ef7..5459945ec 100644 --- a/packages/plugin-seo/src/fields/MetaDescription.tsx +++ b/packages/plugin-seo/src/fields/MetaDescription.tsx @@ -23,7 +23,7 @@ type MetaDescriptionProps = FormFieldBase & { export const MetaDescription: React.FC = (props) => { const { Label, hasGenerateDescriptionFn, path, required } = props - const { path: pathFromContext, schemaPath } = useFieldPath() + const { path: pathFromContext } = useFieldPath() const { t } = useTranslation() diff --git a/packages/plugin-seo/src/fields/MetaImage.tsx b/packages/plugin-seo/src/fields/MetaImage.tsx index b4a62b7ca..016288d89 100644 --- a/packages/plugin-seo/src/fields/MetaImage.tsx +++ b/packages/plugin-seo/src/fields/MetaImage.tsx @@ -23,7 +23,7 @@ type MetaImageProps = UploadInputProps & { } export const MetaImage: React.FC = (props) => { - const { Label, hasGenerateImageFn, path, relationTo, required } = props || {} + const { Label, hasGenerateImageFn, relationTo, required } = props || {} const field: FieldType = useField(props as Options) diff --git a/packages/plugin-seo/src/fields/MetaTitle.tsx b/packages/plugin-seo/src/fields/MetaTitle.tsx index ac327911d..f643e3e38 100644 --- a/packages/plugin-seo/src/fields/MetaTitle.tsx +++ b/packages/plugin-seo/src/fields/MetaTitle.tsx @@ -28,7 +28,7 @@ type MetaTitleProps = FormFieldBase & { export const MetaTitle: React.FC = (props) => { const { Label, hasGenerateTitleFn, path, required } = props || {} - const { path: pathFromContext, schemaPath } = useFieldPath() + const { path: pathFromContext } = useFieldPath() const { t } = useTranslation() diff --git a/packages/plugin-seo/src/index.tsx b/packages/plugin-seo/src/index.tsx index 8f48a5869..10a0b42bd 100644 --- a/packages/plugin-seo/src/index.tsx +++ b/packages/plugin-seo/src/index.tsx @@ -15,7 +15,7 @@ import type { import { MetaDescription } from './fields/MetaDescription.js' import { MetaImage } from './fields/MetaImage.js' import { MetaTitle } from './fields/MetaTitle.js' -import translations from './translations/index.js' +import { translations } from './translations/index.js' import { Overview } from './ui/Overview.js' import { Preview } from './ui/Preview.js' @@ -139,8 +139,8 @@ const seo = tabs: [ // append a new tab onto the end of the tabs array, if there is one at the first index // if needed, create a new `Content` tab in the first index for this collection's base fields - ...(collection?.fields?.[0]?.type === 'tabs' - ? collection.fields[0]?.tabs + ...(collection?.fields?.[0]?.type === 'tabs' && collection?.fields?.[0]?.tabs + ? collection.fields[0].tabs : [ { fields: [ @@ -234,8 +234,8 @@ const seo = tabs: [ // append a new tab onto the end of the tabs array, if there is one at the first index // if needed, create a new `Content` tab in the first index for this global's base fields - ...(global?.fields?.[0].type === 'tabs' - ? global.fields[0]?.tabs + ...(global?.fields?.[0].type === 'tabs' && global?.fields?.[0].tabs + ? global.fields[0].tabs : [ { fields: [...(global?.fields || [])], @@ -254,7 +254,7 @@ const seo = ...global, fields: [ ...seoTabs, - ...(global?.fields?.[0].type === 'tabs' ? global?.fields?.slice(1) : []), + ...(global?.fields?.[0].type === 'tabs' ? global.fields.slice(1) : []), ], } } @@ -276,4 +276,4 @@ const seo = } } -export default seo +export { seo } diff --git a/packages/plugin-seo/src/translations/index.ts b/packages/plugin-seo/src/translations/index.ts index bb5bd3bec..6b589b365 100644 --- a/packages/plugin-seo/src/translations/index.ts +++ b/packages/plugin-seo/src/translations/index.ts @@ -4,10 +4,4 @@ import fa from './fa.json' import fr from './fr.json' import pl from './pl.json' -export default { - en, - es, - fa, - fr, - pl, -} +export const translations = { en, es, fa, fr, pl } diff --git a/packages/plugin-seo/src/ui/LengthIndicator.tsx b/packages/plugin-seo/src/ui/LengthIndicator.tsx index a19860ad0..45ce9a405 100644 --- a/packages/plugin-seo/src/ui/LengthIndicator.tsx +++ b/packages/plugin-seo/src/ui/LengthIndicator.tsx @@ -72,7 +72,7 @@ export const LengthIndicator: React.FC<{ setBarWidth(1) } } - }, [minLength, maxLength, text]) + }, [minLength, maxLength, text, t]) const textLength = text?.length || 0