From b28d1677afab00f616e2fc73056209a9c81bfe3e Mon Sep 17 00:00:00 2001 From: Kurt Hutten Date: Sat, 17 Oct 2020 06:01:22 +1100 Subject: [PATCH] Add okay styles to edit part page --- .../components/EditPartCell/EditPartCell.js | 9 +-- web/src/components/PartCell/PartCell.js | 2 +- web/src/components/PartForm/PartForm.js | 61 ++++++++----------- web/src/index.css | 19 ++++++ web/src/pages/EditPartPage/EditPartPage.js | 6 +- 5 files changed, 49 insertions(+), 48 deletions(-) diff --git a/web/src/components/EditPartCell/EditPartCell.js b/web/src/components/EditPartCell/EditPartCell.js index ca617e4..3ba7344 100644 --- a/web/src/components/EditPartCell/EditPartCell.js +++ b/web/src/components/EditPartCell/EditPartCell.js @@ -39,13 +39,6 @@ export const Success = ({ part }) => { } return ( -
-
-

Edit Part {part.id}

-
-
- -
-
+ ) } diff --git a/web/src/components/PartCell/PartCell.js b/web/src/components/PartCell/PartCell.js index 2efcdcc..22044f0 100644 --- a/web/src/components/PartCell/PartCell.js +++ b/web/src/components/PartCell/PartCell.js @@ -21,7 +21,7 @@ export const Success = ({ part }) => {

{part.title}

diff --git a/web/src/components/PartForm/PartForm.js b/web/src/components/PartForm/PartForm.js index 433987b..64d8fbb 100644 --- a/web/src/components/PartForm/PartForm.js +++ b/web/src/components/PartForm/PartForm.js @@ -7,14 +7,21 @@ import { TextAreaField, Submit, } from '@redwoodjs/forms' +import { useState } from 'react'; + +import Editor from "rich-markdown-editor"; const PartForm = (props) => { + const [description, setDescription] = useState(props?.part?.description) const onSubmit = (data) => { - props.onSave(data, props?.part?.id) + props.onSave({ + ...data, + description, + }, props?.part?.id) } return ( -
+
{