Skip to content

Commit

Permalink
Minor edits from PR comments - delete unneccessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
jamdelion committed Nov 11, 2024
1 parent fc55b80 commit 0aba609
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 24 deletions.
14 changes: 5 additions & 9 deletions editor.planx.uk/src/@planx/components/Feedback/Public/Public.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import Box from "@mui/material/Box";
import Grid from "@mui/material/Grid";
import Typography from "@mui/material/Typography";
import { Disclaimer } from "@planx/components/shared/Disclaimer";
import Card from "@planx/components/shared/Preview/Card";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import type { PublicProps } from "@planx/components/shared/types";
import { FeedbackView } from "components/Feedback/types";
import { FormikHelpers, useFormik } from "formik";
import { useFormik } from "formik";
import {
getInternalFeedbackMetadata,
insertFeedbackMutation,
Expand All @@ -26,11 +25,10 @@ import { FaceBox } from "../components/FaceBox";
import { Feedback, FormProps } from "../model";
import { StyledToggleButtonGroup } from "../styled";

export const PASSPORT_FEEDBACK_KEY = "_feedback";

const FeedbackComponent = (props: PublicProps<Feedback>): FCReturn => {
const handleSubmitFeedback = async (
values: FormProps,
{ resetForm }: FormikHelpers<FormProps>,
) => {
const handleSubmitFeedback = async (values: FormProps) => {
const metadata = await getInternalFeedbackMetadata();
const feedback = {
userComment: values.feedback,
Expand All @@ -46,12 +44,10 @@ const FeedbackComponent = (props: PublicProps<Feedback>): FCReturn => {
console.error(err);
},
);
props.handleSubmit?.(makeData(props, values, "_feedback"));
props.handleSubmit?.(makeData(props, values, PASSPORT_FEEDBACK_KEY));
if (!submitFeedbackResult) {
return;
}

resetForm({ values });
};

const formik = useFormik<FormProps>({
Expand Down
2 changes: 0 additions & 2 deletions editor.planx.uk/src/@planx/components/Feedback/model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// import { object, string } from "yup";

import { BaseNodeData, parseBaseNodeData } from "../shared";
import { defaultContent } from "./components/defaultContent";
export interface Feedback extends BaseNodeData {
Expand Down
20 changes: 7 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0aba609

Please sign in to comment.