Skip to content

Commit 66d12b8

Browse files
committed
feat: mobile view restyled
1 parent d0b6c7c commit 66d12b8

File tree

6 files changed

+37
-19
lines changed

6 files changed

+37
-19
lines changed

web/src/pages/Home/TopJurors/Header/Coherence.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const Coherence: React.FC = () => {
3535

3636
return (
3737
<Container>
38-
<WithHelpTooltip place={isDesktop ? "top" : "left"} tooltipMsg={coherentVotesTooltipMsg}></WithHelpTooltip>
38+
<WithHelpTooltip place={isDesktop ? "top" : "right"} tooltipMsg={coherentVotesTooltipMsg}></WithHelpTooltip>
3939
</Container>
4040
);
4141
};

web/src/pages/Home/TopJurors/Header/Score.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const Score: React.FC = () => {
3333

3434
return (
3535
<Container>
36-
<WithHelpTooltip place={isDesktop ? "top" : "left"} tooltipMsg={scoreTooltipMsg}></WithHelpTooltip>
36+
<WithHelpTooltip place={isDesktop ? "top" : "right"} tooltipMsg={scoreTooltipMsg}></WithHelpTooltip>
3737
</Container>
3838
);
3939
};

web/src/pages/Home/TopJurors/JurorCard/Coherence.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const Container = styled.div`
1212
color: ${({ theme }) => theme.primaryText};
1313
flex-wrap: wrap;
1414
justify-content: center;
15+
margin-top: 2px;
1516
`;
1617

1718
interface ICoherence {

web/src/pages/Home/TopJurors/JurorCard/MobileCard.tsx

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import styled, { css } from "styled-components";
44
import { landscapeStyle } from "styles/landscapeStyle";
55
import { hoverShortTransitionTiming } from "styles/commonStyles";
66

7+
import HeaderScore from "../Header/Score";
78
import HeaderCoherence from "../Header/Coherence";
89
import HeaderRewards from "../Header/Rewards";
910

@@ -12,6 +13,7 @@ import JurorLevel from "./JurorLevel";
1213
import JurorTitle from "./JurorTitle";
1314
import Rank from "./Rank";
1415
import Rewards from "./Rewards";
16+
import Score from "./Score";
1517

1618
const Container = styled.div`
1719
${hoverShortTransitionTiming}
@@ -49,32 +51,40 @@ const TopSide = styled.div`
4951
const RankAndTitle = styled.div`
5052
display: flex;
5153
flex-direction: row;
54+
align-items: center;
5255
gap: 8px;
5356
`;
5457

55-
const HeaderRewardsAndRewards = styled.div`
58+
const BottomSide = styled.div`
59+
width: 100%;
5660
display: flex;
5761
flex-direction: column;
58-
width: 100%;
62+
justify-content: space-between;
5963
gap: 8px;
6064
`;
6165

62-
const BottomSide = styled.div`
63-
width: 100%;
66+
const HeaderScoreAndScore = styled.div`
6467
display: flex;
68+
width: 100%;
6569
flex-direction: row;
66-
justify-content: space-between;
70+
align-items: center;
71+
gap: 8px;
6772
`;
6873

6974
const HeaderCoherenceAndCoherence = styled.div`
7075
display: flex;
71-
flex-direction: column;
72-
align-items: flex-end;
76+
width: 100%;
77+
flex-direction: row;
78+
align-items: center;
7379
gap: 8px;
80+
`;
7481

75-
svg {
76-
margin-right: 0;
77-
}
82+
const HeaderRewardsAndRewards = styled.div`
83+
display: flex;
84+
width: 100%;
85+
flex-direction: row;
86+
align-items: center;
87+
gap: 8px;
7888
`;
7989

8090
interface IMobileCard {
@@ -96,20 +106,24 @@ const MobileCard: React.FC<IMobileCard> = ({
96106
<Container>
97107
<TopSide>
98108
<RankAndTitle>
99-
{rank ? <Rank rank={rank} /> : null}
100-
<JurorTitle address={address} />
109+
{rank ? <Rank {...{ rank }} /> : null}
110+
<JurorTitle {...{ address }} />
101111
</RankAndTitle>
102112
<JurorLevel coherenceScore={Number(coherenceScore)} />
103113
</TopSide>
104114
<BottomSide>
105-
<HeaderRewardsAndRewards>
106-
<HeaderRewards />
107-
<Rewards address={address} />
108-
</HeaderRewardsAndRewards>
115+
<HeaderScoreAndScore>
116+
<HeaderScore />
117+
<Score {...{ coherenceScore }} />
118+
</HeaderScoreAndScore>
109119
<HeaderCoherenceAndCoherence>
110120
<HeaderCoherence />
111121
<Coherence {...{ totalCoherentVotes, totalResolvedVotes }} />
112122
</HeaderCoherenceAndCoherence>
123+
<HeaderRewardsAndRewards>
124+
<HeaderRewards />
125+
<Rewards {...{ address }} />
126+
</HeaderRewardsAndRewards>
113127
</BottomSide>
114128
</Container>
115129
);

web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const Container = styled.div`
1717
gap: 8px;
1818
align-items: center;
1919
flex-wrap: wrap;
20+
margin-top: 2px;
2021
2122
${landscapeStyle(
2223
() => css`

web/src/pages/Home/TopJurors/JurorCard/Score.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
import { Tooltip } from "@kleros/ui-components-library";
21
import React from "react";
32

43
import styled from "styled-components";
54

5+
import { Tooltip } from "@kleros/ui-components-library";
6+
67
const Container = styled.div`
78
display: flex;
89
align-items: center;
910
font-weight: 600;
1011
color: ${({ theme }) => theme.primaryText};
1112
flex-wrap: wrap;
1213
justify-content: center;
14+
margin-top: 2px;
1315
`;
1416

1517
interface IScore {

0 commit comments

Comments
 (0)