Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ft():shareable job post page #99

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions src/pages/ShareApplication.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import { useParams } from 'react-router';
import NavBar from '../components/sidebar/navHeader';
import React, { useEffect } from 'react';
import { fetchSingleJobPost } from '../redux/actions/fetchSingleJobPostAction';
import { connect, useDispatch } from 'react-redux';
import { useAppSelector } from 'hooks/hooks';
import { Link } from 'react-router-dom';

type Props = {};

const ShareApplication = (props: any) => {
const { fetchSingleJobPostStates, updateJobPostStates } = props;
const dispatch = useDispatch();
const { id } = useParams();
console.log(id);
useEffect(() => {
dispatch(fetchSingleJobPost(id));
}, [id]);

console.log(fetchSingleJobPostStates?.data);

return (
<>
<div className="flex flex-col h-screen absolute w-[100%]">
<div className="flex flex-row">
<div className="w-full">
<div>
<div className="bg-light-bg dark:bg-dark-frame-bg min-h-screen overflow-y-hidden overflow-x-hidden flex justify-center ">
{/* form */}
<div className="flex flex-col w-[60%] dark:bg-dark-tertiary mt-[7rem] mb-[5rem] rounded-lg p-5 md:ml-0 md:w-[90%] ">
{/* TITLE */}
<div className="flex justify-center">
<p className="text-white font-semibold underline font-size-10">
{fetchSingleJobPostStates?.data?.title}
</p>
</div>
{/* DESCRIPTION */}
<div className="flex justify-start width-[80%] ml-3 mt-5">
<p className="text-white font-sans">
{fetchSingleJobPostStates?.data?.description}
</p>
</div>
{/* REQUIREMENTS */}
<div className="flex flex-col justify-start width-[80%] ml-5 mt-5 ">
<p className="text-white font-semibold">
Here are the requirements:
</p>
<ul className="list-disc ml-5">
{fetchSingleJobPostStates?.data?.program?.requirements.map(
(item: any) => (
<li className="text-white font-sans">{item}</li>
),
)}
</ul>
</div>
<div className="flex justify-center mt-5">
<Link to={`/jobPost/${id}/apply`}>
<button className="flex bg-primary dark:bg-[#56C870] rounded-md py-2 px-4 text-white font-medium cursor-pointer">
Apply
</button>
</Link>
</div>

{/* FORM */}
</div>
</div>
</div>
</div>
</div>
</div>
</>
);
};

// export default ShareApplication;

const mapState = (state: any) => ({
fetchSingleJobPostStates: state.fetchSingleJobPost,
});

export default connect(mapState, {
fetchSingleJobPost,
})(ShareApplication);
14 changes: 7 additions & 7 deletions src/pages/sharedPosts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ function SharedJobPosts(props: any) {
Cohort
</th>
{
<th className="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 dark:bg-dark-tertiary text-left text-xs font-semibold text-gray-600 dark:text-white uppercase tracking-wider">
Description
</th>
// <th className="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 dark:bg-dark-tertiary text-left text-xs font-semibold text-gray-600 dark:text-white uppercase tracking-wider">
// Description
// </th>
}
<th className="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 dark:bg-dark-tertiary text-left text-xs font-semibold text-gray-600 dark:text-white uppercase tracking-wider">
Action
Expand Down Expand Up @@ -153,15 +153,15 @@ function SharedJobPosts(props: any) {
</div>
</div>
</td>
<td className="px-5 py-5 border-b border-gray-200 dark:border-dark-tertiary text-sm">
{/* <td className="px-5 py-5 border-b border-gray-200 dark:border-dark-tertiary text-sm">
<div className="flex items-center">
<div className="">
<p className="text-gray-900 text-center dark:text-white whitespace-no-wrap">
{item?.description}
</p>
</div>
</div>
</td>
</td> */}
<td className="px-5 py-5 border-b border-gray-200 dark:border-dark-tertiary text-sm">
<div className="flex items-center">
<div className="">
Expand Down Expand Up @@ -223,14 +223,14 @@ function SharedJobPosts(props: any) {
{item?.cohort?.title}
</label>
</div>
<div className="flex flex-col w-full">
{/* <div className="flex flex-col w-full">
<label className="text-left text-gray-400 text-sm">
Description
</label>
<div className="text-left text-black-text dark:text-white text-base font-normal">
{item?.description}
</div>
</div>
</div> */}
</div>
))}
</div>
Expand Down
20 changes: 9 additions & 11 deletions src/routes/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ import SharedPosts from '../pages/sharedPosts';
import Applications from '../pages/Applications';
import ScheduleInterview from '../pages/ScheduleInterview';
import SubmitApplication from '../pages/SubmitApplication';
import GradingSystemPage from "../pages/GradingSystemPage";
import GradingSystemPage from '../pages/GradingSystemPage';
import ListApplications from './../pages/Applications/AdminViewApplications';
import ShareApplication from '../pages/ShareApplication';

function Navigation() {
const roleName = localStorage.getItem('roleName');
Expand Down Expand Up @@ -133,8 +134,8 @@ function Navigation() {
/>
<Route
path="/"
element={roleName === 'applicant' ?
(
element={
roleName === 'applicant' ? (
<PrivateRoute>
<Applications />
</PrivateRoute>
Expand All @@ -143,7 +144,6 @@ function Navigation() {
<Trainee />
</PrivateRoute>
)

}
/>
<Route
Expand Down Expand Up @@ -242,8 +242,8 @@ function Navigation() {
<SubmitApplication />
</PrivateRoute>
}

/>
<Route path="/jobPost/:id" element={<ShareApplication />} />
<Route
path="*"
element={
Expand Down Expand Up @@ -312,15 +312,13 @@ function Navigation() {
/>
<Route
element={
<PrivateRoute>
<PrivateRoute>
<ListApplications />
</PrivateRoute>
</PrivateRoute>
}
path='/view-applications'
/>

path="/view-applications"
/>
</Routes>

);
}

Expand Down