Skip to content

Commit

Permalink
fix: fix cancel offer bug using employer id instead of talent id
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayobami6 committed Oct 25, 2023
1 parent ffde2f2 commit 9f9af3e
Show file tree
Hide file tree
Showing 11 changed files with 412 additions and 383 deletions.
4 changes: 2 additions & 2 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!doctype html>
<html lang="en">
<html data-theme="dracula" lang="en">
<head>
<meta charset="UTF-8" />
<link
rel="icon"
rel="icon"
type="image/png"
sizes="256x256"
href="/assets/MeetDevs-n.png"
Expand Down
52 changes: 48 additions & 4 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.0.3",
"autoprefixer": "^10.4.16",
"daisyui": "^3.9.3",
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
Expand Down
17 changes: 5 additions & 12 deletions client/src/components/Navbar/TalentNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,15 @@ function TalentNav(): JSX.Element {
return (
<div className='talent-nav'>
<div className='nav-con'>
<img
className={'rounded-full'}
src={'/assets/logo.png'}
alt=''
/>
<img className={'rounded-full'} src={'/assets/logo.png'} alt='' />
<nav className='nav-items-con' onClick={() => setOpenProfile(true)}>
{user.data ? (
''
) : (
<Link to={`/talent/getranked/${user.talent._id}`}>
Get Ranked
</Link>
<Link to={`/talent/getranked/${user.talent._id}`}>Get Ranked</Link>
)}
<Link to={'#'}>Messages</Link>
<Link
<Link
to={
user.talent
? `/offers/talent/${user.talent._id}`
Expand All @@ -63,15 +57,14 @@ function TalentNav(): JSX.Element {
</nav>
</div>

<Link to={'#'} >
<Link to={'#'}>
<img
src='/assets/talents/no_image.png'
alt='fine girl'
className='w-20 rounded-full'
className='w-[50px] h-[50px] rounded-full'
onClick={() => setOpenProfile((prev) => !prev)}
/>
<p>{user.data ? user.data.name : user.talent.name}</p>

</Link>
{openProfile && <ProfileDropDownMenu logout={logout} />}
</div>
Expand Down
139 changes: 69 additions & 70 deletions client/src/components/TalentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,84 +4,83 @@ import { AiFillGithub } from 'react-icons/ai';
import { BsLinkedin } from 'react-icons/bs';

interface TalentProps {
name: string;
jobRole: string;
bio: string;
location: string;
github: string;
profileImg: string;
id: string;
rank: number;
name: string;
jobRole: string;
bio: string;
location: string;
github: string;
profileImg: string;
id: string;
rank: number;
}

const TalentCard: React.FC<TalentProps> = ({
name,
jobRole,
location,
bio,
github,
profileImg,
id,
rank,
name,
jobRole,
location,
bio,
github,
profileImg,
id,
rank,
}) => {
return (
<div className='bg-white shadow-md rounded-lg overflow-hidden'>
<div className='m-5 h-[170px] rounded-full flex justify-between'>
<img
src={
!profileImg
? 'src/assets/talents/no_image.png'
: profileImg
}
alt={name}
className='w-25'
/>
<p className='text-2xl border-[1px] border-green-400 rounded-3xl shadow-lg h-[70px] p-3 font-mono'>
Percentile
<br />
<span className=''>{rank}%</span>
</p>
{/* <div className='border-[1px] border-green-400 w-12 h-12 rounded-full'>
return (
<div className='shadow-3xl border-[1px] border-green-600 rounded-lg overflow-hidden'>
<div className='m-5 h-[170px] rounded-full flex justify-between'>
<div className='w-[160px] h-[160px]'>
<img
src={!profileImg ? 'src/assets/talents/no_image.png' : profileImg}
alt={name}
className='w-full h-full object-cover rounded-full'
/>
</div>

<p className='text-2xl border-[1px] border-green-600 rounded-3xl shadow-lg h-[70px] p-3 font-mono'>
Percentile
<br />
<span className=''>{rank}%</span>
</p>
{/* <div className='border-[1px] border-green-400 w-12 h-12 rounded-full'>
<p className='text-center p-2 text-xl'>{rank}</p>
</div> */}
</div>
</div>

<div className='p-6'>
<h2 className='text-2xl font-bold'>{name}</h2>
<h3 className='text-xl text-gray-500'>{jobRole}</h3>
<p className='text-gray-600'>{location}</p>
<p className='text-gray-600'>{bio}</p>
<div className='flex justify-start'>
<a
href={`https://github.com/${github}`}
className='text-blue-500 hover:underline'
target='blank'
>
<AiFillGithub className='text-2xl my-2 mr-2 text-green-400' />
</a>
<a
href={`https://github.com/${github}`}
className='text-blue-500 hover:underline'
target='blank'
>
<BsLinkedin className='text-2xl my-2 text-green-400' />
</a>
</div>
</div>
<div className='flex justify-between'>
<Link to={`/showdev/${id}`}>
<button className='m-4 border-xl border-2 shadow-xl rounded-3xl w-[85px] text-white text-sm h-[36px] bg-green-600 hover:bg-green-800'>
Check Out
</button>
</Link>
<Link to={`/hiredev/${id}`}>
<button className='m-4 border-xl border-2 shadow-xl rounded-3xl w-[85px] text-white text-sm h-[36px] bg-green-600 hover:bg-green-800'>
Hire
</button>
</Link>
</div>
<div className='p-6'>
<h2 className='text-2xl font-bold'>{name}</h2>
<h3 className='text-xl text-gray-500'>{jobRole}</h3>
<p className='text-gray-600'>{location}</p>
<p className='text-gray-600'>{bio}</p>
<div className='flex justify-start'>
<a
href={`https://github.com/${github}`}
className='text-blue-500 hover:underline'
target='blank'
>
<AiFillGithub className='text-2xl my-2 mr-2 text-green-400' />
</a>
<a
href={`https://github.com/${github}`}
className='text-blue-500 hover:underline'
target='blank'
>
<BsLinkedin className='text-2xl my-2 text-green-400' />
</a>
</div>
);
</div>
<div className='flex justify-between'>
<Link to={`/showdev/${id}`}>
<button className='m-4 border-xl border-2 shadow-xl rounded-3xl w-[85px] text-white text-sm h-[36px] bg-green-600 hover:bg-green-800'>
Check Out
</button>
</Link>
<Link to={`/hiredev/${id}`}>
<button className='m-4 border-xl border-2 shadow-xl rounded-3xl w-[85px] text-white text-sm h-[36px] bg-green-600 hover:bg-green-800'>
Hire
</button>
</Link>
</div>
</div>
);
};

export default TalentCard;
2 changes: 1 addition & 1 deletion client/src/pages/Employer/Employer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Employer = () => {
<>
<TalentNav />

<div className='bg-gray-100 min-h-screen p-5'>
<div className='min-h-screen p-5'>
<div className='flex mx-10 justify-end'>
<Search />
</div>
Expand Down
7 changes: 1 addition & 6 deletions client/src/pages/Employer/EmployerOffer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const EmployerOffer = () => {
useEffect(() => {
dispatch(getOffersEmployer(id, setLoading));
}, [id, dispatch]);
console.log(offers);
return (
<>
<TalentNav />
Expand All @@ -40,11 +39,7 @@ const EmployerOffer = () => {
</h1>
) : (
offers.map((offer) => (
<TalentOfferCard
key={offer._id}
offer={offer}
user={employer}
/>
<TalentOfferCard key={offer._id} offer={offer} user={employer} />
))
)}
</>
Expand Down
Loading

0 comments on commit 9f9af3e

Please sign in to comment.