Skip to content

Commit 8cccdc1

Browse files
committed
new version modal
1 parent a7aced0 commit 8cccdc1

File tree

4 files changed

+132
-1
lines changed

4 files changed

+132
-1
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@
138138
},
139139
"lint-staged": {
140140
"*.{jsx,js,ts,tsx}": [
141-
"bash -c 'npm run type-check'",
142141
"npm run lint",
143142
"git add ."
144143
]

src/assets/images/beta-image.jpg

233 KB
Loading
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
import React, { useState } from 'react'
2+
import styled, { css } from 'styled-components'
3+
import BetaImage from '../../assets/images/beta-image.jpg'
4+
import { ButtonPrimary, ButtonSecondary } from '../Button'
5+
6+
const Modal = styled.div`
7+
width: 100vw;
8+
height: 100dvh;
9+
padding: 144px 0;
10+
position: fixed;
11+
z-index: 9999999;
12+
top: 0;
13+
left: 0;
14+
display: flex;
15+
align-items: center;
16+
justify-content: center;
17+
backdrop-filter: blur(10px);
18+
background-color: hsla(0, 0, 7, 80%);
19+
visibility: hidden;
20+
opacity: 0;
21+
transition: all 0.4s;
22+
23+
${props =>
24+
props.isOpen &&
25+
css`
26+
visibility: visible;
27+
opacity: 1;
28+
`}
29+
`
30+
31+
const ModalContent = styled.div`
32+
display: flex;
33+
overflow: hidden;
34+
border-radius: 12px;
35+
height: 100%;
36+
background-color: #1c1c1c;
37+
box-shadow: 0 251px 70px hsla(0, 0%, 0%, 0), 0 161px 64px hsla(0, 0%, 0%, 4%), 0 90px 54px hsla(0, 0%, 0%, 13%),
38+
0 40px 40px hsla(0, 0%, 0%, 21%), 0 10px 22px hsla(0, 0%, 0%, 25%);
39+
`
40+
41+
const ModalColumn = styled.div`
42+
flex: 1;
43+
`
44+
45+
const ModalImage = styled.img`
46+
object-fit: cover;
47+
width: 100%;
48+
height: 100%;
49+
`
50+
51+
const Content = styled(ModalColumn)`
52+
padding: 32px 52px;
53+
display: flex;
54+
flex-direction: column;
55+
justify-content: center;
56+
gap: 32px;
57+
`
58+
59+
const ModalTextWrapper = styled.div`
60+
display: flex;
61+
flex-direction: column;
62+
gap: 16px;
63+
`
64+
65+
const Actions = styled.div`
66+
display: flex;
67+
gap: 12px;
68+
`
69+
70+
const ModalHeading = styled.h3`
71+
font-size: 36px;
72+
font-weight: bold;
73+
margin: 0;
74+
`
75+
76+
const ModalText = styled.p`
77+
margin: 0;
78+
text-wrap: balance;
79+
max-width: 85%;
80+
`
81+
82+
const BtnPrimary = styled(ButtonPrimary)`
83+
border-radius: 4px;
84+
font-size: 14px;
85+
color: #111;
86+
font-weight: semibold;
87+
display: inline-block;
88+
`
89+
const BtnSecondary = styled(ButtonSecondary)`
90+
border-radius: 4px;
91+
font-size: 14px;
92+
font-weight: semibold;
93+
display: inline-block;
94+
`
95+
96+
export const NewVersionModal = () => {
97+
const [betaModal, setBetaModal] = useState(true)
98+
99+
const toggleModal = () => {
100+
setBetaModal(!betaModal)
101+
}
102+
103+
const goToBeta = () => window.open('https://beta.pangolin.exchange/', '_blank')
104+
105+
return (
106+
<Modal isOpen={betaModal} onDismiss={toggleModal}>
107+
<ModalContent>
108+
<ModalColumn>
109+
<ModalImage src={BetaImage} />
110+
</ModalColumn>
111+
<Content>
112+
<ModalTextWrapper>
113+
<ModalHeading>Pangolin V3 Concentrated Liquidity is on the Way!</ModalHeading>
114+
<ModalText>
115+
Until then, feel free to use the classic Pangolin with original UI or explore the beta UI.
116+
</ModalText>
117+
</ModalTextWrapper>
118+
<Actions>
119+
<BtnPrimary variant="primary" onClick={goToBeta}>
120+
Explore the beta
121+
</BtnPrimary>
122+
<BtnSecondary variant="primary" onClick={toggleModal}>
123+
Return to app
124+
</BtnSecondary>
125+
</Actions>
126+
</Content>
127+
</ModalContent>
128+
</Modal>
129+
)
130+
}

src/layout/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useState } from 'react'
22
import { Outlet } from 'react-router-dom'
33
import HederaPoolWarning from 'src/components/Header/HederaPoolWarning'
44
import URLWarning from 'src/components/Header/URLWarning'
5+
import { NewVersionModal } from 'src/components/NewVersionModal'
56
import styled from 'styled-components'
67
import Footer from './Footer'
78
import Header from './Header'
@@ -57,6 +58,7 @@ const Layout: React.FC<unknown> = () => {
5758
</AppContent>
5859
{activeMobileMenu && <MobileMenu activeMobileMenu={activeMobileMenu} handleMobileMenu={handleMobileMenu} />}
5960
<Footer />
61+
<NewVersionModal />
6062
</MainContent>
6163
</Wrapper>
6264
)

0 commit comments

Comments
 (0)