popup closes
This commit was merged in pull request #180.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import { Link } from "react-router-dom";
|
||||
import InputCom from "../Helpers/Inputs/InputCom";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import usersService from "../../services/UsersService";
|
||||
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
|
||||
import { tableReload } from '../../store/TableReloads'
|
||||
import { tableReload } from "../../store/TableReloads";
|
||||
|
||||
import { Field, Form, Formik } from "formik";
|
||||
import * as Yup from "yup";
|
||||
@@ -38,16 +38,12 @@ const validationSchema = Yup.object().shape({
|
||||
.required("Timeline is required"),
|
||||
});
|
||||
|
||||
function AddJob({popUpHandler}) {
|
||||
function AddJob({ popUpHandler }) {
|
||||
const ApiCall = new usersService();
|
||||
const navigate = useNavigate();
|
||||
|
||||
let dispatch = useDispatch()
|
||||
let dispatch = useDispatch();
|
||||
|
||||
let { userDetails } = useSelector((state) => state.userDetails);
|
||||
|
||||
// let [pageLoading, setPageLoading] = useState(true); // State used for knowing when the page is mounting
|
||||
|
||||
let [country, setCountry] = useState({
|
||||
loading: true,
|
||||
status: false,
|
||||
@@ -109,8 +105,8 @@ function AddJob({popUpHandler}) {
|
||||
message: "Job Added Successfully",
|
||||
});
|
||||
setTimeout(() => {
|
||||
dispatch(tableReload({type:'JOBTABLE'}))
|
||||
navigate("/myjobs", { replace: true });
|
||||
dispatch(tableReload({ type: "JOBTABLE" }));
|
||||
popUpHandler()
|
||||
}, 1000);
|
||||
})
|
||||
.catch((err) => {
|
||||
@@ -141,9 +137,6 @@ function AddJob({popUpHandler}) {
|
||||
{(props) => {
|
||||
return (
|
||||
<Form>
|
||||
{/* <h1 className="py-2 my-4 text-lg md:text-xl font-bold tracking-wide">
|
||||
Create New Job
|
||||
</h1> */}
|
||||
<div className="flex flex-col-reverse sm:flex-row">
|
||||
<div className="fields w-full">
|
||||
{/* inputs starts here */}
|
||||
@@ -400,11 +393,3 @@ const publicArray = [
|
||||
{ duration: 21, name: "3 weeks" },
|
||||
{ duration: 28, name: "4 weeks" },
|
||||
];
|
||||
|
||||
// pageLoading.loading ? (
|
||||
// <div className="personal-info-tab w-full flex flex-col justify-between">
|
||||
// <div className="p-3">
|
||||
// <LoadingSpinner size="32" color="sky-blue" />
|
||||
// </div>
|
||||
// </div>
|
||||
// ) :
|
||||
|
||||
@@ -31,7 +31,7 @@ function AddJobPage({ action, situation }) {
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<AddJob popUpHandler={situation} />
|
||||
<AddJob popUpHandler={action} />
|
||||
</div>
|
||||
</ModalCom>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user