diff --git a/demo/Page/components/Edit/index.js b/demo/Page/components/Edit/index.js index ceb203019b..bee2cd52ae 100644 --- a/demo/Page/components/Edit/index.js +++ b/demo/Page/components/Edit/index.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React from 'react'; import { withEditData, EditView, @@ -13,99 +13,78 @@ import { FormSubmit, Repeater } from 'payload/components'; -import { toKebabCase } from 'payload/utils'; -class Edit extends Component { +const Edit = props => { - constructor(props) { - super(props); + const { id } = props.match.params; - const entrySlug = this.props.match.params.slug; + const { data, collection, config, locale } = props; - this.state = { - uid: entrySlug, - slug: entrySlug, - action: `${this.props.config.serverUrl}/${this.props.collection.slug}${entrySlug ? `/${entrySlug}` : ''}`, - method: entrySlug ? 'put' : 'post' + const sampleRepeaterValue = [ + { + content: 'here\'s some test content' + }, { + content: 'here\'s some more test content' } - } + ]; - setSlug = e => { - this.setState({ slug: toKebabCase(e.target.value) }); - } + return ( + +
+ + } action={ + + + Save + + } /> - render() { + - const initialData = this.props.data ? this.props.data : {}; + - const sampleRepeaterValue = [ - { - content: 'here\'s some test content' - }, { - content: 'here\'s some more test content' - } - ]; + - return ( - - - - } action={ - - - Save - - } /> +