From 7c9f740258091b226f3ad8cb85d5ae991be5851b Mon Sep 17 00:00:00 2001 From: danidfra Date: Fri, 28 Mar 2025 10:39:35 -0300 Subject: [PATCH] Implement a tooltip in create-wallet --- src/components/ui/tooltip.tsx | 2 +- src/features/wallet/components/create-wallet.tsx | 13 +++++++++---- src/locales/en.json | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/ui/tooltip.tsx b/src/components/ui/tooltip.tsx index cce1728a2..08663da25 100644 --- a/src/components/ui/tooltip.tsx +++ b/src/components/ui/tooltip.tsx @@ -78,7 +78,7 @@ const Tooltip: React.FC = (props) => { left: x ?? 0, ...styles, }} - className='pointer-events-none z-[100] whitespace-nowrap rounded bg-gray-800 px-2.5 py-1.5 text-xs font-medium text-gray-100 shadow dark:bg-gray-100 dark:text-gray-900' + className='pointer-events-none z-[100] max-w-[200px] whitespace-normal rounded bg-gray-800 px-2.5 py-1.5 text-xs font-medium text-gray-100 shadow dark:bg-gray-100 dark:text-gray-900 sm:max-w-[300px]' {...getFloatingProps()} > {text} diff --git a/src/features/wallet/components/create-wallet.tsx b/src/features/wallet/components/create-wallet.tsx index c7d19049e..af586c031 100644 --- a/src/features/wallet/components/create-wallet.tsx +++ b/src/features/wallet/components/create-wallet.tsx @@ -1,4 +1,4 @@ -import exclamationIcon from '@tabler/icons/outline/exclamation-circle.svg'; +import helpIcon from '@tabler/icons/outline/help-circle.svg'; import plusIcon from '@tabler/icons/outline/square-rounded-plus.svg'; import { useState } from 'react'; import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; @@ -7,9 +7,10 @@ import Button from 'soapbox/components/ui/button.tsx'; import FormActions from 'soapbox/components/ui/form-actions.tsx'; import Form from 'soapbox/components/ui/form.tsx'; import HStack from 'soapbox/components/ui/hstack.tsx'; +import Icon from 'soapbox/components/ui/icon.tsx'; import Stack from 'soapbox/components/ui/stack.tsx'; -import SvgIcon from 'soapbox/components/ui/svg-icon.tsx'; import Text from 'soapbox/components/ui/text.tsx'; +import Tooltip from 'soapbox/components/ui/tooltip.tsx'; import { MintEditor } from 'soapbox/features/wallet/components/editable-lists.tsx'; import { useWallet } from 'soapbox/features/zap/hooks/useHooks.ts'; import { useOwnAccount } from 'soapbox/hooks/useOwnAccount.ts'; @@ -17,7 +18,7 @@ import { useOwnAccount } from 'soapbox/hooks/useOwnAccount.ts'; const messages = defineMessages({ title: { id: 'wallet.create_wallet.title', defaultMessage: 'You don\'t have a wallet' }, question: { id: 'wallet.create_wallet.question', defaultMessage: 'Do you want create one?' }, - button: { id: 'wallet.button.create_wallet', defaultMessage: 'Create wallet' }, + button: { id: 'wallet.button.create_wallet', defaultMessage: 'Create' }, mints: { id: 'wallet.mints', defaultMessage: 'Mints' }, }); @@ -72,7 +73,11 @@ const CreateWallet = () => { {intl.formatMessage(messages.mints)} - + +
+ +
+
diff --git a/src/locales/en.json b/src/locales/en.json index 6d91785be..008f08701 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1718,7 +1718,7 @@ "wallet.balance.mint.payment": "Make the payment to complete:", "wallet.balance.mint.unpaid_message": "Your mint is still unpaid. Complete the payment to receive your sats.", "wallet.button.cancel": "Cancel", - "wallet.button.create_wallet": "Create wallet", + "wallet.button.create_wallet": "Create", "wallet.button.mint": "Mint", "wallet.button.withdraw": "Withdraw", "wallet.create_wallet.question": "Do you want create one?",