diff --git a/components/CompanySections/Jobs.js b/components/CompanySections/Jobs.js index 6b2741c..a942bd3 100644 --- a/components/CompanySections/Jobs.js +++ b/components/CompanySections/Jobs.js @@ -1,9 +1,54 @@ -import React from 'react' +import React, { useRef, useState } from 'react' +import AddJobModal from '../Modals/AddJobModal' function Jobs() { + + const [showAddJobModal , setShowAddJobModal] = useState(false) + const [jobs , setJobs] = useState([]) ; + const [curItem , setCurItem] = useState({}); + const [isEdit , setIsEdit] = useState(false); + const [index , setIndex] = useState(); + + const handleJobClick = (job ,index) =>{ + setCurItem(job) + setIsEdit(true) + setIndex(index) + setShowAddJobModal(true) + } + + const handleSaveJobClick = () => { + setCurItem({title : '' , jobType:'', + description:'' , responsibilities : ''}) + setIsEdit(false) + setShowAddJobModal(true) + } + return ( -
Jobs
- ) +
+ + + +
+ {jobs.map((job , index) => { + return ( +
handleJobClick(job , index)}> +

{job.title}

+
+ ) + })} +
+ +
+ ) } export default Jobs \ No newline at end of file diff --git a/components/CompanySections/KeyPeople.js b/components/CompanySections/KeyPeople.js index 382f3de..f015004 100644 --- a/components/CompanySections/KeyPeople.js +++ b/components/CompanySections/KeyPeople.js @@ -1,7 +1,7 @@ import { useState } from "react"; function KeyPeople() { - const [people, setPeople] = useState([""]); + const [people, setPeople] = useState([]); return (
@@ -10,10 +10,9 @@ function KeyPeople() {

- {people.map((item) => ( - + {people.map((item , index) => ( + ))} -
@@ -22,34 +21,58 @@ function KeyPeople() { export default KeyPeople; -const PeopleForm = () => { +const PeopleForm = ({setPeople,people, index} ) => { + + const handleDeleteClick =() =>{ + + } + return ( -
+ <> +
+ +
+ + + +
+
+ + ); }; diff --git a/components/CompanySections/PrefferedLocation.jsx b/components/CompanySections/PrefferedLocation.jsx new file mode 100644 index 0000000..c189e1a --- /dev/null +++ b/components/CompanySections/PrefferedLocation.jsx @@ -0,0 +1,171 @@ + +import React, { useState, useEffect } from 'react'; + +function PrefferedLocation({ setLocation }) { + const [showlocation, setshowlocation] = useState(false); + const [preferredLocation, setPreferredLocation] = useState([ + { name: 'Totally Open', selected: false }, + { name: 'Remote', selected: false }, + { name: 'Alanta, TX', selected: false }, + { name: 'Boston, MA', selected: false }, + { name: 'Chicago, IL', selected: false }, + { name: 'Denver, CO', selected: false }, + { name: 'Los Angeles, CA', selected: false }, + { name: 'Nashville, TN', selected: false }, + { name: 'New York, NY', selected: false }, + { name: 'Raleigh, NC', selected: false }, + { name: 'San Diego, CA', selected: false }, + { name: 'San Francisco, CA', selected: false }, + { name: 'Seattle, WA', selected: false }, + { name: 'Wilmington, DE', selected: false }, + { name: 'Houston, TX', selected: false }, + { name: 'Dallas, TX', selected: false }, + { name: 'Detroit MI', selected: false }, + ]); + const [userPreferredLocation, setUserPrefferedLocation] = useState([]); + const [totalPreferredLocation, setTotalPreferredLocation] = useState(0); + const [autocomplete, setAutocomplete] = useState({ + disabled: true, + data: [], + }); + const [inputValue, setInputValue] = useState(''); + + const updatePreferredLocation = (roleName) => { + + let flag = 1 ; + for(let i=0 ; i { + if (role.name === roleName) + if (!role.selected && totalPreferredLocation === 7); + else role.selected = !role.selected; + + return role; + }) + setPreferredLocation(newData); + setLocation(newData) + setInputValue(''); + setAutocomplete({ + disabled: true, + data: [], + }); + }; + + useEffect(() => { + let temp = 0; + + preferredLocation.forEach((role) => { + if (role.selected) temp++; + }); + setTotalPreferredLocation(temp); + }, [preferredLocation]); + + const handleInputValueChange = (e) => { + setInputValue(e.target.value); + if (e.target.value.trim() === '') + setAutocomplete({ disabled: true, data: [] }); + else { + const autocompleteData = []; + const regex = new RegExp(e.target.value, 'i'); + + preferredLocation.forEach((role) => { + if (regex.test(role.name)) autocompleteData.push(role.name); + }); + + setAutocomplete({ + disabled: false, + data: [e.target.value, ...autocompleteData], + }); + } + }; + useEffect(() => { + const body = document.getElementsByTagName('body'); + if ( showlocation) { + body[0].style.overflow = 'hidden'; + body[0].style.position = 'fixed'; + body[0].style.width = '100%'; + } else { + body[0].style.overflow = 'auto'; + body[0].style.position = 'relative'; + } + }, [ showlocation]); + + return ( + <> + +
+
+ {/* CONTENT START */} + +
+
+
+ Location +
+ +
+
+ +
+ {autocomplete.data.map((item, index) => ( +
updatePreferredLocation(item)} + > + {item} +
+ ))} +
+
+
+ {preferredLocation.map((role, index) => { + if(role.name ) return( + updatePreferredLocation(role.name)} + > + {role.name} + + ) + } ) } +
+
+
+ {/* CONTENT END */} +
+ + + ); +} + +export default PrefferedLocation; diff --git a/components/CompanySections/Profile.js b/components/CompanySections/Profile.js index e8e9b74..c993532 100644 --- a/components/CompanySections/Profile.js +++ b/components/CompanySections/Profile.js @@ -1,4 +1,8 @@ import { useRef, useState } from "react"; +import RichEditor from '../General/Editor' +import PrefferedLocation from "./PrefferedLocation"; +import Tags from "./Tags"; +import TeamSize from "./TeamSize"; function Profile() { const [facebook, setFacebook] = useState(""); const [website, setWebsite] = useState(""); @@ -8,7 +12,25 @@ function Profile() { const [location, setLocation] = useState(); const [tags, setTags] = useState(); const [teamSize, setTeamSize] = useState(); - const [aboutCompany, setAboutCompany] = useState(); + const [aboutCompany, setAboutCompany] = useState(""); + const handleEditorChange = (htmlContent) => { + setAboutCompany(htmlContent); + }; + + const onSaveClick = () =>{ + const newData = { + facebook : facebook , + website : website, + instagram : instagram, + openings : openings, + assignments : assignments, + location : location, + tags : tags, + teamSize : teamSize, + aboutCompany : aboutCompany, + } + console.log(newData) + } return (
@@ -79,7 +101,7 @@ function Profile() {
-

+ {/*

Company Location

setLocation(e.target.value)} placeholder="Example: Singapore, Mumbai, New York..." className="appearance-none px-3 py-2 placeholder-[#6B7280] text-[#030303] placeholder-opacity-90 relative w-full bg-white rounded text-sm border-[1.5px] focus:outline-none focus:border-[#2dc5a1] focus:border-2 transition duration-200 ease-in mt-1 bg-transparent" - /> + /> */} +

Tags

- setTags(e.target.value)} placeholder="Example: Artifical Intelligence, Machine Learning, Saas..." className="appearance-none px-3 py-2 placeholder-[#6B7280] text-[#030303] placeholder-opacity-90 relative w-full bg-white rounded text-sm border-[1.5px] focus:outline-none focus:border-[#2dc5a1] focus:border-2 transition duration-200 ease-in mt-1 bg-transparent" - /> + /> */} +

Team Size

- setTeamSize(e.target.value)} placeholder="Example: Artifical Intelligence, Machine Learning, Saas..." className="appearance-none px-3 py-2 placeholder-[#6B7280] text-[#030303] placeholder-opacity-90 relative w-full bg-white rounded text-sm border-[1.5px] focus:outline-none focus:border-[#2dc5a1] focus:border-2 transition duration-200 ease-in mt-1 bg-transparent" - /> + /> */} +

About Company

-