Skip to content

Commit 8d38d97

Browse files
authored
Refactor AccountSettingsSection layout and table structure
1 parent 0ac5d28 commit 8d38d97

1 file changed

Lines changed: 25 additions & 22 deletions

File tree

app/src/components/AccountSettingsSection.tsx

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -375,40 +375,43 @@ const AccountSettingsSection: React.FC = () => {
375375
</div>
376376
</div>
377377
</div>
378-
379-
<div className="p-6 space-y-6">
380378

381-
<table className="min-w-full divide-y divide-gray-700">
382-
<thead className="bg-gray-900">
383-
<tr>
384-
<th className="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Secret</th>
385-
<th className="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Redeemed</th>
386-
</tr>
387-
</thead>
388-
<tbody className="bg-gray-800 divide-y divide-gray-700">
389-
{transferBalanceCodes.map((code) => (
390-
<tr key={code.balance_code_id}>
391-
<td className="px-6 py-4 whitespace-nowrap">{maskSecret(code.secret)}</td>
392-
<td className="px-6 py-4 whitespace-nowrap">{formatDate(code.redeem_time)}</td>
393-
</tr>
394-
))}
395-
</tbody>
396-
</table>
397-
398-
{transferBalanceCodes.length === 0 && !isLoadingTransferBalanceCodes && (
379+
{transferBalanceCodes.length === 0 && !isLoadingTransferBalanceCodes ? (
380+
<div className="p-6">
399381
<div className="text-center py-12">
400382
<div className="w-16 h-16 bg-gray-700 rounded-full flex items-center justify-center mx-auto mb-4">
401383
<TicketSlash className="text-gray-500" size={24} />
402384
</div>
403385
<h3 className="text-lg font-medium text-gray-200 mb-2">No Transfer Balance Codes Redeemed</h3>
404386
<p className="text-gray-400 italic">No transfer balance codes found for your network.</p>
405387
</div>
406-
)}
388+
</div>
389+
) : (
390+
<div className="max-h-80 overflow-y-auto">
391+
<table className="min-w-full divide-y divide-gray-700">
392+
<thead className="bg-gray-900 sticky top-0 z-10">
393+
<tr>
394+
<th className="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Secret</th>
395+
<th className="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Redeemed</th>
396+
</tr>
397+
</thead>
398+
<tbody className="bg-gray-800 divide-y divide-gray-700">
399+
{transferBalanceCodes.map((code) => (
400+
<tr key={code.balance_code_id}>
401+
<td className="px-6 py-4 whitespace-nowrap">{maskSecret(code.secret)}</td>
402+
<td className="px-6 py-4 whitespace-nowrap">{formatDate(code.redeem_time)}</td>
403+
</tr>
404+
))}
405+
</tbody>
406+
</table>
407+
</div>
408+
)}
407409

410+
<div className="p-6">
408411
<button
409412
onClick={() => setIsAddTransferBalanceCodeModalOpen(true)}
410413
disabled={isLoadingTransferBalanceCodes}
411-
className={`flex items-center justify-center gap-2 px-6 py-4 rounded-lg font-medium transition-all duration-200 ${
414+
className={`w-full flex items-center justify-center gap-2 px-6 py-4 rounded-lg font-medium transition-all duration-200 ${
412415
isLoadingTransferBalanceCodes
413416
? 'bg-gray-600 cursor-not-allowed border border-gray-600 text-gray-400'
414417
: 'bg-blue-600 hover:bg-blue-700 text-white border border-blue-500 hover:shadow-lg transform hover:scale-[1.02]'

0 commit comments

Comments
 (0)