Alert banner

This commit is contained in:
Henrik Larsson
2023-08-15 13:32:36 +02:00
parent ffdc12fcca
commit 4245628da1
9 changed files with 138 additions and 48 deletions

View File

@@ -1,5 +1,5 @@
import {defineField} from 'sanity'
import {StarIcon} from '@sanity/icons'
import { StarIcon } from '@sanity/icons'
import { defineField } from 'sanity'
import { validateImage } from '../../utils/validation'
export default defineField({
@@ -58,6 +58,30 @@ export default defineField({
layout: 'radio',
},
},
{
name: 'color',
type: 'string',
title: 'Color',
initialValue: 'dark',
fieldset: 'settings',
description: 'Set appropriate color depending on image characteristics.',
options: {
list: [
{title: 'Dark', value: 'dark'},
{title: 'Light', value: 'light'},
],
layout: 'radio',
},
},
{
name: 'overlay',
type: 'boolean',
title: 'Overlay?',
fieldset: 'settings',
description: 'Adds a dark overlay to the image.',
initialValue: false,
validation: (Rule) => Rule.required(),
},
{
name: 'label',
type: 'string',
@@ -101,7 +125,6 @@ export default defineField({
title: 'Link',
description: 'Link to internal page.',
options: {
collapsed: true,
collapsible: true,
},
},