Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: modifed unmint naming to redeem, fixed confirmation checker #37

Merged
merged 1 commit into from
Dec 15, 2023
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
4 changes: 2 additions & 2 deletions src/app/components/header/components/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export function NavigationTabs({
return (
<HStack spacing={'25px'} marginRight={'150px'}>
<TabButton
title={'Mint/Unmint dlcBTC'}
title={'Mint/Redeem dlcBTC'}
isActive={activeTab === '/'}
handleClick={() => handleTabClick('/')}
/>
<TabButton
title={'My Vaults'}
title={'My Mint Vaults'}
isActive={activeTab === '/my-vaults'}
handleClick={() => handleTabClick('/my-vaults')}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export function Walkthrough({ flow, currentStep }: WalkthroughProps): React.JSX.
<WalkthroughLayout>
<WalkthroughHeader
currentStep={undefined}
title={'Unminted dlcBTC'}
title={'Redeemed dlcBTC'}
blockchain={'ethereum'}
/>
</WalkthroughLayout>
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/mint-unmint/mint-unmint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@
const { activeTab, mintStep, unmintStep } = useSelector((state: RootState) => state.mintunmint);

useEffect(() => {
if (!address) return;
setAnimate(true);
setTimeout(() => {
setAnimate(false);
}, 1000);
}, [mintStep, unmintStep]);

Check warning on line 39 in src/app/components/mint-unmint/mint-unmint.tsx

View workflow job for this annotation

GitHub Actions / lint-eslint

React Hook useEffect has a missing dependency: 'address'. Either include it or remove the dependency array

function handleTabsChange(index: number) {
dispatch(mintUnmintActions.setActiveTab(index));
Expand All @@ -46,7 +47,7 @@
<Tabs variant="unstyled" index={activeTab} onChange={handleTabsChange}>
<TabList>
<Tab>Mint</Tab>
<Tab isDisabled={!address}>Unmint</Tab>
<Tab isDisabled={!address}>Redeem</Tab>
</TabList>
<TabIndicator mt="5px" h="3.5px" bg={'accent.cyan.01'} />
<Spacer />
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/my-vaults-small/my-vaults-small.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function MyVaultsSmall({ address }: MyVaultsSmallProps): React.JSX.Elemen

return (
<MyVaultsSmallLayout>
<VaultsList title={'My Vaults'} height={'545px'} isScrollable={!!address && !isLoading}>
<VaultsList title={'My Mint Vaults'} height={'545px'} isScrollable={!!address && !isLoading}>
{address ? (
<Skeleton isLoaded={!isLoading} w={'100%'}>
<VaultsListGroupContainer label="Lock BTC" vaults={readyVaults} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function MyVaultsLargeHeader({
<VStack w={'100%'} h={'100px'}>
<HStack w={'100%'} h={'150px'} justifyContent={'space-between'} pr={'25px'}>
<Text color={'white'} fontSize={'4xl'} fontWeight={600}>
My Vaults
My Mint Vaults
</Text>
<HStack w={'450px'} h={'75%'} justifyContent={'space-between'}>
<Divider orientation={'vertical'} h={'35px'} variant={'thick'} />
Expand Down
2 changes: 1 addition & 1 deletion src/app/hooks/use-confirmation-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
});
bitcoinCurrentBlockHeight = await response.json();
} catch (error) {
console.error(error);

Check warning on line 30 in src/app/hooks/use-confirmation-checker.ts

View workflow job for this annotation

GitHub Actions / lint-eslint

Unexpected console statement
}

let bitcoinTransactionBlockHeight;
Expand All @@ -39,24 +39,24 @@
const bitcoinTransactionDetails = await response.json();
bitcoinTransactionBlockHeight = bitcoinTransactionDetails.status.block_height;
} catch (error) {
console.error(error);

Check warning on line 42 in src/app/hooks/use-confirmation-checker.ts

View workflow job for this annotation

GitHub Actions / lint-eslint

Unexpected console statement
}

const difference = bitcoinCurrentBlockHeight - bitcoinTransactionBlockHeight;

setTransactionProgress(difference);
setTransactionProgress(difference > 0 ? difference : 0);

if (difference > 6) {
clearInterval(fetchInterval.current);
}
};

fetchTransactionDetails();

Check warning on line 54 in src/app/hooks/use-confirmation-checker.ts

View workflow job for this annotation

GitHub Actions / lint-eslint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

useEffect(() => {
fetchInterval.current = setInterval(fetchTransactionDetails, 10000) as unknown as number; // Cleanup the interval when the component unmounts
return () => clearInterval(fetchInterval.current);
}, [vaultState, txID]);

Check warning on line 59 in src/app/hooks/use-confirmation-checker.ts

View workflow job for this annotation

GitHub Actions / lint-eslint

React Hook useEffect has a missing dependency: 'fetchTransactionDetails'. Either include it or remove the dependency array

return memoizedTransactionProgress;
}
Loading