diff --git a/demo/Page/components/Archive/index.js b/demo/Page/components/Archive/index.js index f6e3b68701..d32f1f4dc2 100644 --- a/demo/Page/components/Archive/index.js +++ b/demo/Page/components/Archive/index.js @@ -6,23 +6,17 @@ import { SearchableTable, } from 'payload/components'; -import Page from '../../Page.config'; -import config from '../../../payload.config.json'; - -const collection = Page; - const Archive = props => { - return ( - + - + ); } -export default withArchiveData(Archive, collection, config); +export default withArchiveData(Archive); diff --git a/demo/Page/components/Edit/index.js b/demo/Page/components/Edit/index.js index 99a89399c9..77e12f9eac 100644 --- a/demo/Page/components/Edit/index.js +++ b/demo/Page/components/Edit/index.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { withEditData, EditView, - Sticky, + StickyAction, APIUrl, Button, Form, @@ -13,28 +13,22 @@ import { } from 'payload/components'; import { toKebabCase } from 'payload/utils'; -import Page from '../../Page.config'; -import config from '../../../payload.config.json'; - class Edit extends Component { constructor(props) { super(props); - this.collection = Page; const uid = this.props.match.params.slug; this.state = { uid: uid, slug: uid, - action: `${config.serverUrl}/${this.collection.slug}${uid ? `/${uid}` : ''}`, + action: `${this.props.config.serverUrl}/${this.props.collection.slug}${uid ? `/${uid}` : ''}`, method: uid ? 'put' : 'post' } - - this.updateSlug = this.updateSlug.bind(this); } - updateSlug(e) { + updateSlug = e => { this.setState({ slug: toKebabCase(e.target.value) }); } @@ -43,16 +37,18 @@ class Edit extends Component { const initialData = this.props.data ? this.props.data : {}; return ( - +
- - -
+ + } action={ + Save -
-
+ + } /> +