Skip to content

Commit

Permalink
fix: updates group page
Browse files Browse the repository at this point in the history
  • Loading branch information
SilveerDusk committed Jun 4, 2024
1 parent 4a687ad commit f4b3abc
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions frontend/src/pages/MyGroupsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ const GroupPage: React.FC<Props> = ({
const lowerQuery = input.toLowerCase();
setFilteredGroups(
groupList.filter((group) =>
group.groupName.toLowerCase().includes(lowerQuery),
),
group.groupName.toLowerCase().includes(lowerQuery)
)
);
}
};
Expand All @@ -64,7 +64,7 @@ const GroupPage: React.FC<Props> = ({
fetchGroups(stateVariable.user.groups)
.then((tempGroupList) => {
setGroupList(tempGroupList);
setFilteredGroups(groupList); // Initialize with full list
setFilteredGroups(tempGroupList); // Initialize with full list
})
.catch((err) => {
console.log(`Terrible error occurred! ${err}`);
Expand Down Expand Up @@ -164,25 +164,10 @@ const GroupPage: React.FC<Props> = ({
>
{stateVariable.user?.groups.length !== 0 &&
filteredGroups.length === 0 ? (
skelIds.map((id, ind) => {
const currentPage = Math.floor(ind / (gridDims[0] * gridDims[1]));
if (currentPage + 1 != selectedPage) return null;
const row = Math.floor(
(ind % (gridDims[1] * gridDims[0])) / gridDims[1],
);
const col = ind % gridDims[1];
skelIds.map((id) => {
return (
<GridItem w="100%" h="100%" key={`skelly${id}`}>
<SkeletonGroup
width="100%"
height="100%"
corners={[
row === 0 || col === 0,
row === 0 || col === gridDims[1] - 1,
row === gridDims[0] - 1 || col === gridDims[1] - 1,
row === gridDims[0] - 1 || col === 0,
]}
/>
<SkeletonGroup width="100%" height="100%" />
</GridItem>
);
})
Expand All @@ -191,7 +176,7 @@ const GroupPage: React.FC<Props> = ({
const currentPage = Math.floor(ind / (gridDims[0] * gridDims[1]));
if (currentPage + 1 != selectedPage) return null;
const row = Math.floor(
(ind % (gridDims[1] * gridDims[0])) / gridDims[1],
(ind % (gridDims[1] * gridDims[0])) / gridDims[1]
);
const col = ind % gridDims[1];
return (
Expand Down

0 comments on commit f4b3abc

Please sign in to comment.