diff options
Diffstat (limited to 'sanity/schemas')
| -rw-r--r-- | sanity/schemas/_locales.ts | 8 | ||||
| -rw-r--r-- | sanity/schemas/contact.ts | 64 | ||||
| -rw-r--r-- | sanity/schemas/description.ts | 40 | ||||
| -rw-r--r-- | sanity/schemas/hero.ts | 58 | ||||
| -rw-r--r-- | sanity/schemas/index.ts | 2 | ||||
| -rw-r--r-- | sanity/schemas/localized-string.ts | 36 |
6 files changed, 103 insertions, 105 deletions
diff --git a/sanity/schemas/_locales.ts b/sanity/schemas/_locales.ts index 8baca54..20273bd 100644 --- a/sanity/schemas/_locales.ts +++ b/sanity/schemas/_locales.ts @@ -1,5 +1,5 @@ export const supportedLanguages = [ - { id: 'en', iso: "en-GB", title: 'English' }, - { id: 'nb', iso: "nb-NO", title: 'Norwegian', isDefault: true }, -] -export const baseLanguage = supportedLanguages.find(l => l.isDefault) as { id: string, title: string };
\ No newline at end of file + {id: "en", iso: "en-GB", title: "English"}, + {id: "nb", iso: "nb-NO", title: "Norwegian", isDefault: true}, +]; +export const baseLanguage = supportedLanguages.find((l) => l.isDefault) as {id: string; title: string}; diff --git a/sanity/schemas/contact.ts b/sanity/schemas/contact.ts index 33bda69..1543e07 100644 --- a/sanity/schemas/contact.ts +++ b/sanity/schemas/contact.ts @@ -1,35 +1,35 @@ -import { baseLanguage } from "./_locales"; +import {baseLanguage} from "./_locales"; export default { - name: 'contact', - type: 'document', - title: 'Contact section', - preview: { - select: { - title: `title.${baseLanguage.id}` - } + name: "contact", + type: "document", + title: "Contact section", + preview: { + select: { + title: `title.${baseLanguage.id}`, }, - fields: [ - { - title: "Address lines", - name: 'addressLines', - type: 'array', - of: [{ type: 'localizedString' }] - }, - { - title: "Email", - name: "email", - type: "string", - }, - { - title: "Phone", - name: "phone", - type: "string" - }, - { - title: "Phone hours", - name: "phoneHours", - type: "localizedString" - } - ] -}
\ No newline at end of file + }, + fields: [ + { + title: "Address lines", + name: "addressLines", + type: "array", + of: [{type: "localizedString"}], + }, + { + title: "Email", + name: "email", + type: "string", + }, + { + title: "Phone", + name: "phone", + type: "string", + }, + { + title: "Phone hours", + name: "phoneHours", + type: "localizedString", + }, + ], +}; diff --git a/sanity/schemas/description.ts b/sanity/schemas/description.ts index d5d5ff3..f3fac23 100644 --- a/sanity/schemas/description.ts +++ b/sanity/schemas/description.ts @@ -1,23 +1,21 @@ -import { defineType } from "sanity"; +import {defineType} from "sanity"; export default defineType({ - name: 'description', - type: 'document', - title: 'Description section', - i18n: true, - fields: [ - { - title: "Title", - name: 'title', - type: 'string', - }, - { - title: "Content", - name: "content", - type: "array", - of: [ - { type: "block" } - ] - } - ] -})
\ No newline at end of file + name: "description", + type: "document", + title: "Description section", + i18n: true, + fields: [ + { + title: "Title", + name: "title", + type: "string", + }, + { + title: "Content", + name: "content", + type: "array", + of: [{type: "block"}], + }, + ], +}); diff --git a/sanity/schemas/hero.ts b/sanity/schemas/hero.ts index 8534675..30abd1c 100644 --- a/sanity/schemas/hero.ts +++ b/sanity/schemas/hero.ts @@ -1,33 +1,33 @@ -import { defineType } from "sanity"; +import {defineType} from "sanity"; export default defineType({ - name: 'hero', - type: 'document', - title: 'Hero section', - i18n: true, - fields: [ + name: "hero", + type: "document", + title: "Hero section", + i18n: true, + fields: [ + { + title: "Title", + name: "title", + type: "string", + }, + { + title: "Content", + name: "content", + type: "array", + of: [{type: "block"}], + }, + { + title: "Image", + name: "image", + type: "image", + fields: [ { - title: "Title", - name: 'title', - type: 'string', + title: "Alternative text", + name: "alt", + type: "string", }, - { - title: "Content", - name: "content", - type: "array", - of: [{ type: "block" }] - }, - { - title: "Image", - name: "image", - type: "image", - fields: [ - { - title: "Alternative text", - name: 'alt', - type: 'string', - } - ] - } - ] -})
\ No newline at end of file + ], + }, + ], +}); diff --git a/sanity/schemas/index.ts b/sanity/schemas/index.ts index 9dfc403..76072e5 100644 --- a/sanity/schemas/index.ts +++ b/sanity/schemas/index.ts @@ -3,4 +3,4 @@ import description from "./description"; import hero from "./hero"; import localizedString from "./localized-string"; -export const schemaTypes = [contact, localizedString, description, hero]
\ No newline at end of file +export const schemaTypes = [contact, localizedString, description, hero]; diff --git a/sanity/schemas/localized-string.ts b/sanity/schemas/localized-string.ts index 6ff7424..e4bcff6 100644 --- a/sanity/schemas/localized-string.ts +++ b/sanity/schemas/localized-string.ts @@ -1,20 +1,20 @@ -import { supportedLanguages } from "./_locales"; +import {supportedLanguages} from "./_locales"; export default { - title: 'Localized string', - name: 'localizedString', - type: 'object', - fieldsets: [ - { - title: 'Translations', - name: 'translations', - options: { collapsible: true } - } - ], - fields: supportedLanguages.map(lang => ({ - title: lang.title, - name: lang.id, - type: 'string', - fieldset: lang.isDefault ? null : 'translations' - })) -} + title: "Localized string", + name: "localizedString", + type: "object", + fieldsets: [ + { + title: "Translations", + name: "translations", + options: {collapsible: true}, + }, + ], + fields: supportedLanguages.map((lang) => ({ + title: lang.title, + name: lang.id, + type: "string", + fieldset: lang.isDefault ? null : "translations", + })), +}; |
