Skip to content

Commit

Permalink
added create-job link on the header and opacity change in pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
sidhuiwnl committed Sep 6, 2024
1 parent 197e4fc commit 2127714
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
40 changes: 26 additions & 14 deletions src/components/pagination-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,23 @@ const PaginationPreviousButton = ({
baseUrl: string;
}) => {
const setQueryParams = useSetQueryParams();

const isPreviousDisabled = currentPage <= PAGE_INCREMENT;

return (
<PaginationPrevious
onClick={() =>
setQueryParams({
page: (currentPage - PAGE_INCREMENT).toString(),
})
}
aria-disabled={currentPage - PAGE_INCREMENT < PAGE_INCREMENT}
onClick={() => {
if (!isPreviousDisabled) {
setQueryParams({
page: (currentPage - PAGE_INCREMENT).toString(),
});
}
}}
aria-disabled={isPreviousDisabled}
role="button"
className="aria-disabled:pointer-events-none dark:bg-neutral-900 rounded-full bg-neutral-100"
className={`dark:bg-neutral-900 rounded-full bg-neutral-100 ${
isPreviousDisabled ? 'opacity-50 cursor-not-allowed' : ''
}`}
/>
);
};
Expand All @@ -35,16 +42,21 @@ const PaginationNextButton = ({
baseUrl: string;
}) => {
const setQueryParams = useSetQueryParams();
const isNextDisabled = currentPage >= totalPages;
return (
<PaginationNext
role="button"
onClick={() =>
setQueryParams({
page: (currentPage + PAGE_INCREMENT).toString(),
})
}
aria-disabled={currentPage > totalPages - PAGE_INCREMENT}
className="aria-disabled:pointer-events-none dark:bg-neutral-900 rounded-full bg-neutral-100"
onClick={() => {
if (!isNextDisabled) {
setQueryParams({
page: (currentPage + PAGE_INCREMENT).toString(),
});
}
}}
aria-disabled={isNextDisabled}
className={`dark:bg-neutral-900 rounded-full bg-neutral-100 ${
isNextDisabled ? 'opacity-50 cursor-not-allowed' : ''
}`}
/>
);
};
Expand Down
10 changes: 6 additions & 4 deletions src/lib/constant/app.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ import APP_PATHS from '@/config/path.config';
export const GITHUB_REPO = 'https://github.com/code100x/job-board';
export const navbar = [
{ id: 1, label: 'Jobs', path: APP_PATHS.JOBS },
{ id: 2, label: 'Create Job', path: '/create' },
{
id: 2,
id: 3,
label: 'Manage',
path: APP_PATHS.MANAGE_JOBS,
roleRequired: 'ADMIN',
},

// todo: add actual path
{ id: 3, label: 'Internship', path: '/' },
{ id: 4, label: 'Testimonials', path: '/' },
{ id: 5, label: 'FAQs', path: '/' },
{ id: 4, label: 'Internship', path: '/' },
{ id: 5, label: 'Testimonials', path: '/' },
{ id: 6, label: 'FAQs', path: '/' },
];

export const socials: {
Expand Down

0 comments on commit 2127714

Please sign in to comment.