-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: integrate SwapRouter02 on L1/L2 + gas ui
* client-side smart order router support * support auto router on L2s * add swap router version in approval/swap callback GA events to save $ on approval txs * add persistent UI view of gas estimate on L1s Co-authored-by: Lint Action <[email protected]> Co-authored-by: Ian Lapham <[email protected]> Co-authored-by: Callil Capuozzo <[email protected]>
- Loading branch information
1 parent
642a417
commit 9e1a775
Showing
64 changed files
with
2,994 additions
and
973 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { animated, useSpring } from 'react-spring' | ||
import useResizeObserver from 'use-resize-observer' | ||
|
||
/** | ||
* @param open conditional to show content or hide | ||
* @returns Wrapper to smoothly hide and expand content | ||
*/ | ||
export default function AnimatedDropdown({ open, children }: React.PropsWithChildren<{ open: boolean }>) { | ||
const { ref, height } = useResizeObserver() | ||
|
||
const props = useSpring({ | ||
height: open ? height ?? 0 : 0, | ||
config: { | ||
mass: 1.2, | ||
tension: 300, | ||
friction: 20, | ||
clamp: true, | ||
velocity: 0.01, | ||
}, | ||
}) | ||
|
||
return ( | ||
<animated.div | ||
style={{ | ||
...props, | ||
overflow: 'hidden', | ||
width: '100%', | ||
willChange: 'height', | ||
}} | ||
> | ||
<div ref={ref}>{children}</div> | ||
</animated.div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.