Skip to content

Commit f21f689

Browse files
committed
refactor(web): add-no-juror-staked-notification-in-top-juror
1 parent 17502d9 commit f21f689

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

web/src/pages/Home/TopJurors/index.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ const ListContainer = styled.div`
2929
)}
3030
`;
3131

32+
const StyledLabel = styled.label`
33+
font-size: 16px;
34+
`;
35+
3236
const TopJurors: React.FC = () => {
3337
const { data: queryJurors } = useTopUsersByCoherenceScore();
3438

@@ -40,12 +44,24 @@ const TopJurors: React.FC = () => {
4044
return (
4145
<Container>
4246
<Title>Top Jurors</Title>
43-
<ListContainer>
44-
<Header />
45-
{!isUndefined(topJurors)
46-
? topJurors.map((juror) => <JurorCard key={juror.rank} address={juror.id} {...juror} />)
47-
: [...Array(5)].map((_, i) => <SkeletonDisputeListItem key={i} />)}
48-
</ListContainer>
47+
48+
{!isUndefined(topJurors) && topJurors.length > 0 ? (
49+
<ListContainer>
50+
<Header />
51+
{topJurors.map((juror) => (
52+
<JurorCard key={juror.rank} address={juror.id} {...juror} />
53+
))}
54+
</ListContainer>
55+
) : !isUndefined(topJurors) && topJurors.length === 0 ? (
56+
<StyledLabel>There are no jurors staked yet.</StyledLabel>
57+
) : (
58+
<ListContainer>
59+
<Header />
60+
{[...Array(5)].map((_, i) => (
61+
<SkeletonDisputeListItem key={i} />
62+
))}
63+
</ListContainer>
64+
)}
4965
</Container>
5066
);
5167
};

0 commit comments

Comments
 (0)