Skip to content

Commit

Permalink
Merge branch 'send' into desc
Browse files Browse the repository at this point in the history
  • Loading branch information
secondl1ght authored Sep 19, 2024
2 parents a2d7b48 + 63380b1 commit 9fda62e
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 17 deletions.
Binary file modified public/images/landing/6.webp
Binary file not shown.
Binary file modified public/images/landing/7.webp
Binary file not shown.
Binary file modified public/images/landing/8.webp
Binary file not shown.
Binary file modified public/images/landing/9.webp
Binary file not shown.
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export default function Page() {
<Image
src={six}
alt="phone-pay"
className="scale-150 transition-transform duration-500 hover:scale-[200%]"
className="scale-125 transition-transform duration-500 hover:scale-150"
/>
</div>
}
Expand Down
6 changes: 3 additions & 3 deletions src/views/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ const Warning: FC<{ id: string }> = ({ id }) => {

const showAlert = useMemo(() => {
const otherAssets = liquidAssets.filter(
a => a.asset_info.ticker !== 'BTC' && !!a.balance
a => a.asset_info.ticker !== 'BTC' && Number(a.balance)
);

const btcAsset = liquidAssets.filter(
a => a.asset_info.ticker == 'BTC' && !!a.balance
a => a.asset_info.ticker == 'BTC' && Number(a.balance)
);

return !!otherAssets.length && !btcAsset.length;
return otherAssets.length && !btcAsset.length;
}, [liquidAssets]);

if (loading || error) return null;
Expand Down
22 changes: 9 additions & 13 deletions src/views/wallet/Receive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ArrowLeft, ArrowUpDown, ChevronsUpDown } from 'lucide-react';
import Link from 'next/link';
import { useTranslations } from 'next-intl';
import { useQRCode } from 'next-qrcode';
import { useEffect, useMemo, useState } from 'react';
import { useMemo, useState } from 'react';
import { useLocalStorage } from 'usehooks-ts';

import { Button } from '@/components/ui/button-v2';
Expand Down Expand Up @@ -116,6 +116,8 @@ export const Receive = () => {
{ data: liquidData, loading: liquidLoading, error: liquidError },
] = useCreateOnchainAddressMutation({
variables: { input: { wallet_account_id: liquidAccountId } },
onCompleted: data =>
setReceiveString(data.wallets.create_onchain_address.address),
onError: err => {
const messages = handleApolloError(err);

Expand All @@ -127,21 +129,15 @@ export const Receive = () => {
},
});

useEffect(() => {
if (!liquidAccountId || liquidData) return;

createLiquidAddress();
}, [liquidAccountId, liquidData, createLiquidAddress]);

const liquidAddress = useMemo(() => {
const liquidAddressFormatted = useMemo(() => {
if (!liquidData?.wallets.create_onchain_address.address) {
return { address: '', formatted: '' };
return '';
}

const address = liquidData.wallets.create_onchain_address.address;
const formatted = (address.match(/.{1,6}/g) || []).join(' - ');

return { address, formatted };
return formatted;
}, [liquidData]);

const [createLightningInvoice, { loading: invoiceLoading }] =
Expand Down Expand Up @@ -187,9 +183,9 @@ export const Receive = () => {
: t('Wallet.amount-ln');
case 'Liquid Bitcoin':
case 'Tether USD':
return liquidAddress.formatted;
return liquidAddressFormatted;
}
}, [receive, bancoCode, receiveString, liquidAddress, t]);
}, [receive, bancoCode, receiveString, liquidAddressFormatted, t]);

const {
data: priceData,
Expand Down Expand Up @@ -271,7 +267,7 @@ export const Receive = () => {
break;
case 'Liquid Bitcoin':
case 'Tether USD':
setReceiveString(liquidAddress.address);
createLiquidAddress();
break;
}
}}
Expand Down

0 comments on commit 9fda62e

Please sign in to comment.