- Timestamp:
- 06/17/24 21:59:14 (2 weeks ago)
- Branches:
- main
- Children:
- 08f82ec
- Parents:
- b248810
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
jobvista-frontend/src/views/job_advertisements/AddJobAdModal.js
rb248810 rbefb988 1 1 import React, {useState} from "react"; 2 import ". /Form.css";2 import "../shared_css/Modal.css"; 3 3 4 4 import { Editor } from 'primereact/editor'; … … 17 17 import {useDispatch, useSelector} from "react-redux"; 18 18 import {JobAdvertisementActions} from "../../redux/actions/jobAdvertisementActions"; 19 import {notifyJobAdPost} from "../../utils/toastUtils"; 19 20 20 21 … … 32 33 description: yup.string().required("Please enter a description"), 33 34 industry: yup.mixed().required("Select industry"), 34 startingSalary: yup. number().required("Please enter the starting salary"),35 startingSalary: yup.string().required("Please enter the starting salary"), 35 36 jobType: yup.mixed().required("Select job type"), 36 37 employmentStatus: yup.mixed().required("Select employment status"), … … 46 47 dispatch(JobAdvertisementActions.addJobAdvertisement( 47 48 { 48 email: auth.email,49 id: auth.id, 49 50 title: values.title, 50 51 description: values.description, … … 56 57 }, (success, response) => { 57 58 if (success) { 58 console.log("Job Advertisement added")59 // console.log("Job Advertisement added") 59 60 toggleModal() 61 notifyJobAdPost() 60 62 } 61 63 } … … 75 77 </div> 76 78 {/*<button onClick={toggleModal} className="btn-open-modal">POST ADVERTISEMENT</button>*/} 77 <Modal open={modal} onClose={toggleModal} center classNames="job-advertisement-modal">79 <Modal open={modal} onClose={toggleModal} center> 78 80 <div className="head-modal"> 79 81 <h3>Post Job Advertisement</h3> … … 82 84 83 85 <div className="modal-content"> 84 <form onSubmit={handleSubmit(addJobAdvertisement)}>86 <form> 85 87 <div className="row"> 86 88 <div className="col-md-7"> … … 111 113 <div className="col-md-5"> 112 114 <label className="label">Hourly rate:</label> 113 <input {...register("startingSalary")}/>115 <input type="number" {...register("startingSalary")}/> 114 116 <p style={{color: "red"}}>{errors.startingSalary?.message}</p> 115 117 … … 157 159 </div> 158 160 159 <div className="aligned"> 160 <button className="submit-btn"> Submit</button> 161 <div className="modal-buttons"> 162 <div className="cancel-btn" onClick={toggleModal}> Cancel</div> 163 <button className="submit-btn" onClick={handleSubmit(addJobAdvertisement)}>Submit</button> 161 164 </div> 162 165
Note:
See TracChangeset
for help on using the changeset viewer.