-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: swaps routes, closes #4317
- Loading branch information
Showing
28 changed files
with
310 additions
and
275 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
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
51 changes: 26 additions & 25 deletions
51
...oose-asset/components/swap-asset-list.tsx → ...set-dialog/components/swap-asset-list.tsx
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
33 changes: 33 additions & 0 deletions
33
src/app/pages/swap/components/swap-asset-dialog/swap-asset-dialog-base.tsx
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,33 @@ | ||
import { RouteUrls } from '@shared/route-urls'; | ||
|
||
import { Dialog } from '@app/ui/components/containers/dialog/dialog'; | ||
import { Header } from '@app/ui/components/containers/headers/header'; | ||
|
||
import { useSwapNavigate } from '../../hooks/use-swap-navigate'; | ||
import { useSwapContext } from '../../swap.context'; | ||
import { SwapAssetList } from './components/swap-asset-list'; | ||
|
||
export function SwapAssetDialogBase() { | ||
const { swappableAssetsBase } = useSwapContext(); | ||
const navigate = useSwapNavigate(); | ||
|
||
return ( | ||
<Dialog | ||
isShowing | ||
onClose={() => navigate(RouteUrls.Swap)} | ||
header={ | ||
<Header | ||
title={ | ||
<> | ||
Choose asset <br /> to swap | ||
</> | ||
} | ||
variant="bigTitle" | ||
onGoBack={() => navigate(RouteUrls.Swap)} | ||
/> | ||
} | ||
> | ||
<SwapAssetList assets={swappableAssetsBase} type="base" /> | ||
</Dialog> | ||
); | ||
} |
33 changes: 33 additions & 0 deletions
33
src/app/pages/swap/components/swap-asset-dialog/swap-asset-dialog-quote.tsx
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,33 @@ | ||
import { RouteUrls } from '@shared/route-urls'; | ||
|
||
import { Dialog } from '@app/ui/components/containers/dialog/dialog'; | ||
import { Header } from '@app/ui/components/containers/headers/header'; | ||
|
||
import { useSwapNavigate } from '../../hooks/use-swap-navigate'; | ||
import { useSwapContext } from '../../swap.context'; | ||
import { SwapAssetList } from './components/swap-asset-list'; | ||
|
||
export function SwapAssetDialogQuote() { | ||
const { swappableAssetsQuote } = useSwapContext(); | ||
const navigate = useSwapNavigate(); | ||
|
||
return ( | ||
<Dialog | ||
isShowing | ||
onClose={() => navigate(RouteUrls.Swap)} | ||
header={ | ||
<Header | ||
title={ | ||
<> | ||
Choose asset <br /> to receive | ||
</> | ||
} | ||
variant="bigTitle" | ||
onGoBack={() => navigate(RouteUrls.Swap)} | ||
/> | ||
} | ||
> | ||
<SwapAssetList assets={swappableAssetsQuote} type="quote" /> | ||
</Dialog> | ||
); | ||
} |
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.