Skip to content

Commit

Permalink
fix tooltip bug
Browse files Browse the repository at this point in the history
  • Loading branch information
corlard3y committed Dec 17, 2024
1 parent 4cf549c commit 3be37ea
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
32 changes: 17 additions & 15 deletions src/blocks/tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,23 @@ const Tooltip: FC<TooltipProps> = ({
{children}
</RadixTooltip.Trigger>
<RadixTooltip.Portal>
<RadixTooltipContent
sideOffset={8}
{...{ style, width, maxWidth }}
{...cssProps}
{...props}
>
{overlay ? (
overlay
) : (
<>
{title && <StyledTitle>{title}</StyledTitle>}
{description && <StyledDescription>{description}</StyledDescription>}
</>
)}
</RadixTooltipContent>
{(title || overlay || description) && (
<RadixTooltipContent
sideOffset={8}
{...{ style, width, maxWidth }}
{...cssProps}
{...props}
>
{overlay ? (
overlay
) : (
<>
{title && <StyledTitle>{title}</StyledTitle>}
{description && <StyledDescription>{description}</StyledDescription>}
</>
)}
</RadixTooltipContent>
)}
</RadixTooltip.Portal>
</RadixTooltip.Root>
</RadixTooltip.Provider>
Expand Down
16 changes: 9 additions & 7 deletions src/components/UserProfileSettings/AddTelegram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const AddTelegram: FC<AddTelegramProps> = ({
const { handleConnectWalletAndEnableProfile } = useAppContext();

const caip10WalletAddress = walletToCAIP10({ account });
const [step, setStep] = useState(2);
const [telegramCode, setTelegramCode] = useState<string>('00000000');
const [step, setStep] = useState(1);
const [telegramCode, setTelegramCode] = useState<string>('');
const [isLoading, setIsLoading] = useState(false);
const { userPushSDKInstance } = useSelector((state: any) => {
return state.user;
Expand Down Expand Up @@ -214,11 +214,13 @@ const AddTelegram: FC<AddTelegramProps> = ({
{shortenText(`/verify ${caip10WalletAddress}-${telegramCode}`, 10)}
</Text>

<CopyButton
tooltipTitle="Copy Address"
content={`/verify ${caip10WalletAddress}-${telegramCode}`}
size={24}
/>
{isOpen && (
<CopyButton
tooltipTitle="Copy Address"
content={`/verify ${caip10WalletAddress}-${telegramCode}`}
size={24}
/>
)}
</Box>
</Box>

Expand Down

0 comments on commit 3be37ea

Please sign in to comment.