Skip to content

Commit 7af580e

Browse files
EmilFattakhovclaude
andcommitted
feat(frontend): add binary-units info tooltip to custom amount selector
Add a small ⓘ icon next to the MB/GB/TB toggle on the custom amount screen. Hovering reveals a tooltip that explains binary storage sizing accurately and in plain language: - "We use binary units — like most storage hardware" - 1 GB = 1,024 MB (not 1,000) - 1 TB = 1,024 GB (not 1,000) - Note that some systems use 1 GB = 1,000 MB, so numbers may differ Users who don't care see only a subtle muted icon; curious users get the full picture without cluttering the UI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 377c55d commit 7af580e

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

apps/frontend/src/components/views/PurchaseCredits/steps/Step2_ConfirmPurchase.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Button } from '@auto-drive/ui';
44
import { InfoRow } from '../atoms/InfoRow';
55
import { Section } from '../atoms/Section';
66
import { useCallback, useMemo, useState, useEffect } from 'react';
7-
import { Zap, AlertTriangle } from 'lucide-react';
7+
import { Zap, AlertTriangle, Info } from 'lucide-react';
88
import { CreditCurrentPrice } from '../CreditCurrentPrice';
99
import { GoBackButton } from '../../../atoms/GoBackButton';
1010
import { usePrices } from '../../../../hooks/usePrices';
@@ -223,6 +223,25 @@ export const PurchaseStep2ConnectWallet = ({
223223
</button>
224224
))}
225225
</div>
226+
{/* Binary-units info bubble */}
227+
<div className='group relative'>
228+
<Info className='h-4 w-4 cursor-help text-muted-foreground' />
229+
<div className='pointer-events-none absolute bottom-full left-1/2 z-10 mb-2 w-64 -translate-x-1/2 rounded-md bg-gray-900 px-3 py-2 text-xs leading-relaxed text-white opacity-0 shadow-lg transition-opacity group-hover:opacity-100 dark:bg-gray-700'>
230+
<p className='font-semibold'>About these units</p>
231+
<p className='mt-1 text-gray-300'>
232+
We use binary units — like most storage hardware.
233+
That means:
234+
</p>
235+
<ul className='mt-1.5 space-y-0.5 text-gray-200'>
236+
<li>1 GB&nbsp;=&nbsp;1,024 MB&nbsp;<span className='text-gray-400'>(not 1,000)</span></li>
237+
<li>1 TB&nbsp;=&nbsp;1,024 GB&nbsp;<span className='text-gray-400'>(not 1,000)</span></li>
238+
</ul>
239+
<p className='mt-1.5 text-gray-400'>
240+
Some systems report 1 GB = 1,000 MB, so numbers may
241+
look slightly different elsewhere.
242+
</p>
243+
</div>
244+
</div>
226245
</div>
227246

228247
{/* Cap-exceeded warning */}

0 commit comments

Comments
 (0)