Skip to content

Commit

Permalink
chore: removed tnc
Browse files Browse the repository at this point in the history
  • Loading branch information
hemantwasthere committed Aug 25, 2024
1 parent 07c4896 commit bebd447
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 25 deletions.
38 changes: 26 additions & 12 deletions src/components/TVL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import { useAtomValue } from 'jotai';
import Link from 'next/link';
import React from 'react';
import toast from 'react-hot-toast';

const TVL: React.FC = () => {
const _strategies = useAtomValue(strategiesAtom);
Expand Down Expand Up @@ -71,6 +72,7 @@ const TVL: React.FC = () => {
<StatLabel>
Your referral link{' '}
<Tooltip label="docs">
{/* TODO: update the url */}
<Link href="#">(?)</Link>
</Tooltip>
</StatLabel>
Expand All @@ -79,21 +81,33 @@ const TVL: React.FC = () => {
justifyContent="space-between"
alignItems="center"
>
<StatNumber
fontSize="1.5rem"
textDecoration="underline"
fontWeight="600"
>
{referralCode}
</StatNumber>
{!referralCode ? (
<Spinner size="sm" color="white" marginTop={'8px'} />
) : (
<StatNumber
fontSize="1.5rem"
textDecoration="underline"
fontWeight="600"
>
{referralCode}
</StatNumber>
)}

<CopyIcon
cursor="pointer"
onClick={() =>
navigator.clipboard.writeText(
`${window.location.origin}/r/${referralCode}`,
)
}
onClick={() => {
if (window.location.origin.includes('app.strkfarm.xyz')) {
navigator.clipboard.writeText(
`https://strkfarm.xyz/r/${referralCode}`,
);
} else {
navigator.clipboard.writeText(
`${window.location.origin}/r/${referralCode}`,
);
}

toast.success('Referral link copied to clipboard');
}}
/>
</Box>
</Stat>
Expand Down
25 changes: 12 additions & 13 deletions src/components/TxButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { useEffect, useMemo, useState } from 'react';
import { isMobile } from 'react-device-detect';
import { TwitterShareButton } from 'react-share';
import { Call } from 'starknet';
import TncModal from './TncModal';

interface TxButtonProps {
txInfo: StrategyTxProps;
Expand Down Expand Up @@ -211,12 +210,12 @@ export default function TxButton(props: TxButtonProps) {
</ModalContent>
</Modal>

{showTncModal && (
{/* {showTncModal && (
<TncModal
isOpen={showTncModal}
onClose={() => setShowTncModal(false)}
/>
)}
)} */}

<Box width={'100%'} textAlign={'center'}>
<Button
Expand All @@ -237,18 +236,18 @@ export default function TxButton(props: TxButtonProps) {
address,
});

const res = await getUser();
// const res = await getUser();

if (!res) {
writeAsync().then((tx) => {
if (props.buttonText === 'Deposit') onOpen();
mixpanel.track('Submitted tx', {
strategyId: props.txInfo.strategyId,
txHash: tx.transaction_hash,
address,
});
// if (!res) {
writeAsync().then((tx) => {
if (props.buttonText === 'Deposit') onOpen();
mixpanel.track('Submitted tx', {
strategyId: props.txInfo.strategyId,
txHash: tx.transaction_hash,
address,
});
}
});
// }
}}
{...props.buttonProps}
>
Expand Down

0 comments on commit bebd447

Please sign in to comment.