Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
076ee4e
fix: improve timeline input , ui improvement and fixes for participat…
Benjtalkshow Mar 4, 2026
6a457cd
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Mar 4, 2026
f660875
fix: implement 2fa for email and password login
Benjtalkshow Mar 5, 2026
5460d20
fix: fix conflict
Benjtalkshow Mar 5, 2026
7b8308d
fix: fix conflict
Benjtalkshow Mar 5, 2026
31adf9f
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Mar 5, 2026
b6122c4
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Mar 5, 2026
7e57ddb
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Mar 5, 2026
156b0a8
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Mar 6, 2026
a6599eb
fix: fix submission form
Benjtalkshow Mar 6, 2026
f24e050
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Mar 6, 2026
222cd45
fix: fix hackathon submission and participant page
Benjtalkshow Mar 7, 2026
acad424
fix: fix hackathon submission and participant page
Benjtalkshow Mar 7, 2026
efda241
fix: fix auto refresh ib submission page
Benjtalkshow Mar 7, 2026
310a353
fix: fix conflict
Benjtalkshow Mar 7, 2026
dffd842
fix: hackathon submission fixes
Benjtalkshow Mar 8, 2026
a2ddd1d
fix: fix coderabbit corrections
Benjtalkshow Mar 9, 2026
08b85d2
fix: fix coderabbit corrections
Benjtalkshow Mar 9, 2026
fb3e148
chore: write boundless on x challenge blog
Benjtalkshow Mar 9, 2026
3408994
fix: remove blog
Benjtalkshow Mar 9, 2026
555ff6d
fix: fix conflict
Benjtalkshow Mar 9, 2026
8201463
fix: my project dashbaord count and extend hackathon deadline
Benjtalkshow Mar 10, 2026
cfd9d54
fix: my project dashbaord count and extend hackathon deadline
Benjtalkshow Mar 10, 2026
04d5abc
fix: fix auto validate wallet address and user nav
Benjtalkshow Mar 10, 2026
cac0c04
fix: fix notification badge
Benjtalkshow Mar 10, 2026
a466f87
fix: fix conflict
Benjtalkshow Mar 10, 2026
f9671cf
fix: fix coderabbit corrections
Benjtalkshow Mar 10, 2026
7db56ec
Merge branch 'main' of https://github.com/Benjtalkshow/boundless into…
Benjtalkshow Mar 10, 2026
62b0b19
fix: fix pagination in organization participants page
Benjtalkshow Mar 10, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const ParticipantsPage: React.FC = () => {
const hackathonId = params.hackathonId as string;

const [view, setView] = useState<'table' | 'grid'>('table');
const [pageSize, setPageSize] = useState(PAGE_SIZE);
const [filters, setFilters] = useState<FilterState>({
search: '',
status: 'all',
Expand All @@ -63,9 +64,9 @@ const ParticipantsPage: React.FC = () => {
() => ({
organizationId,
autoFetch: false,
pageSize: PAGE_SIZE, // Grid looks better with multiples of 3/4
pageSize, // Use dynamic page size
}),
[organizationId]
[organizationId, pageSize]
);

const {
Expand Down Expand Up @@ -110,7 +111,7 @@ const ParticipantsPage: React.FC = () => {
fetchParticipants(
actualHackathonId,
1,
PAGE_SIZE,
pageSize,
mapFiltersToParams(filters, debouncedSearch)
);
}
Expand All @@ -120,6 +121,7 @@ const ParticipantsPage: React.FC = () => {
debouncedSearch,
filters.status,
filters.type,
pageSize,
]);

// Statistics
Expand Down Expand Up @@ -161,12 +163,12 @@ const ParticipantsPage: React.FC = () => {
}, [organizationId, actualHackathonId]);

// Handlers
const handlePageChange = (page: number) => {
const handlePageChange = (page: number, limit?: number) => {
if (actualHackathonId) {
fetchParticipants(
actualHackathonId,
page,
PAGE_SIZE,
limit ?? pageSize,
mapFiltersToParams(filters, debouncedSearch)
);
}
Expand Down Expand Up @@ -220,7 +222,7 @@ const ParticipantsPage: React.FC = () => {
fetchParticipants(
actualHackathonId,
participantsPagination.currentPage,
PAGE_SIZE,
pageSize,
mapFiltersToParams(filters, debouncedSearch)
);
}
Expand All @@ -241,16 +243,17 @@ const ParticipantsPage: React.FC = () => {
},
onPaginationChange: updater => {
if (typeof updater === 'function') {
const newState = (
updater as (old: { pageIndex: number; pageSize: number }) => {
pageIndex: number;
pageSize: number;
}
)({
const newState = updater({
pageIndex: participantsPagination.currentPage - 1,
pageSize: participantsPagination.itemsPerPage,
});
handlePageChange(newState.pageIndex + 1);

if (newState.pageSize !== participantsPagination.itemsPerPage) {
setPageSize(newState.pageSize);
handlePageChange(1, newState.pageSize);
} else {
handlePageChange(newState.pageIndex + 1);
}
}
},
});
Expand Down
32 changes: 18 additions & 14 deletions hooks/use-hackathons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,19 @@ export function useHackathons(
organizationId, // Add organization filter
});

const pagination = (response.data?.pagination ||
response.meta?.pagination) as any;
setHackathons(response.data?.hackathons || []);
setHackathonsPagination({
currentPage: response.data?.pagination.page || 1,
totalPages: response.data?.pagination.totalPages || 1,
totalItems: response.data?.pagination.total || 0,
itemsPerPage: response.data?.pagination.limit || pageSize,
hasNext: response.data?.pagination.hasNext || false,
hasPrev: response.data?.pagination.hasPrev || false,
currentPage: pagination?.page || 1,
totalPages: pagination?.totalPages || 1,
totalItems: pagination?.total || 0,
itemsPerPage: pagination?.limit || pageSize,
hasNext: !!pagination?.hasNext,
hasPrev: !!pagination?.hasPrev,
});
// Update ref immediately
hackathonsPageRef.current = response.data?.pagination.page || 1;
hackathonsPageRef.current = pagination?.page || 1;
} catch (error) {
const errorMessage =
error instanceof Error ? error.message : 'Failed to fetch hackathons';
Expand Down Expand Up @@ -575,16 +577,18 @@ export function useHackathons(
filters ?? initialParticipantFilters
);

const pagination = (response.data?.pagination ||
response.meta?.pagination) as any;
setParticipants(response.data?.participants || []);
setParticipantsPagination({
currentPage: response.data?.pagination.page || 1,
totalPages: response.data?.pagination.totalPages || 1,
totalItems: response.data?.pagination.total || 0,
itemsPerPage: response.data?.pagination.limit || pageSize,
hasNext: response.data?.pagination.hasNext || false,
hasPrev: response.data?.pagination.hasPrev || false,
currentPage: pagination?.page || 1,
totalPages: pagination?.totalPages || 1,
totalItems: pagination?.total || 0,
itemsPerPage: pagination?.limit || pageSize,
hasNext: !!pagination?.hasNext,
hasPrev: !!pagination?.hasPrev,
});
participantsPageRef.current = response.data?.pagination.page || 1;
participantsPageRef.current = pagination?.page || 1;
} catch (error) {
const errorMessage =
error instanceof Error
Expand Down
Loading