Ignore:
Timestamp:
06/17/24 21:59:14 (3 months ago)
Author:
223021 <daniel.ilievski.2@…>
Branches:
main
Children:
08f82ec
Parents:
b248810
Message:

Added an edit profile page for both job seekers and recruiters, where they can upload profile pictures/company logos and edit their profile data. Added profile page specifically for recruiters. Refactored existing code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jobvista-frontend/src/views/job_advertisements/EditJobAdModal.js

    rb248810 rbefb988  
    11import React, {useEffect, useState} from "react";
    2 import "./Form.css";
     2import "../shared_css/Modal.css";
    33
    44import 'react-responsive-modal/styles.css';
     
    1616import {JobAdvertisementActions} from "../../redux/actions/jobAdvertisementActions";
    1717import {Editor} from "primereact/editor";
     18import {notifyJobAdDelete, notifyJobAdEdit} from "../../utils/toastUtils";
    1819
    1920
     
    2324    const auth = useSelector(state => state.auth.currentUser)
    2425    const toggleModal = () => {
     26        console.log("NAD SET")
    2527        setModal(!modal);
     28        console.log("POD SET")
     29
    2630    };
    2731
     
    5256                }, jobAd.props.id, (success, response) => {
    5357                    if(success) {
    54                         console.log("Job Advertisement edited")
     58                        // console.log("Job Advertisement edited")
    5559                        toggleModal()
     60                        notifyJobAdEdit()
    5661                    }
    5762                }
     
    7883
    7984            <div className="modal-content">
    80                 <form onSubmit={handleSubmit(editJobAdvertisement)}>
     85                <form>
    8186                    <div className="row">
    8287                        <div className="col-md-7">
     
    9297                                name="description"
    9398                                control={control}
     99                                defaultValue={jobAd.props.description}
    94100                                render={({ field }) => (
    95101                                    <Editor
    96                                         defaultValue={jobAd.props.description}
     102                                        // defaultValue={jobAd.props.description}
    97103                                        value={jobAd.props.description}
    98104                                        onTextChange={(e) => field.onChange(e.htmlValue)}
     
    107113                        <div className="col-md-5">
    108114                            <label className="label">Hourly rate:</label>
    109                             <input defaultValue={jobAd.props.startingSalary} {...register("startingSalary")}/>
     115                            <input type="number" defaultValue={jobAd.props.startingSalary} {...register("startingSalary")}/>
    110116                            <p style={{color: "red"}}>{errors.startingSalary?.message}</p>
    111117
     
    166172                    </div>
    167173
    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>
    170177                    </div>
    171 
    172178                </form>
    173179            </div>
Note: See TracChangeset for help on using the changeset viewer.