Skip to content

Commit

Permalink
Merge pull request #2204 from ever-co/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
evereq authored Feb 12, 2024
2 parents a2658cf + 849e7d5 commit da392f4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion apps/web/app/[locale]/profile/[memberId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ const Profile = React.memo(function ProfilePage({ params }: { params: { memberId
)}

<Container fullWidth={fullWidth} className="mb-10">
{activityScreens[activityFilter] ?? null}
{hook.tab !== 'worked' ? (
<UserProfileTask profile={profile} tabFiltered={hook} />
) : (
activityScreens[activityFilter] ?? null
)}
</Container>
</MainLayout>
</>
Expand Down
1 change: 0 additions & 1 deletion apps/web/app/hooks/useInfinityFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const useInfinityScrolling = <T>(arr: T[], lim?: number) => {
}, [limit, offset]);

React.useEffect(() => {
console.log({ offset });
getSomeTasks(offset);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [offset]);
Expand Down
3 changes: 2 additions & 1 deletion apps/web/lib/features/user-profile-tasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function UserProfileTask({ profile, tabFiltered }: Props) {
profile.member?.running == true ? t.id !== profile.activeUserTeamTask?.id : t
);
const { nextOffset, data } = useInfinityScrolling(otherTasks);
const dataTodisplay = otherTasks.length > 10 ? otherTasks : data;
// const { total, onPageChange, itemsPerPage, itemOffset, endOffset, setItemsPerPage, currentItems } =
// usePagination(otherTasks);

Expand Down Expand Up @@ -84,7 +85,7 @@ export function UserProfileTask({ profile, tabFiltered }: Props) {
)}

<ul className="flex flex-col gap-6">
{data.map((task, index) => {
{dataTodisplay.map((task, index) => {
return (
<li key={task.id}>
<ObserverComponent isLast={index === data.length - 1} getNextData={nextOffset} />
Expand Down

0 comments on commit da392f4

Please sign in to comment.