Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/features/market-detail/components/borrowers-table.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useMemo } from 'react';
import { Tooltip } from '@/components/ui/tooltip';
import { Table, TableHeader, TableBody, TableRow, TableCell, TableHead } from '@/components/ui/table';
import { FiFilter } from 'react-icons/fi';
import { GoFilter } from 'react-icons/go';
import type { Address } from 'viem';
import { formatUnits } from 'viem';
import { Button } from '@/components/ui/button';
Expand Down Expand Up @@ -77,7 +77,7 @@ export function BorrowersTable({ chainId, market, minShares, oraclePrice, onOpen
<TooltipContent
title="Filters"
detail="Filter borrowers by minimum borrow amount"
icon={<FiFilter size={14} />}
icon={<GoFilter size={14} />}
/>
}
>
Expand All @@ -88,7 +88,7 @@ export function BorrowersTable({ chainId, market, minShares, oraclePrice, onOpen
aria-label="Borrower filters"
onClick={onOpenFiltersModal}
>
<FiFilter
<GoFilter
size={14}
style={{ color: hasActiveFilter ? MONARCH_PRIMARY : undefined }}
/>
Expand Down
6 changes: 3 additions & 3 deletions src/features/market-detail/components/borrows-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from 'react';
import { Tooltip } from '@/components/ui/tooltip';
import { Table, TableHeader, TableBody, TableRow, TableCell, TableHead } from '@/components/ui/table';
import moment from 'moment';
import { FiFilter } from 'react-icons/fi';
import { GoFilter } from 'react-icons/go';
import type { Address } from 'viem';
import { formatUnits } from 'viem';
import { Button } from '@/components/ui/button';
Expand Down Expand Up @@ -61,7 +61,7 @@ export function BorrowsTable({ chainId, market, minAssets, onOpenFiltersModal }:
<TooltipContent
title="Filters"
detail="Filter transactions by minimum amount"
icon={<FiFilter size={14} />}
icon={<GoFilter size={14} />}
/>
}
>
Expand All @@ -72,7 +72,7 @@ export function BorrowsTable({ chainId, market, minAssets, onOpenFiltersModal }:
aria-label="Transaction filters"
onClick={onOpenFiltersModal}
>
<FiFilter
<GoFilter
size={14}
style={{ color: hasActiveFilter ? MONARCH_PRIMARY : undefined }}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Input } from '@/components/ui/input';
import { FiSliders } from 'react-icons/fi';
import { GoFilter } from 'react-icons/go';
import { Button } from '@/components/ui/button';
import { Modal, ModalHeader, ModalBody, ModalFooter } from '@/components/common/Modal';
import { SettingItem, createNumericInputHandler } from './shared-filter-utils';
Expand Down Expand Up @@ -34,7 +34,7 @@ export default function BorrowerFiltersModal({
<ModalHeader
title="Borrower Filters"
description="Filter borrowers by minimum borrow amount"
mainIcon={<FiSliders className="h-5 w-5" />}
mainIcon={<GoFilter className="h-5 w-5" />}
onClose={onClose}
/>
<ModalBody className="flex flex-col gap-5">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Input } from '@/components/ui/input';
import { FiSliders } from 'react-icons/fi';
import { GoFilter } from 'react-icons/go';
import { Button } from '@/components/ui/button';
import { Modal, ModalHeader, ModalBody, ModalFooter } from '@/components/common/Modal';
import { SettingItem, createNumericInputHandler } from './shared-filter-utils';
Expand Down Expand Up @@ -34,7 +34,7 @@ export default function SupplierFiltersModal({
<ModalHeader
title="Supplier Filters"
description="Filter suppliers by minimum supply amount"
mainIcon={<FiSliders className="h-5 w-5" />}
mainIcon={<GoFilter className="h-5 w-5" />}
onClose={onClose}
/>
<ModalBody className="flex flex-col gap-5">
Expand Down
6 changes: 3 additions & 3 deletions src/features/market-detail/components/suppliers-table.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useMemo } from 'react';
import { Tooltip } from '@/components/ui/tooltip';
import { Table, TableHeader, TableBody, TableRow, TableCell, TableHead } from '@/components/ui/table';
import { FiFilter } from 'react-icons/fi';
import { GoFilter } from 'react-icons/go';
import type { Address } from 'viem';
import { formatUnits } from 'viem';
import { Button } from '@/components/ui/button';
Expand Down Expand Up @@ -70,7 +70,7 @@ export function SuppliersTable({ chainId, market, minShares, onOpenFiltersModal
<TooltipContent
title="Filters"
detail="Filter suppliers by minimum share amount"
icon={<FiFilter size={14} />}
icon={<GoFilter size={14} />}
/>
}
>
Expand All @@ -81,7 +81,7 @@ export function SuppliersTable({ chainId, market, minShares, onOpenFiltersModal
aria-label="Supplier filters"
onClick={onOpenFiltersModal}
>
<FiFilter
<GoFilter
size={14}
style={{ color: hasActiveFilter ? MONARCH_PRIMARY : undefined }}
/>
Expand Down
6 changes: 3 additions & 3 deletions src/features/market-detail/components/supplies-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from 'react';
import { Tooltip } from '@/components/ui/tooltip';
import { Table, TableHeader, TableBody, TableRow, TableCell, TableHead } from '@/components/ui/table';
import moment from 'moment';
import { FiFilter } from 'react-icons/fi';
import { GoFilter } from 'react-icons/go';
import type { Address } from 'viem';
import { formatUnits } from 'viem';
import { Button } from '@/components/ui/button';
Expand Down Expand Up @@ -56,7 +56,7 @@ export function SuppliesTable({ chainId, market, minAssets, onOpenFiltersModal }
<TooltipContent
title="Filters"
detail="Filter transactions by minimum amount"
icon={<FiFilter size={14} />}
icon={<GoFilter size={14} />}
/>
}
>
Expand All @@ -67,7 +67,7 @@ export function SuppliesTable({ chainId, market, minAssets, onOpenFiltersModal }
aria-label="Transaction filters"
onClick={onOpenFiltersModal}
>
<FiFilter
<GoFilter
size={14}
style={{ color: hasActiveFilter ? MONARCH_PRIMARY : undefined }}
/>
Expand Down
8 changes: 4 additions & 4 deletions src/features/positions/components/markets-filter-compact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useMemo } from 'react';
import { useDisclosure } from '@/hooks/useDisclosure';
import { Divider } from '@/components/ui/divider';
import { Tooltip } from '@/components/ui/tooltip';
import { FiFilter } from 'react-icons/fi';
import { GoFilter } from 'react-icons/go';
Comment thread
antoncoding marked this conversation as resolved.
import { Button } from '@/components/ui/button';
import { FilterRow, FilterSection } from '@/components/ui/filter-components';
import { IconSwitch } from '@/components/ui/icon-switch';
Expand Down Expand Up @@ -85,7 +85,7 @@ export function MarketFilter({ onOpenSettings, className, variant = 'ghost' }: M
<TooltipContent
title="Filters"
detail="Toggle market filters and risk guards"
icon={<FiFilter size={14} />}
icon={<GoFilter size={14} />}
/>
}
>
Expand All @@ -96,7 +96,7 @@ export function MarketFilter({ onOpenSettings, className, variant = 'ghost' }: M
aria-label="Market filters"
onClick={onOpen}
>
<FiFilter
<GoFilter
size={variant === 'button' ? 16 : 14}
style={{ color: hasActiveFilters ? MONARCH_PRIMARY : undefined }}
/>
Expand All @@ -116,7 +116,7 @@ export function MarketFilter({ onOpenSettings, className, variant = 'ghost' }: M
variant="compact"
title="Filters"
description="Quickly toggle the visibility filters that power the markets table"
mainIcon={<FiFilter size={14} />}
mainIcon={<GoFilter size={14} />}
onClose={close}
/>
<ModalBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function SetupPositions({ onClose }: { onClose: () => void }) {
.filter((supply) => supply.amount > 0n);
}, [selectedMarkets, amounts, tokenDecimals]);

const { transaction, dismiss, isLoadingPermit2, approveAndSupply, supplyPending } = useMultiMarketSupply(
const { isLoadingPermit2, approveAndSupply, supplyPending } = useMultiMarketSupply(
selectedToken!,
supplies,
useEth,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export function RebalanceModal({ groupedPosition, isOpen, onOpenChange, refetch,

// Use computed markets based on user setting
const { markets } = useProcessedMarkets();
const { rebalanceActions, addRebalanceAction, removeRebalanceAction, executeRebalance, isProcessing, transaction, dismiss } =
useRebalance(groupedPosition);
const { rebalanceActions, addRebalanceAction, removeRebalanceAction, executeRebalance, isProcessing } = useRebalance(groupedPosition);

// Filter eligible markets (same loan asset and chain)
// Fresh state is fetched by MarketsTableWithSameLoanAsset component
Expand Down
2 changes: 1 addition & 1 deletion src/features/rewards/rewards-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default function Rewards() {

const showLegacy = useMemo(() => morphoBalanceLegacy !== undefined && morphoBalanceLegacy !== 0n, [morphoBalanceLegacy]);

const { wrap, transaction, dismiss } = useWrapLegacyMorpho(morphoBalanceLegacy ?? 0n, () => {
const { wrap, transaction } = useWrapLegacyMorpho(morphoBalanceLegacy ?? 0n, () => {
// Refresh rewards data after successful wrap
void refresh();
});
Expand Down
26 changes: 24 additions & 2 deletions src/hooks/useBorrowTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,18 @@ export function useBorrowTransaction({ market, collateralAmount, borrowAmount, o
toast.error('Error', 'An unexpected error occurred');
}
}
}, [account, executeBorrowTransaction, toast, useEth, usePermit2Setting, tracking, getStepsForFlow, market, collateralAmount, borrowAmount]);
}, [
account,
executeBorrowTransaction,
toast,
useEth,
usePermit2Setting,
tracking,
getStepsForFlow,
market,
collateralAmount,
borrowAmount,
]);

// Function to handle signing and executing the borrow transaction
const signAndBorrow = useCallback(async () => {
Expand Down Expand Up @@ -391,7 +402,18 @@ export function useBorrowTransaction({ market, collateralAmount, borrowAmount, o
toast.error('Transaction Error', 'An unexpected error occurred');
}
}
}, [account, executeBorrowTransaction, toast, tracking, getStepsForFlow, useEth, usePermit2Setting, market, collateralAmount, borrowAmount]);
}, [
account,
executeBorrowTransaction,
toast,
tracking,
getStepsForFlow,
useEth,
usePermit2Setting,
market,
collateralAmount,
borrowAmount,
]);

// Determine overall loading state
const isLoading = borrowPending || isLoadingPermit2 || isApproving || isAuthorizingBundler;
Expand Down
1 change: 0 additions & 1 deletion src/modals/borrow/components/add-collateral-and-borrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export function AddCollateralAndBorrow({
// Use the new hook for borrow transaction logic
const {
transaction,
dismiss,
useEth,
setUseEth,
isLoadingPermit2,
Expand Down
17 changes: 8 additions & 9 deletions src/modals/borrow/components/withdraw-collateral-and-repay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ export function WithdrawCollateralAndRepay({
const [newLTV, setNewLTV] = useState<bigint>(BigInt(0));

// Use the repay transaction hook
const { transaction, dismiss, isLoadingPermit2, isApproved, permit2Authorized, repayPending, approveAndRepay, signAndRepay } =
useRepayTransaction({
market,
currentPosition,
withdrawAmount,
repayAssets,
repayShares,
onSuccess,
});
const { isLoadingPermit2, isApproved, permit2Authorized, repayPending, approveAndRepay, signAndRepay } = useRepayTransaction({
market,
currentPosition,
withdrawAmount,
repayAssets,
repayShares,
onSuccess,
});

const handleRepay = useCallback(() => {
if (!permit2Authorized || (!usePermit2Setting && !isApproved)) {
Expand Down