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
a5534803
Unverified
Commit
a5534803
authored
Jan 05, 2023
by
Jack Short
Committed by
GitHub
Jan 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: migrating bag footer to styled components (#5791)
parent
a06f8857
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
50 deletions
+37
-50
BagFooter.css.ts
src/nft/components/bag/BagFooter.css.ts
+0
-34
BagFooter.tsx
src/nft/components/bag/BagFooter.tsx
+36
-16
index.tsx
src/theme/index.tsx
+1
-0
No files found.
src/nft/components/bag/BagFooter.css.ts
deleted
100644 → 0
View file @
a06f8857
import
{
style
}
from
'
@vanilla-extract/css
'
import
{
body
}
from
'
nft/css/common.css
'
import
{
sprinkles
}
from
'
nft/css/sprinkles.css
'
export
const
footer
=
style
([
sprinkles
({
background
:
'
backgroundModule
'
,
color
:
'
textPrimary
'
,
paddingX
:
'
16
'
,
paddingY
:
'
12
'
,
borderBottomLeftRadius
:
'
12
'
,
borderBottomRightRadius
:
'
12
'
,
}),
])
export
const
payButton
=
style
([
body
,
sprinkles
({
background
:
'
accentAction
'
,
border
:
'
none
'
,
borderRadius
:
'
12
'
,
paddingY
:
'
12
'
,
fontWeight
:
'
semibold
'
,
cursor
:
'
pointer
'
,
justifyContent
:
'
center
'
,
gap
:
'
16
'
,
}),
{
'
:disabled
'
:
{
opacity
:
'
0.6
'
,
cursor
:
'
auto
'
,
},
},
])
src/nft/components/bag/BagFooter.tsx
View file @
a5534803
...
@@ -4,11 +4,10 @@ import { Trans } from '@lingui/macro'
...
@@ -4,11 +4,10 @@ import { Trans } from '@lingui/macro'
import
{
TraceEvent
}
from
'
@uniswap/analytics
'
import
{
TraceEvent
}
from
'
@uniswap/analytics
'
import
{
BrowserEvent
,
InterfaceElementName
,
NFTEventName
}
from
'
@uniswap/analytics-events
'
import
{
BrowserEvent
,
InterfaceElementName
,
NFTEventName
}
from
'
@uniswap/analytics-events
'
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
Column
from
'
components/Column
'
import
Loader
from
'
components/Loader
'
import
Loader
from
'
components/Loader
'
import
Row
from
'
components/Row
'
import
{
SupportedChainId
}
from
'
constants/chains
'
import
{
SupportedChainId
}
from
'
constants/chains
'
import
{
Box
}
from
'
nft/components/Box
'
import
{
Column
,
Row
}
from
'
nft/components/Flex
'
import
{
bodySmall
}
from
'
nft/css/common.css
'
import
{
useBag
}
from
'
nft/hooks/useBag
'
import
{
useBag
}
from
'
nft/hooks/useBag
'
import
{
useWalletBalance
}
from
'
nft/hooks/useWalletBalance
'
import
{
useWalletBalance
}
from
'
nft/hooks/useWalletBalance
'
import
{
BagStatus
}
from
'
nft/types
'
import
{
BagStatus
}
from
'
nft/types
'
...
@@ -20,8 +19,6 @@ import styled from 'styled-components/macro'
...
@@ -20,8 +19,6 @@ import styled from 'styled-components/macro'
import
{
ThemedText
}
from
'
theme
'
import
{
ThemedText
}
from
'
theme
'
import
{
switchChain
}
from
'
utils/switchChain
'
import
{
switchChain
}
from
'
utils/switchChain
'
import
*
as
styles
from
'
./BagFooter.css
'
const
FooterContainer
=
styled
.
div
`
const
FooterContainer
=
styled
.
div
`
padding: 0px 12px;
padding: 0px 12px;
`
`
...
@@ -37,6 +34,11 @@ const Footer = styled.div`
...
@@ -37,6 +34,11 @@ const Footer = styled.div`
border-bottom-right-radius: 12px;
border-bottom-right-radius: 12px;
`
`
const
FooterHeader
=
styled
(
Column
)
<
{
warningText
?:
boolean
}
>
`
padding-top: 8px;
padding-bottom:
${({
warningText
})
=>
(
warningText
?
'
8px
'
:
'
20px
'
)}
;
`
const
WarningIcon
=
styled
(
AlertTriangle
)
`
const
WarningIcon
=
styled
(
AlertTriangle
)
`
width: 14px;
width: 14px;
margin-right: 4px;
margin-right: 4px;
...
@@ -51,6 +53,21 @@ const WarningText = styled(ThemedText.BodyPrimary)`
...
@@ -51,6 +53,21 @@ const WarningText = styled(ThemedText.BodyPrimary)`
text-align: center;
text-align: center;
`
`
const
PayButton
=
styled
(
Row
)
<
{
disabled
?:
boolean
}
>
`
background:
${({
theme
})
=>
theme
.
accentAction
}
;
color:
${({
theme
})
=>
theme
.
accentTextLightPrimary
}
;
font-weight: 600;
line-height: 24px;
font-size: 16px;
gap: 16px;
justify-content: center;
border: none;
border-radius: 12px;
padding: 12px 0px;
opacity:
${({
disabled
})
=>
(
disabled
?
0.6
:
1
)}
;
cursor:
${({
disabled
})
=>
(
disabled
?
'
auto
'
:
'
pointer
'
)}
;
`
interface
ActionButtonProps
{
interface
ActionButtonProps
{
disabled
?:
boolean
disabled
?:
boolean
onClick
:
()
=>
void
onClick
:
()
=>
void
...
@@ -58,9 +75,9 @@ interface ActionButtonProps {
...
@@ -58,9 +75,9 @@ interface ActionButtonProps {
const
ActionButton
=
({
disabled
,
children
,
onClick
}:
PropsWithChildren
<
ActionButtonProps
>
)
=>
{
const
ActionButton
=
({
disabled
,
children
,
onClick
}:
PropsWithChildren
<
ActionButtonProps
>
)
=>
{
return
(
return
(
<
Row
as=
"button"
color=
"explicitWhite"
className=
{
styles
.
payButton
}
disabled=
{
disabled
}
onClick=
{
onClick
}
>
<
PayButton
disabled=
{
disabled
}
onClick=
{
onClick
}
>
{
children
}
{
children
}
</
Row
>
</
PayButton
>
)
)
}
}
...
@@ -155,21 +172,24 @@ export const BagFooter = ({
...
@@ -155,21 +172,24 @@ export const BagFooter = ({
return
(
return
(
<
FooterContainer
>
<
FooterContainer
>
<
Footer
>
<
Footer
>
<
Column
gap=
"4"
paddingTop=
"8"
paddingBottom=
{
warningText
?
'
8
'
:
'
20
'
}
>
<
FooterHeader
gap=
"xs"
warningText=
{
!!
warningText
}
>
<
Row
justify
Content
=
"space-between"
>
<
Row
justify=
"space-between"
>
<
Box
>
<
div
>
<
ThemedText
.
HeadlineSmall
>
Total
</
ThemedText
.
HeadlineSmall
>
<
ThemedText
.
HeadlineSmall
>
Total
</
ThemedText
.
HeadlineSmall
>
</
Box
>
</
div
>
<
Box
>
<
div
>
<
ThemedText
.
HeadlineSmall
>
<
ThemedText
.
HeadlineSmall
>
{
formatWeiToDecimal
(
totalEthPrice
.
toString
())
}
ETH
{
formatWeiToDecimal
(
totalEthPrice
.
toString
())
}
ETH
</
ThemedText
.
HeadlineSmall
>
</
ThemedText
.
HeadlineSmall
>
</
Box
>
</
div
>
</
Row
>
</
Row
>
<
Row
justifyContent=
"flex-end"
color=
"textSecondary"
className=
{
bodySmall
}
>
<
Row
justify=
"flex-end"
>
{
`${ethNumberStandardFormatter(totalUsdPrice, true)}`
}
<
ThemedText
.
BodySmall
color=
"textSecondary"
lineHeight=
"20px"
>
{
`${ethNumberStandardFormatter(
totalUsdPrice,
true
)}`
}
</
ThemedText
.
BodySmall
>
</
Row
>
</
Row
>
</
Column
>
</
FooterHeader
>
<
TraceEvent
<
TraceEvent
events=
{
[
BrowserEvent
.
onClick
]
}
events=
{
[
BrowserEvent
.
onClick
]
}
name=
{
NFTEventName
.
NFT_BUY_BAG_PAY
}
name=
{
NFTEventName
.
NFT_BUY_BAG_PAY
}
...
...
src/theme/index.tsx
View file @
a5534803
...
@@ -67,6 +67,7 @@ const fonts = {
...
@@ -67,6 +67,7 @@ const fonts = {
function
getSettings
(
darkMode
:
boolean
)
{
function
getSettings
(
darkMode
:
boolean
)
{
return
{
return
{
grids
:
{
grids
:
{
xs
:
'
4px
'
,
sm
:
'
8px
'
,
sm
:
'
8px
'
,
md
:
'
12px
'
,
md
:
'
12px
'
,
lg
:
'
24px
'
,
lg
:
'
24px
'
,
...
...
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