diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 9f791a30d..d0d512f34 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -35,10 +35,10 @@ export default async function RootLayout({ let siteLang; try { - const { data } = await loadStudioQuery( + const { data } = await loadStudioQuery( DEFAULT_LANGUAGE_QUERY, ); - siteLang = data[0].id; + siteLang = data.id; } catch (error) { console.error("Error loading site settings:", error); siteLang = "en"; diff --git a/studio/components/LanguageSelector.tsx b/studio/components/LanguageSelector.tsx index 6564512a9..8f80614d2 100644 --- a/studio/components/LanguageSelector.tsx +++ b/studio/components/LanguageSelector.tsx @@ -46,7 +46,7 @@ const LanguageSelector = ({ value = [], onChange }: LanguageSelectorProps) => { const newDefaultLanguage = getNewDefaultLanguage( updatedValue, currentDefaultLanguage, - lang + lang, ); const finalValue = updatedValue.map((item) => ({ @@ -131,7 +131,7 @@ const LanguageSelector = ({ value = [], onChange }: LanguageSelectorProps) => { const getNewDefaultLanguage = ( updatedLanguages: Language[], currentDefault: string | null, - deselectedLang: Language + deselectedLang: Language, ): string | null => { if (updatedLanguages.length === 1) { return updatedLanguages[0].id; // Only one language left @@ -141,7 +141,7 @@ const getNewDefaultLanguage = ( // Find a new default language if the current default is deselected return ( supportedLanguages.find((lang) => - updatedLanguages.some((item) => item.id === lang.id) + updatedLanguages.some((item) => item.id === lang.id), )?.id || null ); } diff --git a/studio/deskStructure.ts b/studio/deskStructure.ts index 5a25a3ab9..7361593c5 100644 --- a/studio/deskStructure.ts +++ b/studio/deskStructure.ts @@ -43,21 +43,21 @@ const adminSection = (S: StructureBuilder) => S.document() .schemaType(companyInfoID) .documentId(companyInfoID) - .title("Parent Company") + .title("Parent Company"), ), S.listItem() .title("Company Locations") .icon(PinIcon) .child( - S.documentTypeList(companyLocationID).title("Company Locations") + S.documentTypeList(companyLocationID).title("Company Locations"), ), S.listItem() .title("Legal Documents") .icon(CogIcon) .child( - S.documentTypeList(legalDocumentID).title("Legal Documents") + S.documentTypeList(legalDocumentID).title("Legal Documents"), ), - ]) + ]), ); // Site Settings Section @@ -76,7 +76,7 @@ const siteSettingSection = (S: StructureBuilder) => S.document() .schemaType(brandAssetsID) .documentId(brandAssetsID) - .title("Brand Assets") + .title("Brand Assets"), ), S.listItem() .title("Navigation Manager") @@ -85,13 +85,13 @@ const siteSettingSection = (S: StructureBuilder) => S.document() .schemaType("navigationManager") .documentId("navigationManager") - .title("Navigation Manager") + .title("Navigation Manager"), ), S.listItem() .title("Social Media Profiles") .icon(UsersIcon) .child( - S.document().schemaType(soMeLinksID).documentId(soMeLinksID) + S.document().schemaType(soMeLinksID).documentId(soMeLinksID), ), S.listItem() .title("Languages") @@ -100,7 +100,7 @@ const siteSettingSection = (S: StructureBuilder) => S.document() .schemaType(languageSettingsID) .documentId(languageSettingsID) - .title("Languages") + .title("Languages"), ), S.listItem() .title("Default SEO") @@ -109,13 +109,13 @@ const siteSettingSection = (S: StructureBuilder) => S.document() .schemaType(defaultSeoID) .documentId(defaultSeoID) - .title("Default SEO") + .title("Default SEO"), ), S.listItem() .title("Broken Links") .icon(DoubleChevronRightIcon) .child(S.documentTypeList(brokenLinkID).title("Redirects")), - ]) + ]), ); // Section for dynamic and customizable Pages @@ -150,7 +150,7 @@ const specialPagesSection = (S: StructureBuilder) => S.document() .schemaType(compensationsId) .documentId(compensationsId) - .title("Compensations") + .title("Compensations"), ), S.listItem() .title("Customer Cases") @@ -159,9 +159,9 @@ const specialPagesSection = (S: StructureBuilder) => S.document() .schemaType(customerCasesPageID) .documentId(customerCasesPageID) - .title("Customer Cases") + .title("Customer Cases"), ), - ]) + ]), ); // Main export diff --git a/studio/lib/queries/languages.ts b/studio/lib/queries/languages.ts index e7c627801..c5d608f2f 100644 --- a/studio/lib/queries/languages.ts +++ b/studio/lib/queries/languages.ts @@ -1,3 +1,3 @@ import { groq } from "next-sanity"; -export const DEFAULT_LANGUAGE_QUERY = groq`*[_type == "languageSettings" && _id == "languageSettings"][0].languages[default]`; +export const DEFAULT_LANGUAGE_QUERY = groq`*[_type == "languageSettings" && _id == "languageSettings"][0].languages[default][0]`; diff --git a/studioShared/deskStructure.ts b/studioShared/deskStructure.ts index 49f052980..609041027 100644 --- a/studioShared/deskStructure.ts +++ b/studioShared/deskStructure.ts @@ -18,6 +18,6 @@ export const deskStructure: StructureResolver = (S) => .params({ type: customerCaseID, lang: defaultLanguage?.id, - }) + }), ), ]); diff --git a/studioShared/studioConfig.tsx b/studioShared/studioConfig.tsx index 921dfe8d2..d7e0d06f4 100644 --- a/studioShared/studioConfig.tsx +++ b/studioShared/studioConfig.tsx @@ -28,7 +28,7 @@ const config: WorkspaceOptions = { ...schema, templates: (prev) => prev.filter( - (template) => template.value.language === defaultLanguage?.id + (template) => template.value.language === defaultLanguage?.id, ), }, plugins: [