Skip to content

Commit

Permalink
fix(app/home-page/leaderboard): fix dto
Browse files Browse the repository at this point in the history
  • Loading branch information
KacperKoza343 committed Aug 22, 2024
1 parent c2d6854 commit 50bf919
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,10 @@ export const Table = ({
zIndex: 2,
backgroundColor: colorPalette.whiteBackground,
'&::after': {
content: '""',
position: 'absolute',
bottom: '0',
right: '0',
height: index === 0 ? '85%' : '100%',
width: '1px',
...getAfterElementProperties(
index === 0,
visibleRows.length === index + 1
),
backgroundColor: `${colorPalette.skyOpacity}`,
},
},
Expand Down Expand Up @@ -208,3 +206,39 @@ export const Table = ({
</MuiTable>
);
};

function getAfterElementProperties(
isFirstElement: boolean,
isLastElement: boolean
) {
if (isFirstElement) {
return {
content: '""',
position: 'absolute',
bottom: '0',
right: '0',
height: '85%',
width: '1px',
};
}

if (isLastElement) {
return {
content: '""',
position: 'absolute',
top: '0',
right: '0',
height: '85%',
width: '1px',
};
}

return {
content: '""',
position: 'absolute',
bottom: '0',
right: '0',
height: '100%',
width: '1px',
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function useLeaderboardDetails() {
return useQuery({
queryFn: async () => {
const { data } = await httpService.get(apiPaths.leaderboardDetails.path, {
params: { chainId },
params: { chainId: chainId === -1 ? undefined : chainId },
});

const validResponse = validateResponse(
Expand Down

0 comments on commit 50bf919

Please sign in to comment.