Gwk-Cultural-Park/schemas/wedding/wedding.ts

85 lines
2.3 KiB
TypeScript
Raw Normal View History

2024-09-16 13:03:05 +00:00
/* eslint-disable import/no-anonymous-default-export */
2024-09-07 01:40:25 +00:00
import { format, parseISO } from 'date-fns'
import { TiPuzzleOutline } from 'react-icons/ti'
import { defineField, defineType } from 'sanity'
import weddingpost from './weddingpost'
import weddingPackage from './weddingPackage'
2024-09-08 08:25:35 +00:00
import gallery from 'schemas/gallery'
2024-09-07 01:40:25 +00:00
export default {
name: 'WeddingSection',
title: 'Wedding Page',
icon: TiPuzzleOutline,
type: 'document',
fields: [
{
name: 'title',
title: 'Title Page',
description: 'Judul halaman',
type: 'string',
2024-09-16 13:03:05 +00:00
// validation: (rule) => rule.required(),
2024-09-07 01:40:25 +00:00
},
{
name: 'subtitle',
title: 'Sub Title Page',
description: 'Sub judul halaman',
type: 'string',
2024-09-16 13:03:05 +00:00
// validation: (rule) => rule.required(),
2024-09-07 01:40:25 +00:00
},
{
name: 'coverImage',
title: 'Image',
description: 'Image untuk cover',
type: 'image',
options: {
hotspot: true,
},
},
{
name: 'descriptionTitle',
title: 'Description Title',
description: 'Judul deskripsi',
type: 'string',
validation: (rule) => rule.required(),
},
defineField({
name: 'content',
title: 'Description',
2024-09-16 13:03:05 +00:00
description: 'Paragraf utama',
2024-09-07 01:40:25 +00:00
type: 'array',
of: [{ type: 'block' }],
}),
{
name: 'Wedding',
2024-09-08 08:25:35 +00:00
title: 'Wedding Gallery',
description: 'Tambahkan gallery wedding',
2024-09-07 01:40:25 +00:00
type: 'array',
of: [
{
type: 'reference',
2024-09-08 08:25:35 +00:00
to: { type: gallery.name },
2024-09-07 01:40:25 +00:00
},
],
},
2024-09-08 08:25:35 +00:00
defineField({
title: 'Pixieset URL',
name: 'pixiesetURL',
type: 'url',
description: 'Alamat album di Pixieset',
}),
2024-09-07 01:40:25 +00:00
{
name: 'Weddingpackage',
title: 'Wedding Package',
description: 'Daftar paket wedding',
type: 'array',
of: [
{
type: 'reference',
to: { type: weddingPackage.name },
},
],
},
],
}