Skip to content

Commit d6ebc7b

Browse files
committed
refactor(web-wallet): remove pointless comments and logs
1 parent 9891146 commit d6ebc7b

File tree

7 files changed

+19
-213
lines changed

7 files changed

+19
-213
lines changed

packages/web-wallet/src/components/Header.tsx

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -69,40 +69,6 @@ const Header: React.FC = () => {
6969
{getNetworkDisplayName(network)}
7070
</span>
7171
</button>
72-
73-
{/* Menu Button - Hidden for now */}
74-
{/* <div className="relative">
75-
<button
76-
onClick={() => setIsMenuOpen(!isMenuOpen)}
77-
className="p-2 bg-[#191C21] border border-[#24292F] rounded-full hover:bg-[#24292F] transition-colors"
78-
>
79-
<MoreVertical className="w-5 h-5 text-white" />
80-
</button>
81-
82-
{isMenuOpen && (
83-
<div className="absolute right-0 mt-2 w-48 bg-[#191C21] border border-[#24292F] rounded-lg shadow-lg overflow-hidden z-50">
84-
<button
85-
onClick={() => {
86-
setIsNetworkDialogOpen(true);
87-
setIsMenuOpen(false);
88-
}}
89-
className="w-full px-4 py-3 text-left text-sm text-white hover:bg-[#24292F] transition-colors"
90-
>
91-
Create Tokens
92-
</button>
93-
<button
94-
className="w-full px-4 py-3 text-left text-sm text-white hover:bg-[#24292F] transition-colors"
95-
>
96-
Notifications
97-
</button>
98-
<button
99-
className="w-full px-4 py-3 text-left text-sm text-white hover:bg-[#24292F] transition-colors"
100-
>
101-
Address mode
102-
</button>
103-
</div>
104-
)}
105-
</div> */}
10672
</div>
10773
</div>
10874
</header>

packages/web-wallet/src/components/HistoryDialog.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ const HistoryDialog: React.FC<HistoryDialogProps> = ({ isOpen, onClose }) => {
4040

4141
const loadTransactionHistory = async (skip: number = 0) => {
4242
if (!address) {
43-
console.log('❌ No address, cannot load history');
4443
return;
4544
}
4645

47-
console.log(`📜 Loading transaction history for address: ${address}, skip: ${skip}`);
48-
4946
const isInitialLoad = skip === 0;
5047
if (isInitialLoad) {
5148
setIsLoading(true);
@@ -55,27 +52,20 @@ const HistoryDialog: React.FC<HistoryDialogProps> = ({ isOpen, onClose }) => {
5552

5653
try {
5754
const history = await getTransactionHistory(PAGE_SIZE, skip, '00')
58-
console.log('📜 Raw transaction history from wallet:', history);
5955

6056
if (!history || history.length === 0) {
61-
console.log('📜 No more transactions found');
6257
setHasMore(false);
6358
if (isInitialLoad) {
6459
setTransactions([]);
6560
}
6661
return;
6762
}
6863

69-
// Check if we got fewer results than requested (means we're at the end)
7064
if (history.length < PAGE_SIZE) {
7165
setHasMore(false);
7266
}
7367

74-
// Process transactions from wallet-lib format
7568
const processed: ProcessedTransaction[] = history.map((tx: any) => {
76-
console.log('Processing transaction:', tx);
77-
// balance is positive for received, negative for sent
78-
// Handle BigInt values from wallet-lib
7969
const balanceValue = typeof tx.balance === 'bigint' ? Number(tx.balance) : tx.balance;
8070
const type = balanceValue >= 0 ? 'received' : 'sent'
8171
const amount = Math.abs(balanceValue)
@@ -84,15 +74,11 @@ const HistoryDialog: React.FC<HistoryDialogProps> = ({ isOpen, onClose }) => {
8474
id: tx.txId || tx.tx_id,
8575
type,
8676
amount,
87-
timestamp: new Date(tx.timestamp * 1000).toISOString(), // wallet-lib timestamp is in seconds
77+
timestamp: new Date(tx.timestamp * 1000).toISOString(),
8878
txHash: tx.txId || tx.tx_id,
8979
status: !tx.voided && !tx.is_voided ? 'confirmed' : 'pending'
9080
}
9181
})
92-
93-
console.log('📜 Processed transactions:', processed);
94-
95-
// Append or replace transactions
9682
if (isInitialLoad) {
9783
setTransactions(processed);
9884
setCurrentCount(processed.length);

packages/web-wallet/src/components/SendDialog.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ const SendDialog: React.FC<SendDialogProps> = ({ isOpen, onClose }) => {
193193
</div>
194194
{errors.amount && (
195195
<div className="flex items-center gap-1 mt-1">
196-
<span className="text-xs text-red-400">{errors.amount}</span>
196+
<span className="text-xs text-red-400">{errors.amount}</span>
197197
</div>
198198
)}
199199
</div>
@@ -217,15 +217,14 @@ const SendDialog: React.FC<SendDialogProps> = ({ isOpen, onClose }) => {
217217
/>
218218
{errors.address && (
219219
<div className="flex items-center gap-1 mt-1">
220-
<span className="text-xs text-red-400">{errors.address}</span>
220+
<span className="text-xs text-red-400">{errors.address}</span>
221221
</div>
222222
)}
223223
</div>
224224

225-
{/* Transaction Error Display */}
226225
{transactionError && (
227226
<div className="flex items-start gap-2 p-3 bg-red-500/10 border border-red-500/50 rounded-lg">
228-
<span className="text-red-400 text-sm">{transactionError}</span>
227+
<span className="text-red-400 text-sm">{transactionError}</span>
229228
</div>
230229
)}
231230

packages/web-wallet/src/components/WalletHome.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,7 @@ const WalletHome: React.FC = () => {
140140
className="w-6 h-6"
141141
/>
142142
<span className="text-2xl font-medium text-white">
143-
{(() => {
144-
console.log('🎨 UI rendering balance. balances array:', balances);
145-
if (balances.length > 0) {
146-
console.log('💰 First balance item:', balances[0]);
147-
console.log('🔢 Available amount:', balances[0].available);
148-
console.log('📱 Formatted amount:', formatHTRAmount(balances[0].available));
149-
return `${formatHTRAmount(balances[0].available)} HTR`;
150-
}
151-
return '0 HTR';
152-
})()}
143+
{balances.length > 0 ? `${formatHTRAmount(balances[0].available)} HTR` : '0 HTR'}
153144
</span>
154145
</div>
155146
</div>

0 commit comments

Comments
 (0)