Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
christinaroise committed Sep 23, 2024
1 parent 635729b commit bd9efed
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ export default async function RootLayout({
let siteLang;

try {
const { data } = await loadStudioQuery<LanguageObject[]>(
const { data } = await loadStudioQuery<LanguageObject>(
DEFAULT_LANGUAGE_QUERY,
);
siteLang = data[0].id;
siteLang = data.id;
} catch (error) {
console.error("Error loading site settings:", error);
siteLang = "en";
Expand Down
6 changes: 3 additions & 3 deletions studio/components/LanguageSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const LanguageSelector = ({ value = [], onChange }: LanguageSelectorProps) => {
const newDefaultLanguage = getNewDefaultLanguage(
updatedValue,
currentDefaultLanguage,
lang
lang,
);

const finalValue = updatedValue.map((item) => ({
Expand Down Expand Up @@ -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
Expand All @@ -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
);
}
Expand Down
26 changes: 13 additions & 13 deletions studio/deskStructure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -100,7 +100,7 @@ const siteSettingSection = (S: StructureBuilder) =>
S.document()
.schemaType(languageSettingsID)
.documentId(languageSettingsID)
.title("Languages")
.title("Languages"),
),
S.listItem()
.title("Default SEO")
Expand All @@ -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
Expand Down Expand Up @@ -150,7 +150,7 @@ const specialPagesSection = (S: StructureBuilder) =>
S.document()
.schemaType(compensationsId)
.documentId(compensationsId)
.title("Compensations")
.title("Compensations"),
),
S.listItem()
.title("Customer Cases")
Expand All @@ -159,9 +159,9 @@ const specialPagesSection = (S: StructureBuilder) =>
S.document()
.schemaType(customerCasesPageID)
.documentId(customerCasesPageID)
.title("Customer Cases")
.title("Customer Cases"),
),
])
]),
);

// Main export
Expand Down
2 changes: 1 addition & 1 deletion studio/lib/queries/languages.ts
Original file line number Diff line number Diff line change
@@ -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]`;
2 changes: 1 addition & 1 deletion studioShared/deskStructure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export const deskStructure: StructureResolver = (S) =>
.params({
type: customerCaseID,
lang: defaultLanguage?.id,
})
}),
),
]);
2 changes: 1 addition & 1 deletion studioShared/studioConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

0 comments on commit bd9efed

Please sign in to comment.