-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve merge conflict by keeping changes from feat/HNG-External-pages
- Loading branch information
Showing
6 changed files
with
148 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
"use client"; | ||
|
||
import { Plus } from "lucide-react"; | ||
import Link from "next/link"; | ||
import { useEffect, useState } from "react"; | ||
|
||
import { Breadcrumb } from "~/components/common/breadcrumb"; | ||
|
@@ -43,7 +44,7 @@ const JobDetails = () => { | |
<main className="mx-auto max-w-7xl px-5 py-10 md:px-10 lg:px-10 xl:px-10"> | ||
<Breadcrumb pages={pages} maxPages={isSmallScreen ? 2 : 3} /> | ||
|
||
<div className="mb-4 mt-8 grid w-full auto-rows-min grid-cols-1 pb-2 md:grid-cols-3"> | ||
<div className="mb-4 mt-[60px] grid w-full auto-rows-min grid-cols-1 pb-2 md:grid-cols-3"> | ||
<div className="col-span-1 mb-6 sm:col-span-2 md:mr-16 xl:mr-40"> | ||
<div className="flex flex-col justify-start"> | ||
<h1 className="mb-3 text-3xl font-bold text-neutral-dark-2 md:text-[38px]"> | ||
|
@@ -209,17 +210,19 @@ const JobDetails = () => { | |
</div> | ||
</div> | ||
|
||
<div className="my-10 mb-40 flex flex-row items-center justify-center"> | ||
<CustomButton | ||
variant="primary" | ||
size="lg" | ||
icon={isSmallScreen ? undefined : <Plus />} | ||
isLeftIconVisible={isSmallScreen} | ||
isDisabled={false} | ||
className={`h-[50px] w-[250px]`} | ||
> | ||
Apply Now | ||
</CustomButton> | ||
<div className="my-10 mb-8 flex flex-row items-center justify-center"> | ||
<Link href="mailto:[email protected]" passHref> | ||
<CustomButton | ||
variant="primary" | ||
size="lg" | ||
icon={isSmallScreen ? undefined : <Plus />} | ||
isLeftIconVisible={isSmallScreen} | ||
isDisabled={false} | ||
className={`h-[50px] w-[250px]`} | ||
> | ||
Apply Now | ||
</CustomButton> | ||
</Link> | ||
</div> | ||
</main> | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// usePagination.ts | ||
import { useEffect, useState } from "react"; | ||
|
||
interface UsePaginationProperties { | ||
totalItems: number; | ||
itemsPerPage: number; | ||
initialPage?: number; | ||
} | ||
|
||
interface UsePaginationReturn { | ||
currentPage: number; | ||
pageCount: number; | ||
changePage: (page: number) => void; | ||
} | ||
|
||
export function usePagination({ | ||
totalItems, | ||
itemsPerPage, | ||
initialPage = 1, | ||
}: UsePaginationProperties): UsePaginationReturn { | ||
const [currentPage, setCurrentPage] = useState<number>(initialPage); | ||
const [pageCount, setPageCount] = useState<number>(0); | ||
|
||
useEffect(() => { | ||
setPageCount(Math.ceil(totalItems / itemsPerPage)); | ||
}, [totalItems, itemsPerPage]); | ||
|
||
const changePage = (page: number) => { | ||
const pageNumber = Math.max(1, Math.min(page, pageCount)); | ||
setCurrentPage(pageNumber); | ||
}; | ||
|
||
return { | ||
currentPage, | ||
pageCount, | ||
changePage, | ||
}; | ||
} |