Skip to content

Commit

Permalink
swap refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-defi committed Dec 13, 2024
1 parent 5f670e9 commit 95761cd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/swap/components/Swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export function Swap({
onStatus,
onSuccess,
title = 'Swap',
backButton,
}: SwapReact) {
const componentTheme = useTheme();

Expand Down Expand Up @@ -75,6 +76,7 @@ export function Swap({
data-testid="ockSwap_Container"
>
<div className="mb-4 flex items-center justify-between">
{backButton}
<h3 className={cn(text.title3)} data-testid="ockSwap_Title">
{title}
</h3>
Expand Down
2 changes: 1 addition & 1 deletion src/swap/components/SwapToggleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function SwapToggleButton({ className }: SwapToggleButtonReact) {
data-testid="SwapTokensButton"
onClick={handleToggle}
>
{toggleSvg}
<div className="h-4 w-4">{toggleSvg}</div>
</button>
);
}
3 changes: 2 additions & 1 deletion src/swap/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ export type SwapReact = {
onError?: (error: SwapError) => void; // An optional callback function that handles errors within the provider.
onStatus?: (lifecycleStatus: LifecycleStatus) => void; // An optional callback function that exposes the component lifecycle state
onSuccess?: (transactionReceipt: TransactionReceipt) => void; // An optional callback function that exposes the transaction receipt
title?: string; // Title for the Swap component. (default: "Swap")
title?: ReactNode; // Title for the Swap component. (default: "Swap")
backButton?: ReactNode; // Back button
};

/**
Expand Down

0 comments on commit 95761cd

Please sign in to comment.