11import React from "react" ;
22import { Navigate , Route , Routes , useLocation } from "react-router-dom" ;
3- import styled , { css } from "styled-components" ;
43import { useWindowSize } from "react-use" ;
5- import { BREAKPOINT_LANDSCAPE , MAX_WIDTH_LANDSCAPE , landscapeStyle } from "styles/landscapeStyle" ;
64import Title from "./EscrowDetails/Title" ;
75import TypeOfEscrow from "./EscrowDetails/TypeOfEscrow" ;
86import HeroImage from "./HeroImage" ;
@@ -12,48 +10,34 @@ import Deliverable from "./Terms/Deliverable";
1210import Notifications from "./Terms/Notifications" ;
1311import Payment from "./Terms/Payment" ;
1412import Timeline from "./Timeline" ;
15- import { responsiveSize } from "styles/responsiveSize" ;
1613import { useAccount } from "wagmi" ;
1714import ConnectWallet from "components/ConnectWallet" ;
18- import { ConnectWalletContainer } from "../MyTransactions" ;
1915import { DEFAULT_CHAIN } from "consts/chains" ;
2016import { EnsureAuth } from "components/EnsureAuth" ;
21-
22- const Container = styled . div `
23- width: 100%;
24- background-color: ${ ( { theme } ) => theme . lightBackground } ;
25- padding: 24px 16px 40px;
26- max-width: ${ MAX_WIDTH_LANDSCAPE } ;
27- margin: 0 auto;
28-
29- ${ landscapeStyle (
30- ( ) => css `
31- padding: 32px ${ responsiveSize ( 0 , 132 ) } 60px;
32- `
33- ) }
34- ` ;
35-
36- const MiddleContentContainer = styled . div `
37- display: flex;
38- justify-content: center;
39- ` ;
17+ import clsx from "clsx" ;
18+ import { LG_BREAKPOINT } from "src/styles/breakpoints" ;
4019
4120const NewTransaction : React . FC = ( ) => {
4221 const location = useLocation ( ) ;
4322 const { width } = useWindowSize ( ) ;
4423 const { isConnected, chain } = useAccount ( ) ;
4524 const isPreviewPage = location . pathname . includes ( "/preview" ) ;
46- const isMobileView = width <= BREAKPOINT_LANDSCAPE ;
25+ const isMobileView = width <= LG_BREAKPOINT ;
4726 const isOnSupportedChain = chain ?. id === DEFAULT_CHAIN ;
4827
4928 return (
5029 < >
5130 { ! isPreviewPage || isMobileView ? < HeroImage /> : null }
52- < Container >
31+ < div
32+ className = { clsx (
33+ "w-full max-w-landscape mx-auto bg-klerosUIComponentsLightBackground" ,
34+ "px-4 pt-6 pb-10 lg:px-fluid-0-132 lg:pt-8 lg:pb-[60px]"
35+ ) }
36+ >
5337 { isConnected && isOnSupportedChain && ! isPreviewPage ? < Timeline /> : null }
5438 { isConnected && isOnSupportedChain ? (
5539 < EnsureAuth message = { "Sign a message to verify yourself." } buttonText = "Verify" >
56- < MiddleContentContainer >
40+ < div className = "flex justify-center" >
5741 < Routes >
5842 < Route index element = { < Navigate to = "escrow-type" replace /> } />
5943 < Route path = "/escrow-type/*" element = { < TypeOfEscrow /> } />
@@ -64,16 +48,16 @@ const NewTransaction: React.FC = () => {
6448 < Route path = "/notifications/*" element = { < Notifications /> } />
6549 < Route path = "/preview/*" element = { < Preview /> } />
6650 </ Routes >
67- </ MiddleContentContainer >
51+ </ div >
6852 </ EnsureAuth >
6953 ) : (
70- < ConnectWalletContainer >
54+ < div className = "flex flex-col items-center text-center text-klerosUIComponentsPrimaryText" >
7155 To create a new escrow transaction, connect first and switch to the supported chain
72- < hr />
56+ < hr className = "my-2" />
7357 < ConnectWallet />
74- </ ConnectWalletContainer >
58+ </ div >
7559 ) }
76- </ Container >
60+ </ div >
7761 </ >
7862 ) ;
7963} ;
0 commit comments