Skip to content

Commit a35c378

Browse files
Copilot0xrinegade
andcommitted
Complete Phantom wallet integration - build successfully, removed legacy Swig files
Co-authored-by: 0xrinegade <[email protected]>
1 parent e166d5e commit a35c378

File tree

7 files changed

+19
-14
lines changed

7 files changed

+19
-14
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/components/AnalyticsDashboard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React, { useState, useEffect, useContext } from 'react';
22
import { AppContext } from '@/contexts/AppContext';
3-
import { useSwigWallet } from '@/contexts/SwigWalletProvider';
3+
import { usePhantomWallet } from '@/contexts/PhantomWalletProvider';
44
import OverviewPanel from '@/components/analytics/OverviewPanel';
55
import RecentTrades from '@/components/analytics/RecentTrades';
66
import VolumePerDayChart from '@/components/analytics/VolumePerDayChart';
77
import TopTraders from '@/components/analytics/TopTraders';
88

99
export default function AnalyticsDashboard() {
1010
const { network, selectedNetwork, networks } = useContext(AppContext);
11-
const { connected, publicKey } = useSwigWallet();
11+
const { connected, publicKey } = usePhantomWallet();
1212
const [timeframe, setTimeframe] = useState('24h');
1313
const [refreshInterval, setRefreshInterval] = useState(null);
1414

src/components/PhantomWalletButton.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import React, { useState } from 'react';
8+
import Image from 'next/image';
89
import { usePhantomWallet } from '../contexts/PhantomWalletProvider';
910

1011
/**
@@ -53,10 +54,11 @@ export const PhantomWalletButton = ({ className = '' }) => {
5354
title={`Connected to ${walletAddress}`}
5455
>
5556
<div className="w-6 h-6 flex items-center justify-center">
56-
<img
57+
<Image
5758
src="/images/phantom-logo.svg"
5859
alt="Phantom"
59-
className="w-4 h-4"
60+
width={16}
61+
height={16}
6062
/>
6163
</div>
6264
<div className="w-2 h-2 bg-green-300 rounded-full"></div>
@@ -90,10 +92,11 @@ export const PhantomWalletButton = ({ className = '' }) => {
9092
className={`flex items-center gap-2 px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors ${className}`}
9193
>
9294
<div className="w-6 h-6 flex items-center justify-center">
93-
<img
95+
<Image
9496
src="/images/phantom-logo.svg"
9597
alt="Phantom"
96-
className="w-4 h-4"
98+
width={16}
99+
height={16}
97100
/>
98101
</div>
99102
<span>Connect Phantom</span>
@@ -117,10 +120,11 @@ export const PhantomWalletButton = ({ className = '' }) => {
117120
{/* Modal content */}
118121
<div className="pt-4">
119122
<div className="flex items-center justify-center mb-4">
120-
<img
123+
<Image
121124
src="/images/phantom-logo.svg"
122125
alt="Phantom"
123-
className="w-16 h-16"
126+
width={64}
127+
height={64}
124128
/>
125129
</div>
126130

src/components/RewardWidget.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import React, { useState, useEffect } from 'react';
2-
import { useSwigWallet } from '../contexts/SwigWalletProvider';
2+
import { usePhantomWallet } from '../contexts/PhantomWalletProvider';
33
import { useRewardData } from '../hooks/useRewardData';
44
import { getUIText } from '../utils/i18n';
55
import { createLogger } from '../utils/logger';
66

77
const logger = createLogger('RewardWidget');
88

99
const RewardWidget = ({ compact = false }) => {
10+
const wallet = usePhantomWallet();
1011
const { connected, publicKey } = wallet;
1112
const connection = wallet.getConnection ? wallet.getConnection() : null;
1213
const { rewardData, isLoading, error } = useRewardData(connection, publicKey);
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**
22
* Legacy Wallet Context Provider - Deprecated
33
*
4-
* This file has been replaced with SwigWalletProvider.
4+
* This file has been replaced with PhantomWalletProvider.
55
* This is kept for backward compatibility only.
66
*/
77

8-
import { SwigWalletProvider, useSwigWallet } from './SwigWalletProvider';
8+
import { PhantomWalletProvider, usePhantomWallet } from './PhantomWalletProvider';
99

10-
// Re-export SwigWallet components for backward compatibility
11-
export { SwigWalletProvider as SafeWalletProvider, useSwigWallet as useSafeWallet };
10+
// Re-export Phantom components for backward compatibility
11+
export { PhantomWalletProvider as SafeWalletProvider, usePhantomWallet as useSafeWallet };
1212

13-
export default SwigWalletProvider;
13+
export default PhantomWalletProvider;

0 commit comments

Comments
 (0)