Skip to content

Commit

Permalink
Merge pull request #113 from Vero-Ventures/hotfix/add-button-job-page
Browse files Browse the repository at this point in the history
Hotfix/add button job page
  • Loading branch information
mai-vu authored May 28, 2024
2 parents 811d3a3 + 228b95d commit f078b0c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/app/jobsite/[jobsiteName]/jobposting/[id]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export default function JobPosting({ params }) {

return (
<main className="w-full max-w-5xl mx-auto px-4 md:px-6 py-7 md:py-4">
<JobDetail colourTheme={COLOUR_THEME} postingID={postingID}></JobDetail>
<JobDetail
colourTheme={COLOUR_THEME}
postingID={postingID}
showJobPageBtn={false}></JobDetail>
</main>
);
}
3 changes: 2 additions & 1 deletion src/app/jobsite/[jobsiteName]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ export default function Home({ params }) {
<JobDetail
colourTheme={COLOUR_THEME}
postingID={postingID}
jobSiteName={JOBSITE_NAME}></JobDetail>
jobSiteName={JOBSITE_NAME}
showJobPageBtn={true}></JobDetail>
)}
</div>
</div>
Expand Down
10 changes: 9 additions & 1 deletion src/components/jobsite/jobdetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import UserIcon from '@/components/icons/userIcon';
import EmailIcon from '@/components/icons/emailIcon';
import Loading from '@/components/ui/Loading';
import Error from '@/components/jobsite/error';
import Link from 'next/link';

export default function JobDetail({ colourTheme, postingID }) {
export default function JobDetail({ colourTheme, postingID, showJobPageBtn }) {
const [jobDetail, setJobDetail] = useState({});
const [isLoading, setIsLoading] = useState(true);
const [isExist, setIsExist] = useState(true); // whether given jobpost exists or not
Expand Down Expand Up @@ -56,6 +57,13 @@ export default function JobDetail({ colourTheme, postingID }) {
<div className="text-right text-sm text-gray-500 dark:text-gray-400 mt-1 lg:mt-0">
{jobDetail.datePosted}
</div>
{showJobPageBtn && (
<Link
className={`inline-flex h-9 items-center justify-center rounded-md ${colourTheme.base} px-4 py-2 text-sm font-medium text-gray-50 shadow transition-colors hover:${colourTheme.buttonHover} focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-950 disabled:pointer-events-none disabled:opacity-50`}
href={`/jobposting/${jobDetail._id}`}>
Job Page
</Link>
)}
</div>
<div className="grid text-sm md:grid-cols-2 gap-6">
<div className="space-y-4">
Expand Down

0 comments on commit f078b0c

Please sign in to comment.