Skip to content

Commit 609c49a

Browse files
committed
refactor(web): update-responsiveSize-func
1 parent 007a570 commit 609c49a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+107
-142
lines changed

web/src/components/CasesDisplay/CasesListHeader.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { responsiveSize } from "styles/responsiveSize";
77
const Container = styled.div`
88
display: flex;
99
justify-content: space-between;
10-
${responsiveSize("gap", 15, 40, 300, 1250, "vw")}
10+
gap: calc(15vw + (40 - 15) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
1111
width: 100%;
1212
height: 100%;
1313
`;
@@ -17,10 +17,10 @@ const CasesData = styled.div`
1717
align-items: center;
1818
justify-content: space-around;
1919
width: 100%;
20-
${responsiveSize("marginLeft", 0, 33, 370)}
20+
margin-left: ${responsiveSize(0, 33)};
2121
flex-wrap: wrap;
2222
padding: 0 3%;
23-
${responsiveSize("gap", 24, 48, 300)}
23+
gap: ${responsiveSize(24, 48, 300)};
2424
`;
2525

2626
const CaseTitle = styled.div`
@@ -43,7 +43,7 @@ const CaseTitle = styled.div`
4343
`;
4444

4545
const StyledLabel = styled.label`
46-
${responsiveSize("marginLeft", 4, 8, 300, 900)}
46+
margin-left: ${responsiveSize(4, 8, 300, 900)};
4747
`;
4848

4949
const tooltipMsg =

web/src/components/CasesDisplay/Search.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const Container = styled.div`
1919
() =>
2020
css`
2121
flex-direction: row;
22-
${responsiveSize("gap", 4, 22)}
22+
gap: ${responsiveSize(4, 22)};
2323
`
2424
)}
2525
`;

web/src/components/CasesDisplay/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ const Divider = styled.hr`
1010
border: none;
1111
height: 1px;
1212
background-color: ${({ theme }) => theme.stroke};
13-
${responsiveSize("margin", 20, 24)}
13+
margin: ${responsiveSize(20, 24)};
1414
`;
1515

1616
const StyledTitle = styled.h1`
17-
${responsiveSize("marginBottom", 32, 48)}
17+
margin-bottom: ${responsiveSize(32, 48)};
1818
`;
1919

2020
interface ICasesDisplay extends ICasesGrid {

web/src/components/DisputeCard/DisputeInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const RestOfFieldsContainer = styled.div<{ isList?: boolean; isOverview?: boolea
5757
${landscapeStyle(
5858
() => css`
5959
flex-direction: row;
60-
${responsiveSize("gap", 4, 24, 300, 900)}
60+
gap: ${responsiveSize(4, 24, 300, 900)};
6161
justify-content: space-around;
6262
`
6363
)}

web/src/components/DisputeCard/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { responsiveSize } from "styles/responsiveSize";
1919

2020
const StyledCard = styled(Card)`
2121
width: 100%;
22-
${responsiveSize("height", 280, 296)}
22+
height: ${responsiveSize(280, 296)};
2323
2424
${landscapeStyle(
2525
() =>
@@ -43,7 +43,7 @@ const StyledListItem = styled(Card)`
4343

4444
const CardContainer = styled.div`
4545
height: calc(100% - 45px);
46-
${responsiveSize("padding", 20, 24)}
46+
padding: ${responsiveSize(20, 24)};
4747
display: flex;
4848
flex-direction: column;
4949
justify-content: space-between;
@@ -68,7 +68,7 @@ const ListTitle = styled.div`
6868
height: 100%;
6969
justify-content: start;
7070
align-items: center;
71-
${responsiveSize("width", 30, 40, 300, 1250, "vw")}
71+
width: calc(30vw + (40 - 30) * (min(max(100vw, 300px), 1250px)- 300px) / 950);
7272
`;
7373

7474
export const getPeriodEndTimestamp = (

web/src/components/EvidenceCard.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const StyledCard = styled(Card)`
1515
`;
1616

1717
const TextContainer = styled.div`
18-
${responsiveSize("padding", 8, 24)}
18+
padding: ${responsiveSize(8, 24)};
1919
> * {
2020
overflow-wrap: break-word;
2121
margin: 0;
@@ -35,7 +35,7 @@ const BottomShade = styled.div`
3535
display: flex;
3636
align-items: center;
3737
gap: 16px;
38-
padding: 12px calc(8px + (24 - 8) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
38+
padding: 12px ${responsiveSize(8, 24)};
3939
> * {
4040
flex-basis: 1;
4141
flex-shrink: 0;
@@ -46,8 +46,7 @@ const BottomShade = styled.div`
4646
const StyledA = styled.a`
4747
display: flex;
4848
margin-left: auto;
49-
${responsiveSize("gap", 5, 6)}
50-
49+
gap: ${responsiveSize(5, 6)};
5150
${landscapeStyle(
5251
() => css`
5352
> svg {

web/src/components/LatestCases.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import { isUndefined } from "utils/index";
88
import { responsiveSize } from "styles/responsiveSize";
99

1010
const Container = styled.div`
11-
${responsiveSize("marginTop", 48, 80)}
11+
margin-top: ${responsiveSize(48, 80)};
1212
`;
1313

1414
const Title = styled.h1`
15-
${responsiveSize("marginBottom", 16, 48)}
15+
margin-bottom: ${responsiveSize(16, 48)};
1616
`;
1717

1818
const DisputeContainer = styled.div`

web/src/components/Popup/Description/Appeal.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ const Container = styled.div`
99

1010
const StyledAmountFunded = styled.div`
1111
display: flex;
12-
${responsiveSize("marginLeft", 8, 44, 300)}
13-
${responsiveSize("marginRight", 8, 44, 300)}
12+
margin-left: ${responsiveSize(8, 44, 300)};
13+
margin-right: ${responsiveSize(8, 44, 300)};
1414
color: ${({ theme }) => theme.secondaryText};
1515
text-align: center;
1616
`;
1717

1818
const StyledOptionFunded = styled.div`
1919
display: flex;
20-
${responsiveSize("marginBottom", 16, 32, 300)}
21-
${responsiveSize("marginLeft", 8, 44, 300)}
22-
${responsiveSize("marginRight", 8, 44, 300)}
20+
margin-bottom: ${responsiveSize(16, 32, 300)};
21+
margin-left: ${responsiveSize(8, 44, 300)};
22+
margin-right: ${responsiveSize(8, 44, 300)};
2323
color: ${({ theme }) => theme.secondaryText};
2424
text-align: center;
2525
`;

web/src/components/Popup/Description/StakeWithdraw.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ const StyledKlerosLogo = styled(KlerosLogo)`
2020

2121
const StyledTitle = styled.div`
2222
display: flex;
23-
${responsiveSize("marginBottom", 16, 32, 300)}
24-
${responsiveSize("marginLeft", 8, 44, 300)}
25-
${responsiveSize("marginRight", 8, 44, 300)}
23+
margin-bottom: ${responsiveSize(16, 32, 300)};
24+
margin-left: ${responsiveSize(8, 44, 300)};
25+
margin-right: ${responsiveSize(8, 44, 300)};
2626
color: ${({ theme }) => theme.secondaryText};
2727
text-align: center;
2828
`;
@@ -31,20 +31,20 @@ const AmountStakedOrWithdrawnContainer = styled.div`
3131
font-size: 24px;
3232
font-weight: 600;
3333
color: ${({ theme }) => theme.secondaryPurple};
34-
${responsiveSize("marginBottom", 0, 4, 300)}
34+
margin-bottom: ${responsiveSize(0, 4, 300)};
3535
`;
3636

3737
const TotalStakeContainer = styled.div`
3838
display: flex;
3939
font-size: 14px;
4040
align-items: center;
4141
justify-content: center;
42-
${responsiveSize("marginBottom", 8, 32, 300)}
42+
margin-bottom: ${responsiveSize(8, 32, 300)};
4343
`;
4444

4545
const MyStakeContainer = styled.div`
4646
display: flex;
47-
margin: 0px calc(4px + (8 - 4) * ((100vw - 300px) / (1250 - 300)));
47+
margin: 0px ${responsiveSize(4, 8, 300)};
4848
color: ${({ theme }) => theme.secondaryText};
4949
`;
5050

web/src/components/Popup/ExtraInfo/StakeWithdrawExtraInfo.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const Container = styled.div`
66
display: flex;
77
color: ${({ theme }) => theme.secondaryText};
88
text-align: center;
9-
${responsiveSize("marginLeft", 8, 44, 300)}
10-
${responsiveSize("marginRight", 8, 44, 300)}
11-
${responsiveSize("marginTop", 8, 24, 300)}
9+
margin-top: ${responsiveSize(8, 24, 300)};
10+
margin-right: ${responsiveSize(8, 44, 300)};
11+
margin-left: ${responsiveSize(8, 44, 300)};
1212
`;
1313

1414
const StakeWithdrawExtraInfo: React.FC = () => {

0 commit comments

Comments
 (0)