Skip to content

Commit

Permalink
fix(Loans): collateral overlapping modal ref issue (#1595)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsimao authored Oct 27, 2023
1 parent 1e3b759 commit aa12f6c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LoanAsset } from '@interlay/interbtc-api';
import { useEffect, useRef } from 'react';
import { RefObject, useEffect } from 'react';
import { useTranslation } from 'react-i18next';

import { Flex } from '@/component-library';
Expand All @@ -20,16 +20,21 @@ type CollateralFormProps = {
asset: LoanAsset;
variant: Extract<CollateralModalVariant, 'enable' | 'disable'>;
isOpen?: boolean;
overlappingModalRef: RefObject<HTMLDivElement>;
onSigning: () => void;
};

const CollateralForm = ({ asset, variant, isOpen, onSigning }: CollateralFormProps): JSX.Element => {
const CollateralForm = ({
asset,
variant,
isOpen,
overlappingModalRef,
onSigning
}: CollateralFormProps): JSX.Element => {
const { t } = useTranslation();

const { refetch } = useGetAccountLendingStatistics();

const overlappingModalRef = useRef<HTMLDivElement>(null);

const transaction = useTransaction({
onSigning,
onSuccess: refetch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ const CollateralModal = ({ asset, position, onClose, isOpen, ...props }: Collate
{t('dismiss')}
</CTA>
) : (
<CollateralForm asset={asset} onSigning={onClose} variant={variant} isOpen={isOpen} />
<CollateralForm
asset={asset}
onSigning={onClose}
variant={variant}
isOpen={isOpen}
overlappingModalRef={overlappingModalRef}
/>
)}
</ModalFooter>
</Modal>
Expand Down

2 comments on commit aa12f6c

@vercel
Copy link

@vercel vercel bot commented on aa12f6c Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on aa12f6c Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.