50 lines
1.0 KiB
TypeScript
50 lines
1.0 KiB
TypeScript
import { format, parseISO } from 'date-fns'
|
|
import { TiPuzzleOutline } from 'react-icons/ti'
|
|
import { defineField, defineType } from 'sanity'
|
|
|
|
import event from './event'
|
|
|
|
export default {
|
|
name: 'eventSection',
|
|
title: 'Event Page',
|
|
icon: TiPuzzleOutline,
|
|
type: 'document',
|
|
fields: [
|
|
{
|
|
name: 'title',
|
|
title: 'Title Page',
|
|
description: 'Judul halaman',
|
|
type: 'string',
|
|
validation: (rule) => rule.required(),
|
|
},
|
|
{
|
|
name: 'subtitle',
|
|
title: 'Sub Title Page',
|
|
description: 'Sub judul halaman',
|
|
type: 'string',
|
|
validation: (rule) => rule.required(),
|
|
},
|
|
{
|
|
name: 'coverImage',
|
|
title: 'Image',
|
|
description: 'Image untuk cover',
|
|
type: 'image',
|
|
options: {
|
|
hotspot: true,
|
|
},
|
|
},
|
|
{
|
|
name: 'Event',
|
|
title: 'Event Posts',
|
|
description: 'Pilih content untuk halaman',
|
|
type: 'array',
|
|
of: [
|
|
{
|
|
type: 'reference',
|
|
to: { type: event.name },
|
|
},
|
|
],
|
|
},
|
|
],
|
|
}
|