Skip to content

Commit c65acd9

Browse files
committed
refactor: abstract max width landscape
1 parent 43554f7 commit c65acd9

File tree

9 files changed

+30
-22
lines changed

9 files changed

+30
-22
lines changed

web/src/components/ErrorFallback.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import React from "react";
22
import styled, { css } from "styled-components";
33

4+
import { MAX_WIDTH_LANDSCAPE, landscapeStyle } from "styles/landscapeStyle";
5+
import { responsiveSize } from "styles/responsiveSize";
6+
47
import { FallbackProps } from "react-error-boundary";
58

69
import { Button } from "@kleros/ui-components-library";
710

811
import ErrorIcon from "svgs/icons/warning-outline.svg";
912

10-
import { landscapeStyle } from "styles/landscapeStyle";
11-
import { responsiveSize } from "styles/responsiveSize";
12-
1313
import HeroImage from "./HeroImage";
1414

1515
const Container = styled.div`
1616
width: 100%;
1717
height: 100vh;
1818
background-color: ${({ theme }) => theme.lightBackground};
1919
padding: ${responsiveSize(32, 80)} ${responsiveSize(24, 136)} ${responsiveSize(76, 96)};
20-
max-width: 1400px;
20+
max-width: ${MAX_WIDTH_LANDSCAPE};
2121
margin: 0 auto;
2222
`;
2323

web/src/pages/Cases/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
22
import styled from "styled-components";
3+
import { MAX_WIDTH_LANDSCAPE } from "styles/landscapeStyle";
34

45
import { Routes, Route } from "react-router-dom";
56

@@ -13,7 +14,7 @@ const Container = styled.div`
1314
width: 100%;
1415
background-color: ${({ theme }) => theme.lightBackground};
1516
padding: ${responsiveSize(32, 80)} ${responsiveSize(24, 136)} ${responsiveSize(76, 96)};
16-
max-width: 1400px;
17+
max-width: ${MAX_WIDTH_LANDSCAPE};
1718
margin: 0 auto;
1819
`;
1920

web/src/pages/Courts/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React from "react";
22
import styled from "styled-components";
33

4-
import { Routes, Route, Navigate } from "react-router-dom";
5-
64
import { responsiveSize } from "styles/responsiveSize";
5+
import { MAX_WIDTH_LANDSCAPE } from "styles/landscapeStyle";
6+
7+
import { Routes, Route, Navigate } from "react-router-dom";
78

89
import CourtDetails from "./CourtDetails";
910
import TopSearch from "./TopSearch";
@@ -12,7 +13,7 @@ const Container = styled.div`
1213
width: 100%;
1314
background-color: ${({ theme }) => theme.lightBackground};
1415
padding: ${responsiveSize(32, 80)} ${responsiveSize(24, 136)} ${responsiveSize(76, 96)};
15-
max-width: 1400px;
16+
max-width: ${MAX_WIDTH_LANDSCAPE};
1617
margin: 0 auto;
1718
`;
1819

web/src/pages/Dashboard/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import React, { useMemo } from "react";
22
import styled from "styled-components";
33

4+
import { MAX_WIDTH_LANDSCAPE } from "styles/landscapeStyle";
5+
import { responsiveSize } from "styles/responsiveSize";
6+
47
import { useNavigate, useParams } from "react-router-dom";
58
import { useAccount } from "wagmi";
69

@@ -12,8 +15,6 @@ import { useUserQuery } from "queries/useUser";
1215

1316
import { OrderDirection } from "src/graphql/graphql";
1417

15-
import { responsiveSize } from "styles/responsiveSize";
16-
1718
import CasesDisplay from "components/CasesDisplay";
1819
import ConnectWallet from "components/ConnectWallet";
1920
import ScrollTop from "components/ScrollTop";
@@ -25,7 +26,7 @@ const Container = styled.div`
2526
width: 100%;
2627
background-color: ${({ theme }) => theme.lightBackground};
2728
padding: ${responsiveSize(32, 80)} ${responsiveSize(24, 136)} ${responsiveSize(76, 96)};
28-
max-width: 1400px;
29+
max-width: ${MAX_WIDTH_LANDSCAPE};
2930
margin: 0 auto;
3031
`;
3132

web/src/pages/GetPnk/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React from "react";
22
import styled from "styled-components";
33

4-
import { isProductionDeployment } from "consts/index";
5-
4+
import { MAX_WIDTH_LANDSCAPE } from "styles/landscapeStyle";
65
import { responsiveSize } from "styles/responsiveSize";
76

7+
import { isProductionDeployment } from "consts/index";
8+
89
import ClaimPnkButton from "components/ClaimPnkButton";
910
import HeroImage from "components/HeroImage";
1011
import ScrollTop from "components/ScrollTop";
@@ -19,7 +20,7 @@ const Container = styled.div`
1920
width: 100%;
2021
background-color: ${({ theme }) => theme.lightBackground};
2122
padding: ${responsiveSize(32, 72)} ${responsiveSize(24, 132)} ${responsiveSize(76, 96)};
22-
max-width: 1400px;
23+
max-width: ${MAX_WIDTH_LANDSCAPE};
2324
margin: 0 auto;
2425
display: flex;
2526
flex-direction: column;

web/src/pages/Home/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import React from "react";
22
import styled from "styled-components";
33

4+
import { MAX_WIDTH_LANDSCAPE } from "styles/landscapeStyle";
5+
import { responsiveSize } from "styles/responsiveSize";
6+
47
import { HomePageProvider } from "hooks/useHomePageContext";
58
import { getOneYearAgoTimestamp } from "utils/date";
69

7-
import { responsiveSize } from "styles/responsiveSize";
8-
910
import HeroImage from "components/HeroImage";
1011
import LatestCases from "components/LatestCases";
1112
import ScrollTop from "components/ScrollTop";
@@ -22,7 +23,7 @@ const Container = styled.div`
2223
width: 100%;
2324
background-color: ${({ theme }) => theme.lightBackground};
2425
padding: ${responsiveSize(32, 72)} ${responsiveSize(24, 132)} ${responsiveSize(76, 96)};
25-
max-width: 1400px;
26+
max-width: ${MAX_WIDTH_LANDSCAPE};
2627
margin: 0 auto;
2728
`;
2829

web/src/pages/Resolver/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Navigate, Route, Routes, useLocation } from "react-router-dom";
55
import { useToggle } from "react-use";
66
import { useAccount } from "wagmi";
77

8-
import { landscapeStyle } from "styles/landscapeStyle";
8+
import { MAX_WIDTH_LANDSCAPE, landscapeStyle } from "styles/landscapeStyle";
99
import { responsiveSize } from "styles/responsiveSize";
1010

1111
import ConnectWallet from "components/ConnectWallet";
@@ -38,7 +38,7 @@ const Container = styled.div`
3838
padding: ${responsiveSize(24, 32)};
3939
padding-top: ${responsiveSize(24, 28)};
4040
padding-bottom: ${responsiveSize(76, 96)};
41-
max-width: 1400px;
41+
max-width: ${MAX_WIDTH_LANDSCAPE};
4242
margin: 0 auto;
4343
`;
4444

web/src/pages/Settings/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import React from "react";
22
import styled from "styled-components";
33

4-
import { Route, Routes } from "react-router-dom";
5-
4+
import { MAX_WIDTH_LANDSCAPE } from "styles/landscapeStyle";
65
import { responsiveSize } from "styles/responsiveSize";
76

7+
import { Route, Routes } from "react-router-dom";
8+
89
import EmailConfirmation from "./EmailConfirmation";
910

1011
const Container = styled.div`
1112
width: 100%;
1213
background-color: ${({ theme }) => theme.lightBackground};
1314
padding: ${responsiveSize(32, 80)} ${responsiveSize(24, 136)} ${responsiveSize(76, 96)};
14-
max-width: 1400px;
15+
max-width: ${MAX_WIDTH_LANDSCAPE};
1516
margin: 0 auto;
1617
`;
1718

web/src/styles/landscapeStyle.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { css, DefaultTheme, FlattenInterpolation, ThemeProps } from "styled-components";
22

3+
export const MAX_WIDTH_LANDSCAPE = "1400px";
4+
35
export const BREAKPOINT_LANDSCAPE = 900;
46

57
export const landscapeStyle = (styleFn: () => FlattenInterpolation<ThemeProps<DefaultTheme>>) => css`

0 commit comments

Comments
 (0)