Skip to content

Commit e978e75

Browse files
Merge pull request #55 from LayerTwo-Labs/lights-fix
Lights fix
2 parents 93149e4 + 150edc8 commit e978e75

8 files changed

+244
-122
lines changed

src/App.css

+17
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,23 @@ body {
348348
--current-color: var(--run-btn);
349349
}
350350

351+
/* Quick Start/Stop Button */
352+
.quick-start-stop-btn {
353+
transition: background-color 0.2s ease !important;
354+
}
355+
356+
.quick-start-stop-btn:not(:disabled):hover {
357+
background-color: var(--stop-btn-hover) !important;
358+
}
359+
360+
.quick-start-stop-btn[data-state="start"]:not(:disabled):hover {
361+
background-color: var(--run-btn-hover) !important;
362+
}
363+
364+
.quick-start-stop-btn[data-state="download"]:not(:disabled):hover {
365+
background-color: var(--download-btn-hover) !important;
366+
}
367+
351368
/* L1 Chain Layout */
352369
.l1-chains {
353370
display: flex;

src/components/ChainSettingsModal.module.css

+28
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
z-index: 1000;
1212
}
1313

14+
.dangerOverlay {
15+
background-color: rgba(220, 53, 69, 0.2);
16+
}
17+
1418
.modalContent {
1519
background-color: var(--background-color);
1620
border-radius: 8px;
@@ -142,7 +146,13 @@
142146
padding: 8px 16px;
143147
border-radius: 4px;
144148
cursor: pointer;
149+
font-weight: 600;
150+
font-size: 0.9rem;
151+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
152+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
153+
sans-serif;
145154
transition: background-color 0.2s;
155+
width: 120px;
146156
}
147157

148158
.resetBtn:hover {
@@ -156,7 +166,13 @@
156166
padding: 8px 16px;
157167
border-radius: 4px;
158168
cursor: pointer;
169+
font-weight: 600;
170+
font-size: 0.9rem;
171+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
172+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
173+
sans-serif;
159174
transition: background-color 0.2s;
175+
width: 120px;
160176
margin-right: 10px;
161177
}
162178

@@ -176,6 +192,18 @@
176192

177193
.modalBody li {
178194
margin: 5px 0;
195+
text-align: left;
196+
}
197+
198+
.modalBody ul {
199+
list-style: disc;
200+
padding-left: 20px;
201+
margin: 10px 0;
202+
}
203+
204+
.warningText {
205+
color: var(--danger-color);
206+
font-weight: bold;
179207
}
180208

181209
.dark {

src/components/Nodes.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ function Nodes() {
364364
<button
365365
onClick={handleQuickStartStop}
366366
disabled={isProcessing || isAnyL1ChainDownloading()}
367-
className={`btn ${(!isProcessing && !isAnyL1ChainDownloading() && (!areAllL1ChainsDownloaded() || (!areAllChainsRunning() && areAllL1ChainsDownloaded()))) ? 'btn-shimmer' : ''}`}
367+
className={`btn quick-start-stop-btn ${(!isProcessing && !isAnyL1ChainDownloading() && (!areAllL1ChainsDownloaded() || (!areAllChainsRunning() && areAllL1ChainsDownloaded()))) ? 'btn-shimmer' : ''}`}
368368
data-state={!isProcessing && !isAnyL1ChainDownloading() && (!areAllL1ChainsDownloaded() ? 'download' : !areAllChainsRunning() ? 'start' : '')}
369369
style={{
370370
padding: '8px 16px',
@@ -377,7 +377,17 @@ function Nodes() {
377377
: 'var(--run-btn)', // Green for start
378378
cursor: (isProcessing || isAnyL1ChainDownloading()) ? 'wait' : 'pointer',
379379
opacity: (isProcessing || isAnyL1ChainDownloading()) ? 0.8 : 1,
380-
width: 'auto' // Override fixed width from btn class
380+
width: 'auto', // Override fixed width from btn class
381+
transition: 'background-color 0.2s ease',
382+
':hover': {
383+
backgroundColor: isProcessing || isAnyL1ChainDownloading()
384+
? 'var(--downloading-btn-hover)' // Darker orange for processing/downloading
385+
: !areAllL1ChainsDownloaded()
386+
? 'var(--download-btn-hover)' // Darker blue for download
387+
: areAllChainsRunning()
388+
? 'var(--stop-btn-hover)' // Darker red for stop
389+
: 'var(--run-btn-hover)' // Darker green for start
390+
}
381391
}}
382392
>
383393
{isProcessing

src/components/ResetAllModal.js

+21-36
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,49 @@
11
import React from 'react';
22
import { X } from 'lucide-react';
3-
import styles from './SettingsModal.module.css'; // Reuse settings modal styles
3+
import { useTheme } from '../contexts/ThemeContext';
4+
import styles from './ChainSettingsModal.module.css';
45

56
const ResetAllModal = ({ onConfirm, onClose }) => {
7+
const { isDarkMode } = useTheme();
8+
69
const handleOverlayClick = (e) => {
710
if (e.target === e.currentTarget) {
811
onClose();
912
}
1013
};
1114

1215
return (
13-
<div className={styles.modalOverlay} onClick={handleOverlayClick}>
16+
<div
17+
className={`${styles.modalOverlay} ${styles.dangerOverlay} ${isDarkMode ? styles.dark : styles.light}`}
18+
onClick={handleOverlayClick}
19+
style={{ position: 'absolute' }}
20+
>
1421
<div className={styles.modalContent}>
1522
<div className={styles.modalHeader}>
1623
<h2 className={styles.modalTitle}>Reset All Chains</h2>
1724
<button className={styles.closeButton} onClick={onClose}>
1825
<X size={20} />
1926
</button>
2027
</div>
21-
<div className={styles.settingGroup}>
22-
<p style={{ marginBottom: '20px', color: 'var(--text-color)' }}>
23-
Warning: This will reset all chains to their default state and delete ALL data, including:
24-
</p>
25-
<ul style={{ marginBottom: '20px', color: 'var(--text-color)', listStyle: 'disc', paddingLeft: '40px' }}>
28+
<div className={styles.modalBody}>
29+
<p>Warning: This will reset all chains to their default state and delete ALL data, including:</p>
30+
<ul className={styles.modalBody}>
2631
<li>All blockchain data</li>
2732
<li>All wallet data and private keys</li>
2833
<li>All transaction history</li>
2934
<li>All custom chain configurations</li>
3035
</ul>
31-
<p style={{ marginBottom: '20px', color: '#dc3545', fontWeight: 'bold' }}>
36+
<p className={styles.warningText}>
3237
This action cannot be undone. Make sure you have backed up any important data.
3338
</p>
34-
<div style={{ display: 'flex', gap: '10px', justifyContent: 'flex-end' }}>
35-
<button
36-
onClick={onClose}
37-
style={{
38-
padding: '8px 16px',
39-
borderRadius: '4px',
40-
border: 'none',
41-
background: 'rgba(128, 128, 128, 0.2)',
42-
color: 'var(--text-color)',
43-
cursor: 'pointer',
44-
}}
45-
>
46-
Cancel
47-
</button>
48-
<button
49-
onClick={onConfirm}
50-
style={{
51-
padding: '8px 16px',
52-
borderRadius: '4px',
53-
border: 'none',
54-
background: '#dc3545',
55-
color: 'white',
56-
cursor: 'pointer',
57-
}}
58-
>
59-
Reset All
60-
</button>
61-
</div>
39+
</div>
40+
<div className={styles.buttonContainer}>
41+
<button onClick={onClose} className={styles.cancelBtn}>
42+
Cancel
43+
</button>
44+
<button onClick={onConfirm} className={styles.resetBtn}>
45+
Reset All
46+
</button>
6247
</div>
6348
</div>
6449
</div>

src/components/ResetConfirmModal.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const ResetConfirmModal = ({ chainName, onConfirm, onClose }) => {
1414

1515
return (
1616
<div
17-
className={`${styles.modalOverlay} ${isDarkMode ? styles.dark : styles.light}`}
17+
className={`${styles.modalOverlay} ${styles.dangerOverlay} ${isDarkMode ? styles.dark : styles.light}`}
1818
onClick={handleOverlayClick}
1919
>
2020
<div className={styles.modalContent}>

src/components/SettingsModal.js

+35-14
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import styles from './SettingsModal.module.css';
77
import { X } from 'lucide-react';
88
import ResetAllModal from './ResetAllModal';
99
import UpdateConfirmModal from './UpdateConfirmModal';
10+
import WalletWarningModal from './WalletWarningModal';
1011

1112
const SettingsModal = ({ onResetComplete }) => {
1213
const [showResetModal, setShowResetModal] = useState(false);
14+
const [showWalletWarning, setShowWalletWarning] = useState(false);
1315
const [updateStatus, setUpdateStatus] = useState(null);
1416
const [isCheckingUpdates, setIsCheckingUpdates] = useState(false);
1517
const [availableUpdates, setAvailableUpdates] = useState([]);
@@ -19,6 +21,12 @@ const SettingsModal = ({ onResetComplete }) => {
1921
const { showQuotes } = useSelector((state) => state.settings);
2022
const { isDarkMode, toggleTheme } = useTheme();
2123
const handleClose = () => {
24+
setShowResetModal(false);
25+
setShowWalletWarning(false);
26+
setUpdateStatus(null);
27+
setIsCheckingUpdates(false);
28+
setAvailableUpdates([]);
29+
setShowUpdateConfirm(false);
2230
dispatch(hideSettingsModal());
2331
};
2432

@@ -64,7 +72,10 @@ const SettingsModal = ({ onResetComplete }) => {
6472
if (!isVisible) return null;
6573

6674
return (
67-
<div className={styles.modalOverlay} onClick={handleOverlayClick}>
75+
<div
76+
className={`${styles.modalOverlay} ${isDarkMode ? styles.dark : styles.light}`}
77+
onClick={handleOverlayClick}
78+
>
6879
<div className={styles.modalContent}>
6980
<div className={styles.modalHeader}>
7081
<h2 className={styles.modalTitle}>Settings</h2>
@@ -104,16 +115,7 @@ const SettingsModal = ({ onResetComplete }) => {
104115
<span className={styles.settingLabel}>Master Wallet Directory</span>
105116
<button
106117
className={styles.updateButton}
107-
onClick={async () => {
108-
try {
109-
const result = await window.electronAPI.invoke('open-wallet-starters-dir');
110-
if (!result.success) {
111-
throw new Error(result.error);
112-
}
113-
} catch (error) {
114-
console.error('Error opening master wallet directory:', error);
115-
}
116-
}}
118+
onClick={() => setShowWalletWarning(true)}
117119
>
118120
Open
119121
</button>
@@ -164,9 +166,11 @@ const SettingsModal = ({ onResetComplete }) => {
164166
)}
165167
</div>
166168

167-
<button className={styles.resetButton} onClick={handleReset}>
168-
Reset Everything
169-
</button>
169+
<div className={styles.buttonContainer}>
170+
<button className={styles.resetButton} onClick={handleReset}>
171+
Reset Everything
172+
</button>
173+
</div>
170174
</div>
171175
{showResetModal && (
172176
<ResetAllModal
@@ -203,6 +207,23 @@ const SettingsModal = ({ onResetComplete }) => {
203207
onClose={() => setShowUpdateConfirm(false)}
204208
/>
205209
)}
210+
{showWalletWarning && (
211+
<WalletWarningModal
212+
onConfirm={async () => {
213+
try {
214+
const result = await window.electronAPI.invoke('open-wallet-starters-dir');
215+
if (!result.success) {
216+
throw new Error(result.error);
217+
}
218+
} catch (error) {
219+
console.error('Error opening master wallet directory:', error);
220+
} finally {
221+
setShowWalletWarning(false);
222+
}
223+
}}
224+
onClose={() => setShowWalletWarning(false)}
225+
/>
226+
)}
206227
</div>
207228
);
208229
};

0 commit comments

Comments
 (0)