Skip to content

Commit bc03dac

Browse files
Copilot0xrinegade
andcommitted
Fix terminology confusion: replace 'devMode' with proper devnet connectivity references
Co-authored-by: 0xrinegade <[email protected]>
1 parent ae68b4e commit bc03dac

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

src/components/OfferCreation.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ const OfferCreation = ({ onStartGuidedWorkflow }) => {
4747
const [txHash, setTxHash] = useState('');
4848
const [txStatus, setTxStatus] = useState(null);
4949
const [showConfirmation, setShowConfirmation] = useState(false);
50-
const [devMode, setDevMode] = useState(false);
50+
const [devnetBypass, setDevnetBypass] = useState(false);
5151

5252
// Connection status tracking
5353
const isWalletConnected = wallet.connected && wallet.publicKey;
54-
const isSmartContractReady = (isWalletConnected && program && connection && connectionStatus === CONNECTION_STATUS.CONNECTED) || devMode;
54+
const isSmartContractReady = (isWalletConnected && program && connection && connectionStatus === CONNECTION_STATUS.CONNECTED) || devnetBypass;
5555
const isConnectionFailed = connectionStatus === CONNECTION_STATUS.FAILED;
5656
const isConnectionRetrying = connectionStatus === CONNECTION_STATUS.RETRYING;
5757
const isConnectionConnecting = connectionStatus === CONNECTION_STATUS.CONNECTING;
@@ -67,9 +67,9 @@ const OfferCreation = ({ onStartGuidedWorkflow }) => {
6767
hasConnection: !!connection,
6868
connectionStatus,
6969
isSmartContractReady,
70-
devMode
70+
devnetBypass
7171
});
72-
}, [isWalletConnected, wallet, program, connection, connectionStatus, isSmartContractReady, devMode]);
72+
}, [isWalletConnected, wallet, program, connection, connectionStatus, isSmartContractReady, devnetBypass]);
7373

7474
// Track connection status for better UX
7575
useEffect(() => {
@@ -83,15 +83,15 @@ const OfferCreation = ({ onStartGuidedWorkflow }) => {
8383
const getConnectionStatusMessage = () => {
8484
switch (connectionStatus) {
8585
case CONNECTION_STATUS.CONNECTING:
86-
return 'Connecting to Solana blockchain...';
86+
return 'Connecting to Solana devnet...';
8787
case CONNECTION_STATUS.RETRYING:
88-
return `Retrying connection... (Attempt ${connectionAttempts}/${5})`;
88+
return `Retrying devnet connection... (Attempt ${connectionAttempts}/${5})`;
8989
case CONNECTION_STATUS.FAILED:
90-
return connectionError || 'Failed to connect to Solana blockchain';
90+
return connectionError || 'Failed to connect to Solana devnet';
9191
case CONNECTION_STATUS.CONNECTED:
92-
return 'Connected to Solana blockchain';
92+
return 'Connected to Solana devnet';
9393
default:
94-
return 'Disconnected from blockchain';
94+
return 'Disconnected from Solana devnet';
9595
}
9696
};
9797

@@ -121,8 +121,8 @@ const OfferCreation = ({ onStartGuidedWorkflow }) => {
121121
return;
122122
}
123123

124-
if (!isSmartContractReady && !devMode) {
125-
setError('Smart contract connection is not ready. Please check your network connection and try again.');
124+
if (!isSmartContractReady && !devnetBypass) {
125+
setError('Smart contract connection is not ready. Please check your devnet connection and try again.');
126126
return;
127127
}
128128

@@ -472,9 +472,9 @@ const OfferCreation = ({ onStartGuidedWorkflow }) => {
472472
className="create-offer-button disabled connection-issue"
473473
title={getConnectionStatusMessage()}
474474
>
475-
{isConnectionConnecting && 'Connecting to Smart Contract...'}
476-
{isConnectionRetrying && `Retrying Connection (${connectionAttempts}/5)`}
477-
{isConnectionFailed && 'Smart Contract Connection Failed'}
475+
{isConnectionConnecting && 'Connecting to Solana Devnet...'}
476+
{isConnectionRetrying && `Retrying Devnet Connection (${connectionAttempts}/5)`}
477+
{isConnectionFailed && 'Solana Devnet Connection Failed'}
478478
</button>
479479

480480
{(isConnectionFailed || isConnectionRetrying) && (
@@ -485,17 +485,17 @@ const OfferCreation = ({ onStartGuidedWorkflow }) => {
485485

486486
{isConnectionFailed && (
487487
<>
488-
<p>This may be due to:</p>
488+
<p>Unable to connect to the Solana devnet. This may be due to:</p>
489489
<ul>
490490
<li>Network connectivity issues</li>
491-
<li>Solana RPC endpoint problems</li>
491+
<li>Solana devnet RPC endpoint problems</li>
492492
<li>Browser security restrictions (CORS)</li>
493-
<li>Temporary blockchain network issues</li>
494-
<li>Development environment limitations</li>
493+
<li>Temporary devnet network issues</li>
494+
<li>Firewall or proxy blocking devnet endpoints</li>
495495
</ul>
496496

497-
<div className="development-notice">
498-
<p><strong>Development Note:</strong> If you're testing the UI, you can continue without a live blockchain connection. Core functionality will be simulated.</p>
497+
<div className="devnet-notice">
498+
<p><strong>Note:</strong> If devnet endpoints are temporarily unavailable, you can continue in simulation mode for interface testing. Smart contract features will be simulated.</p>
499499
</div>
500500
</>
501501
)}
@@ -522,15 +522,15 @@ const OfferCreation = ({ onStartGuidedWorkflow }) => {
522522
<button
523523
type="button"
524524
onClick={() => {
525-
// Enable development mode for UI testing
526-
setDevMode(true);
525+
// Enable devnet bypass for UI testing when endpoints are unavailable
526+
setDevnetBypass(true);
527527
setError('');
528-
console.log('[OfferCreation] Development mode enabled for UI testing');
528+
console.log('[OfferCreation] Devnet bypass enabled - simulating connection for UI testing');
529529
}}
530-
className="dev-bypass-button"
531-
title="Continue with UI testing (blockchain features disabled)"
530+
className="devnet-bypass-button"
531+
title="Continue with simulation mode (devnet features simulated)"
532532
>
533-
Continue Without Blockchain (UI Test Mode)
533+
Continue Without Devnet (Simulation Mode)
534534
</button>
535535
)}
536536
</div>

src/styles/components.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,15 +1302,15 @@ html:not(.dark) .onboarding-modal *,
13021302
line-height: var(--line-height-relaxed);
13031303
}
13041304

1305-
.development-notice {
1305+
.devnet-notice {
13061306
background-color: var(--color-warning-light);
13071307
border: 1px solid var(--color-warning);
13081308
border-radius: var(--radius-md);
13091309
padding: var(--spacing-3);
13101310
margin-top: var(--spacing-3);
13111311
}
13121312

1313-
.development-notice p {
1313+
.devnet-notice p {
13141314
margin: 0;
13151315
font-size: var(--font-size-sm);
13161316
color: var(--color-warning-dark);
@@ -1350,7 +1350,7 @@ html:not(.dark) .onboarding-modal *,
13501350
transform: none;
13511351
}
13521352

1353-
.dev-bypass-button {
1353+
.devnet-bypass-button {
13541354
background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
13551355
color: white;
13561356
border: 1px solid var(--color-accent);
@@ -1365,20 +1365,20 @@ html:not(.dark) .onboarding-modal *,
13651365
overflow: hidden;
13661366
}
13671367

1368-
.dev-bypass-button:hover {
1368+
.devnet-bypass-button:hover {
13691369
background: linear-gradient(135deg, var(--color-accent-dark) 0%, var(--color-accent) 100%);
13701370
border-color: var(--color-accent-dark);
13711371
transform: translateY(-1px);
13721372
box-shadow: var(--shadow-md);
13731373
}
13741374

1375-
.dev-bypass-button::before {
1376-
content: '🚧';
1375+
.devnet-bypass-button::before {
1376+
content: '🌐';
13771377
margin-right: var(--spacing-2);
13781378
font-size: var(--font-size-sm);
13791379
}
13801380

1381-
.dev-bypass-button::after {
1381+
.devnet-bypass-button::after {
13821382
content: '';
13831383
position: absolute;
13841384
top: -50%;
@@ -1391,7 +1391,7 @@ html:not(.dark) .onboarding-modal *,
13911391
transition: opacity var(--transition-normal) ease, transform var(--transition-normal) ease;
13921392
}
13931393

1394-
.dev-bypass-button:hover::after {
1394+
.devnet-bypass-button:hover::after {
13951395
opacity: 1;
13961396
transform: scale(1);
13971397
}
@@ -1413,7 +1413,7 @@ html:not(.dark) .onboarding-modal *,
14131413
}
14141414

14151415
.retry-connection-button,
1416-
.dev-bypass-button {
1416+
.devnet-bypass-button {
14171417
font-size: var(--font-size-xs);
14181418
padding: var(--spacing-2) var(--spacing-3);
14191419
}
@@ -1423,7 +1423,7 @@ html:not(.dark) .onboarding-modal *,
14231423
gap: var(--spacing-3);
14241424
}
14251425

1426-
.development-notice {
1426+
.devnet-notice {
14271427
padding: var(--spacing-2);
14281428
}
14291429
}

0 commit comments

Comments
 (0)