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
c0bdb8db
Unverified
Commit
c0bdb8db
authored
Mar 30, 2022
by
Zach Pomerantz
Committed by
GitHub
Mar 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: break unnecessary hierarchical deps (#3629)
parent
2d8f767d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
22 deletions
+26
-22
WidgetsPropsValidator.tsx
src/lib/components/Error/WidgetsPropsValidator.tsx
+1
-1
SwapPropValidator.tsx
src/lib/components/Swap/SwapPropValidator.tsx
+1
-1
index.tsx
src/lib/components/Swap/index.tsx
+9
-4
Widget.tsx
src/lib/components/Widget.tsx
+15
-16
No files found.
src/lib/components/Error/WidgetsPropsValidator.tsx
View file @
c0bdb8db
...
...
@@ -26,5 +26,5 @@ export default function WidgetsPropsValidator(props: PropsWithChildren<WidgetPro
}
},
[
locale
])
return
<>
{
props
.
children
}
</>
return
null
}
src/lib/components/Swap/SwapPropValidator.tsx
View file @
c0bdb8db
...
...
@@ -81,5 +81,5 @@ export default function SwapPropValidator(props: ValidatorProps) {
}
},
[
defaultInputTokenAddress
,
defaultInputAmount
,
defaultOutputTokenAddress
,
defaultOutputAmount
])
return
<>
{
props
.
children
}
</>
return
null
}
src/lib/components/Swap/index.tsx
View file @
c0bdb8db
...
...
@@ -47,11 +47,15 @@ export interface SwapProps extends TokenDefaults, FeeOptions {
onConnectWallet
?:
()
=>
void
}
export
default
function
Swap
(
props
:
SwapProps
)
{
function
Updaters
(
props
:
SwapProps
&
{
disabled
:
boolean
}
)
{
useSyncTokenList
(
props
.
tokenList
)
useSyncTokenDefaults
(
props
)
useSyncConvenienceFee
(
props
)
return
props
.
disabled
?
null
:
<
SwapInfoUpdater
/>
}
export
default
function
Swap
(
props
:
SwapProps
)
{
const
{
active
,
account
}
=
useActiveWeb3React
()
const
[
wrapper
,
setWrapper
]
=
useState
<
HTMLDivElement
|
null
>
(
null
)
...
...
@@ -71,8 +75,9 @@ export default function Swap(props: SwapProps) {
const
isInteractive
=
Boolean
(
active
&&
onSupportedNetwork
)
return
(
<
SwapPropValidator
{
...
props
}
>
{
isSwapSupported
&&
<
SwapInfoUpdater
/>
}
<>
<
SwapPropValidator
{
...
props
}
/>
<
Updaters
{
...
props
}
disabled=
{
!
isSwapSupported
}
/>
<
Header
title=
{
<
Trans
>
Swap
</
Trans
>
}
>
{
active
&&
<
Wallet
disabled=
{
!
account
}
onClick=
{
props
.
onConnectWallet
}
/>
}
<
Settings
disabled=
{
!
isInteractive
}
/>
...
...
@@ -92,6 +97,6 @@ export default function Swap(props: SwapProps) {
<
StatusDialog
tx=
{
displayTx
}
onClose=
{
()
=>
setDisplayTxHash
()
}
/>
</
Dialog
>
)
}
</
SwapPropValidator
>
</>
)
}
src/lib/components/Widget.tsx
View file @
c0bdb8db
...
...
@@ -117,27 +117,26 @@ export default function Widget(props: PropsWithChildren<WidgetProps>) {
const
[
dialog
,
setDialog
]
=
useState
<
HTMLDivElement
|
null
>
(
null
)
return
(
<
StrictMode
>
<
I18nProvider
locale=
{
local
e
}
>
<
ThemeProvider
theme=
{
the
me
}
>
<
WidgetWrapper
width=
{
width
}
className=
{
classNam
e
}
>
<
ThemeProvider
theme=
{
them
e
}
>
<
WidgetWrapper
width=
{
width
}
className=
{
classNa
me
}
>
<
I18nProvider
locale=
{
local
e
}
>
<
DialogWrapper
ref=
{
setDialog
}
/>
<
DialogProvider
value=
{
userDialog
||
dialog
}
>
<
ErrorBoundary
onError=
{
onError
}
>
<
WidgetPropValidator
{
...
props
}
>
<
ReduxProvider
store=
{
multicallStore
}
>
<
AtomProvider
>
<
ActiveWeb3Provider
provider=
{
provider
}
jsonRpcEndpoint=
{
jsonRpcEndpoint
}
>
<
Updaters
/>
{
children
}
</
ActiveWeb3Provider
>
</
AtomProvider
>
</
ReduxProvider
>
</
WidgetPropValidator
>
<
WidgetPropValidator
{
...
props
}
/>
<
ReduxProvider
store=
{
multicallStore
}
>
<
AtomProvider
>
<
ActiveWeb3Provider
provider=
{
provider
}
jsonRpcEndpoint=
{
jsonRpcEndpoint
}
>
<
Updaters
/>
{
children
}
</
ActiveWeb3Provider
>
</
AtomProvider
>
</
ReduxProvider
>
</
ErrorBoundary
>
</
DialogProvider
>
</
WidgetWrapp
er
>
</
ThemeProvid
er
>
</
I18n
Provider
>
</
I18nProvid
er
>
</
WidgetWrapp
er
>
</
Theme
Provider
>
</
StrictMode
>
)
}
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