Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
5eb1274f
Unverified
Commit
5eb1274f
authored
Dec 08, 2022
by
Vignesh Mohankumar
Committed by
GitHub
Dec 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: dynamically add padding-top on /about (#5597)
parent
9eb7d45a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
index.tsx
src/pages/About/index.tsx
+17
-6
No files found.
src/pages/About/index.tsx
View file @
5eb1274f
import
{
ButtonOutlined
}
from
'
components/Button
'
import
{
useState
}
from
'
react
'
import
{
use
LayoutEffect
,
useRef
,
use
State
}
from
'
react
'
import
{
useIsDarkMode
}
from
'
state/user/hooks
'
import
styled
from
'
styled-components/macro
'
import
{
BREAKPOINTS
}
from
'
theme
'
...
...
@@ -9,13 +9,14 @@ import { CARDS, STEPS } from './constants'
import
Step
from
'
./Step
'
import
{
SubTitle
,
Title
}
from
'
./Title
'
const
Page
=
styled
.
span
<
{
isDarkMode
:
boolean
}
>
`
const
Page
=
styled
.
span
<
{
isDarkMode
:
boolean
;
titleHeight
:
number
}
>
`
width: 100%;
align-self: center;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding-top: calc(100vh -
${({
titleHeight
})
=>
titleHeight
+
72
}
px);
`
const
Panels
=
styled
.
div
`
...
...
@@ -44,11 +45,11 @@ const Content = styled.div`
flex-direction: column;
justify-content: center;
align-items: flex-start;
padding:
128
px 16px 16px 16px;
padding:
0
px 16px 16px 16px;
gap: 96px;
@media screen and (min-width:
${
BREAKPOINTS
.
md
}
px) {
padding:
128
px 80px 80px 80px;
padding:
0
px 80px 80px 80px;
}
`
...
...
@@ -121,12 +122,22 @@ const PoweredBySection = styled(Panels)`
export
default
function
About
()
{
const
isDarkMode
=
useIsDarkMode
()
const
titleRef
=
useRef
<
HTMLDivElement
>
(
null
)
const
[
titleHeight
,
setTitleHeight
]
=
useState
(
0
)
useLayoutEffect
(()
=>
{
if
(
titleRef
.
current
)
{
setTitleHeight
(
titleRef
.
current
.
clientHeight
)
}
},
[])
const
[
selectedStepIndex
,
setSelectedStepIndex
]
=
useState
(
0
)
return
(
<
Page
isDarkMode=
{
isDarkMode
}
>
<
Page
isDarkMode=
{
isDarkMode
}
titleHeight=
{
titleHeight
}
>
<
Content
>
<
Title
isDarkMode=
{
isDarkMode
}
>
The best way to buy, sell and own crypto and NFTs
</
Title
>
<
Title
ref=
{
titleRef
}
isDarkMode=
{
isDarkMode
}
>
The best way to buy, sell and own crypto and NFTs
</
Title
>
<
PoweredBySection
>
<
div
>
<
SubTitle
isDarkMode=
{
isDarkMode
}
>
Powered by the Uniswap Protocol
</
SubTitle
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment