From af08cb6a10b6bfaee252c913e1f6974554146e6f Mon Sep 17 00:00:00 2001 From: Jacob Lowe <40873986+jalowe13@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:55:48 -0600 Subject: [PATCH] Task/WP-762--Use-Core-Component-Buttons (#381) * react-strap buttons * submit attribute for formik * edit record modal submit attribute --------- Co-authored-by: Chandra Y --- .../Admin/ViewUsers/EditRecordModal.tsx | 3 +- .../Forms/Registrations/RegistrationForm.tsx | 28 ++++++------------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/apcd_cms/src/client/src/components/Admin/ViewUsers/EditRecordModal.tsx b/apcd_cms/src/client/src/components/Admin/ViewUsers/EditRecordModal.tsx index 3d0bb5d9..3918dbc8 100644 --- a/apcd_cms/src/client/src/components/Admin/ViewUsers/EditRecordModal.tsx +++ b/apcd_cms/src/client/src/components/Admin/ViewUsers/EditRecordModal.tsx @@ -8,6 +8,7 @@ import { Row, Col, } from 'reactstrap'; +import Button from 'core-components/Button'; import { Formik, Field, Form, ErrorMessage } from 'formik'; import { fetchUtil } from 'utils/fetchUtil'; import * as Yup from 'yup'; @@ -236,9 +237,9 @@ const EditRecordModal: React.FC = ({
diff --git a/apcd_cms/src/client/src/components/Forms/Registrations/RegistrationForm.tsx b/apcd_cms/src/client/src/components/Forms/Registrations/RegistrationForm.tsx index e9a6b47d..ec8adecd 100644 --- a/apcd_cms/src/client/src/components/Forms/Registrations/RegistrationForm.tsx +++ b/apcd_cms/src/client/src/components/Forms/Registrations/RegistrationForm.tsx @@ -1,8 +1,9 @@ import React, { useEffect } from 'react'; import { Formik, Form, Field, ErrorMessage } from 'formik'; import * as Yup from 'yup'; -import { FormGroup, Label, Button, FormFeedback } from 'reactstrap'; -import { useSearchParams } from 'react-router-dom'; +import { FormGroup, Label, FormFeedback } from 'reactstrap'; +import Button from 'core-components/Button'; +import { useNavigate, useSearchParams } from 'react-router-dom'; import { RegistrationFormValues, transformToRegistrationFormValues, @@ -214,6 +215,10 @@ export const RegistrationForm: React.FC<{ : `register/request-to-submit/api/`; submitForm({ url, body: values }); }; + const navigate = useNavigate(); + const handleClick = () => { + navigate('/workbench/dashboard'); + }; if (isLoading) { return ( @@ -284,8 +289,6 @@ export const RegistrationForm: React.FC<{ {isModal ? ( ) : ( @@ -436,8 +437,6 @@ export const RegistrationForm: React.FC<{
{' '} {' '}