1- import { collection_4 , flight_land } from '@equinor/eds-icons'
2- import type { PortableTextBlock , Rule } from 'sanity'
3- import blocksToText from '../../helpers/blocksToText'
1+ import { collection_4 } from '@equinor/eds-icons'
42import { EdsIcon } from '../../icons'
5- import { CompactBlockEditor } from '../components/CompactBlockEditor'
6- import { configureBlockContent } from '../editors/blockContentType'
7- import { lang } from './langField'
83
94export default {
105 type : 'document' ,
11- title : `404 page ` ,
6+ title : `Error pages ` ,
127 name : `pageNotFound` ,
138 icon : ( ) => EdsIcon ( collection_4 ) ,
14- fieldsets : [
15- {
16- title : 'SEO & metadata' ,
17- name : 'metadata' ,
18- description :
19- 'This part is used for meta information when this content is used on the web' ,
20- options : {
21- collapsible : true ,
22- collapsed : true ,
23- } ,
24- } ,
25- ] ,
269 fields : [
27- lang ,
28- {
29- title : 'Meta information' ,
30- name : 'seo' ,
31- type : 'titleAndMeta' ,
32- fieldset : 'metadata' ,
33- } ,
34- {
35- name : 'title' ,
36- type : 'array' ,
37- title : 'Title' ,
38- description : `Don't add the status code (404). The web will take care of that` ,
39- components : {
40- input : CompactBlockEditor ,
41- } ,
42- of : [ configureBlockContent ( { variant : 'title' } ) ] ,
43- validation : ( Rule : Rule ) => Rule . required ( ) ,
44- } ,
45- {
46- title : 'Text' ,
47- name : 'text' ,
48- type : 'array' ,
49- of : [ configureBlockContent ( { variant : 'withH2SimpleBlock' } ) ] ,
50- } ,
5110 {
5211 title : 'Background image' ,
5312 name : 'backgroundImage' ,
@@ -59,15 +18,12 @@ export default {
5918 ] ,
6019 preview : {
6120 select : {
62- title : 'title ' ,
21+ image : 'backgroundImage ' ,
6322 } ,
64- prepare ( { title } : { title : PortableTextBlock [ ] } ) {
65- const plainTitle = title ? blocksToText ( title ) : ''
66-
23+ prepare ( { image } : { image : any } ) {
6724 return {
68- title : plainTitle ,
69- subtitle : 'Page not found' ,
70- media : EdsIcon ( flight_land ) ,
25+ title : 'Background image for error pages' ,
26+ media : image ,
7127 }
7228 } ,
7329 } ,
0 commit comments