Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Create pizza.js
pizza.js with topping field reference added.
  • Loading branch information
dougouverson committed Nov 13, 2020
1 parent 6be807f commit b5df69a
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions stepped-solutions/12/pizza.js
@@ -0,0 +1,49 @@
import { MdLocalPizza as icon } from 'react-icons/md';

export default {
// Computer Name
name: 'pizza',
// visible title
title: 'Pizzas',
type: 'document',
icon,
fields: [
{
name: 'name',
title: 'Pizza Name',
type: 'string',
description: 'Name of the pizza',
},
{
name: 'slug',
title: 'Slug',
type: 'slug',
options: {
source: 'name',
maxLength: 100,
},
},
{
name: 'image',
title: 'Image',
type: 'image',
options: {
hotspot: true,
},
},
{
name: 'price',
title: 'Price',
type: 'number',
description: 'Price of the pizza in cents',
validation: Rule => Rule.min(1000),
},
{
name: 'toppings',
title: 'Toppings',
type: 'array',
of: [{ type: 'reference', to: [{ type: 'topping' }] }],
// TODO: Add custom input component
},
],
};

0 comments on commit b5df69a

Please sign in to comment.