Skip to content

Commit

Permalink
refactor: bitcoin swaps
Browse files Browse the repository at this point in the history
  • Loading branch information
fbwoolf committed Jan 9, 2025
1 parent 05132fe commit be6e31e
Show file tree
Hide file tree
Showing 55 changed files with 1,282 additions and 893 deletions.
12 changes: 11 additions & 1 deletion src/app/pages/home/components/account-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Box, Flex } from 'leather-styles/jsx';
import { ArrowsRepeatLeftRightIcon, CreditCardIcon, IconButton, InboxIcon } from '@leather.io/ui';

import { RouteUrls } from '@shared/route-urls';
import { replaceRouteParams } from '@shared/utils/replace-route-params';

import {
useConfigBitcoinEnabled,
Expand Down Expand Up @@ -35,6 +36,15 @@ export function AccountActions() {
? RouteUrls.Receive
: `${RouteUrls.Home}${RouteUrls.ReceiveStx}`;

function navigateToDefaultSwapRoute() {
return navigate(
replaceRouteParams(RouteUrls.Swap, {
base: 'STX',
quote: '',
}).replace('{chain}', 'stacks')
);
}

return (
<Flex gap={{ base: 'space.01', md: 'space.04' }} py="space.04" justifyContent="space-between">
<SendButton />
Expand All @@ -60,7 +70,7 @@ export function AccountActions() {
disabled={swapsBtnDisabled}
icon={<ArrowsRepeatLeftRightIcon />}
label="Swap"
onClick={() => navigate(RouteUrls.Swap.replace(':base', 'STX').replace(':quote', ''))}
onClick={navigateToDefaultSwapRoute}
/>
</Box>
</BasicTooltip>
Expand Down
284 changes: 0 additions & 284 deletions src/app/pages/swap/bitflow-swap-container.tsx

This file was deleted.

70 changes: 0 additions & 70 deletions src/app/pages/swap/bitflow-swap.utils.ts

This file was deleted.

Loading

0 comments on commit be6e31e

Please sign in to comment.