- Timestamp:
- 06/17/24 21:59:14 (3 months ago)
- Branches:
- main
- Children:
- 08f82ec
- Parents:
- b248810
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
jobvista-frontend/src/views/job_advertisements/EditJobAdModal.js
rb248810 rbefb988 1 1 import React, {useEffect, useState} from "react"; 2 import ". /Form.css";2 import "../shared_css/Modal.css"; 3 3 4 4 import 'react-responsive-modal/styles.css'; … … 16 16 import {JobAdvertisementActions} from "../../redux/actions/jobAdvertisementActions"; 17 17 import {Editor} from "primereact/editor"; 18 import {notifyJobAdDelete, notifyJobAdEdit} from "../../utils/toastUtils"; 18 19 19 20 … … 23 24 const auth = useSelector(state => state.auth.currentUser) 24 25 const toggleModal = () => { 26 console.log("NAD SET") 25 27 setModal(!modal); 28 console.log("POD SET") 29 26 30 }; 27 31 … … 52 56 }, jobAd.props.id, (success, response) => { 53 57 if(success) { 54 console.log("Job Advertisement edited")58 // console.log("Job Advertisement edited") 55 59 toggleModal() 60 notifyJobAdEdit() 56 61 } 57 62 } … … 78 83 79 84 <div className="modal-content"> 80 <form onSubmit={handleSubmit(editJobAdvertisement)}>85 <form> 81 86 <div className="row"> 82 87 <div className="col-md-7"> … … 92 97 name="description" 93 98 control={control} 99 defaultValue={jobAd.props.description} 94 100 render={({ field }) => ( 95 101 <Editor 96 defaultValue={jobAd.props.description}102 // defaultValue={jobAd.props.description} 97 103 value={jobAd.props.description} 98 104 onTextChange={(e) => field.onChange(e.htmlValue)} … … 107 113 <div className="col-md-5"> 108 114 <label className="label">Hourly rate:</label> 109 <input defaultValue={jobAd.props.startingSalary} {...register("startingSalary")}/>115 <input type="number" defaultValue={jobAd.props.startingSalary} {...register("startingSalary")}/> 110 116 <p style={{color: "red"}}>{errors.startingSalary?.message}</p> 111 117 … … 166 172 </div> 167 173 168 <div className="aligned"> 169 <button className="submit-btn"> Submit</button> 174 <div className="modal-buttons"> 175 <div className="cancel-btn" onClick={toggleModal}> Cancel</div> 176 <button className="submit-btn" onClick={handleSubmit(editJobAdvertisement)}> Save changes</button> 170 177 </div> 171 172 178 </form> 173 179 </div>
Note:
See TracChangeset
for help on using the changeset viewer.