Spaces:
Paused

dushyantsingh0 commited on
Commit
a2eb26d
·
1 Parent(s): ea10f92

backend stabilization

Browse files
frontend/apps/customer/src/components/TopBar.tsx CHANGED
@@ -1,5 +1,5 @@
1
  import React, { useState, useEffect, useRef } from 'react';
2
- import { api, getWsUrl, getStorageKey } from '@nexus/shared';
3
  import { StatusBadge } from './Badges';
4
  import {
5
  Bell,
@@ -29,6 +29,7 @@ interface TopBarProps {
29
  }
30
 
31
  export const TopBar: React.FC<TopBarProps> = ({ title, subtitle, logoUrl, onSelectTicket, onLogout }) => {
 
32
  const [searchQuery, setSearchQuery] = useState("");
33
  const [searchResults, setSearchResults] = useState<any[]>([]);
34
  const [isSearching, setIsSearching] = useState(false);
@@ -200,6 +201,22 @@ export const TopBar: React.FC<TopBarProps> = ({ title, subtitle, logoUrl, onSele
200
  </div>
201
 
202
  <div style={{ display: "flex", alignItems: "center", gap: 20 }}>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  <div style={{ position: "relative" }} ref={searchRef}>
204
  <div className="input-focus" style={{ display: 'flex', alignItems: 'center', background: "var(--bg-dark)", borderRadius: 16, border: `1.5px solid ${COLORS.border}`, padding: '0 16px', transition: 'all 0.3s' }}>
205
  <Search size={18} strokeWidth={2} style={{ color: COLORS.muted, opacity: 0.6 }} />
 
1
  import React, { useState, useEffect, useRef } from 'react';
2
+ import { api, getWsUrl, getStorageKey, useTheme } from '@nexus/shared';
3
  import { StatusBadge } from './Badges';
4
  import {
5
  Bell,
 
29
  }
30
 
31
  export const TopBar: React.FC<TopBarProps> = ({ title, subtitle, logoUrl, onSelectTicket, onLogout }) => {
32
+ const { theme, setTheme } = useTheme();
33
  const [searchQuery, setSearchQuery] = useState("");
34
  const [searchResults, setSearchResults] = useState<any[]>([]);
35
  const [isSearching, setIsSearching] = useState(false);
 
201
  </div>
202
 
203
  <div style={{ display: "flex", alignItems: "center", gap: 20 }}>
204
+ <button
205
+ onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}
206
+ style={{
207
+ background: 'none',
208
+ border: 'none',
209
+ cursor: 'pointer',
210
+ color: COLORS.muted,
211
+ display: 'flex',
212
+ alignItems: 'center',
213
+ padding: 8
214
+ }}
215
+ title="Toggle Theme"
216
+ >
217
+ {theme === 'light' ? '🌙' : '☀️'}
218
+ </button>
219
+
220
  <div style={{ position: "relative" }} ref={searchRef}>
221
  <div className="input-focus" style={{ display: 'flex', alignItems: 'center', background: "var(--bg-dark)", borderRadius: 16, border: `1.5px solid ${COLORS.border}`, padding: '0 16px', transition: 'all 0.3s' }}>
222
  <Search size={18} strokeWidth={2} style={{ color: COLORS.muted, opacity: 0.6 }} />
frontend/apps/customer/src/main.tsx CHANGED
@@ -1,17 +1,19 @@
1
  import { StrictMode } from 'react'
2
  import { createRoot } from 'react-dom/client'
3
  import './index.css'
4
- import { AuthProvider, NexusProvider, setPortalType } from '@nexus/shared'
5
  import App from './App.tsx'
6
 
7
  setPortalType('customer');
8
 
9
  createRoot(document.getElementById('root')!).render(
10
  <StrictMode>
11
- <AuthProvider>
12
- <NexusProvider>
13
- <App />
14
- </NexusProvider>
15
- </AuthProvider>
 
 
16
  </StrictMode>,
17
  );
 
1
  import { StrictMode } from 'react'
2
  import { createRoot } from 'react-dom/client'
3
  import './index.css'
4
+ import { AuthProvider, NexusProvider, setPortalType, ThemeProvider } from '@nexus/shared'
5
  import App from './App.tsx'
6
 
7
  setPortalType('customer');
8
 
9
  createRoot(document.getElementById('root')!).render(
10
  <StrictMode>
11
+ <ThemeProvider>
12
+ <AuthProvider>
13
+ <NexusProvider>
14
+ <App />
15
+ </NexusProvider>
16
+ </AuthProvider>
17
+ </ThemeProvider>
18
  </StrictMode>,
19
  );
frontend/apps/internal/src/components/TopBar.module.css CHANGED
@@ -138,7 +138,7 @@
138
  left: 12px;
139
  top: 50%;
140
  transform: translateY(-50%);
141
- color: #94a3b8;
142
  font-size: 14px;
143
  }
144
 
@@ -155,8 +155,8 @@
155
  }
156
 
157
  .searchInput:focus {
158
- border-color: #3b82f6;
159
- box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
160
  }
161
 
162
  .resultsDropdown {
@@ -208,8 +208,8 @@
208
  .resultId {
209
  font-size: 11px;
210
  font-weight: 800;
211
- color: #64748b;
212
- background: #f1f5f9;
213
  padding: 2px 6px;
214
  border-radius: 4px;
215
  }
@@ -217,8 +217,8 @@
217
  .resultScore {
218
  font-size: 11px;
219
  font-weight: 800;
220
- color: #3b82f6;
221
- background: rgba(59, 130, 246, 0.1);
222
  padding: 2px 6px;
223
  border-radius: 4px;
224
  }
@@ -233,12 +233,12 @@
233
 
234
  .resultStatus[data-status="OPEN"] { color: #10b981; background: rgba(16, 185, 129, 0.1); }
235
  .resultStatus[data-status="IN_PROGRESS"] { color: #6366f1; background: rgba(99, 102, 241, 0.1); }
236
- .resultStatus[data-status="RESOLVED"] { color: #94a3b8; background: #f8fafc; }
237
 
238
  .resultTitle {
239
  font-size: 13px;
240
  font-weight: 700;
241
- color: #1e293b;
242
  margin-bottom: 6px;
243
  }
244
 
@@ -246,7 +246,7 @@
246
  display: flex;
247
  justify-content: flex-end;
248
  font-size: 10px;
249
- color: #94a3b8;
250
  font-weight: 600;
251
  }
252
 
@@ -273,14 +273,14 @@
273
  left: 0;
274
  right: 0;
275
  padding: 10px;
276
- background: rgba(255, 255, 255, 0.9);
277
  backdrop-filter: blur(8px);
278
- border: 1px solid #e2e8f0;
279
  border-radius: 10px;
280
  font-size: 11px;
281
  font-weight: 800;
282
  text-align: center;
283
- color: #64748b;
284
  text-transform: uppercase;
285
  letter-spacing: 0.05em;
286
  z-index: 1000;
@@ -290,7 +290,7 @@
290
  .noResults {
291
  padding: 32px 20px;
292
  text-align: center;
293
- color: #94a3b8;
294
  font-size: 12px;
295
  font-weight: 600;
296
  }
@@ -309,7 +309,7 @@
309
  .dot {
310
  width: 8px;
311
  height: 8px;
312
- background-color: #10b981;
313
  border-radius: 50%;
314
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
315
  animation: pulse 2s infinite;
@@ -370,7 +370,7 @@
370
 
371
  .iconButton {
372
  background: var(--bg-card);
373
- border: 1px solid #e2e8f0;
374
  width: 38px;
375
  height: 38px;
376
  border-radius: 8px;
@@ -383,8 +383,8 @@
383
  }
384
 
385
  .iconButton:hover {
386
- background: #f8fafc;
387
- border-color: #cbd5e1;
388
  }
389
 
390
  .notificationBadge {
@@ -395,7 +395,7 @@
395
  height: 8px;
396
  background-color: #ef4444;
397
  border-radius: 50%;
398
- border: 2px solid white;
399
  }
400
 
401
  /* Logout */
@@ -514,7 +514,7 @@
514
  .logoutText {
515
  font-size: 18px;
516
  font-weight: 800;
517
- color: #1e293b;
518
  margin-bottom: 24px;
519
  }
520
 
 
138
  left: 12px;
139
  top: 50%;
140
  transform: translateY(-50%);
141
+ color: var(--text-muted);
142
  font-size: 14px;
143
  }
144
 
 
155
  }
156
 
157
  .searchInput:focus {
158
+ border-color: var(--primary);
159
+ box-shadow: 0 0 0 3px var(--primary-glow);
160
  }
161
 
162
  .resultsDropdown {
 
208
  .resultId {
209
  font-size: 11px;
210
  font-weight: 800;
211
+ color: var(--text-muted);
212
+ background: var(--bg-hover);
213
  padding: 2px 6px;
214
  border-radius: 4px;
215
  }
 
217
  .resultScore {
218
  font-size: 11px;
219
  font-weight: 800;
220
+ color: var(--primary);
221
+ background: var(--primary-glow);
222
  padding: 2px 6px;
223
  border-radius: 4px;
224
  }
 
233
 
234
  .resultStatus[data-status="OPEN"] { color: #10b981; background: rgba(16, 185, 129, 0.1); }
235
  .resultStatus[data-status="IN_PROGRESS"] { color: #6366f1; background: rgba(99, 102, 241, 0.1); }
236
+ .resultStatus[data-status="RESOLVED"] { color: var(--text-muted); background: var(--bg-hover); }
237
 
238
  .resultTitle {
239
  font-size: 13px;
240
  font-weight: 700;
241
+ color: var(--text-main);
242
  margin-bottom: 6px;
243
  }
244
 
 
246
  display: flex;
247
  justify-content: flex-end;
248
  font-size: 10px;
249
+ color: var(--text-muted);
250
  font-weight: 600;
251
  }
252
 
 
273
  left: 0;
274
  right: 0;
275
  padding: 10px;
276
+ background: var(--glass-bg);
277
  backdrop-filter: blur(8px);
278
+ border: 1px solid var(--border-subtle);
279
  border-radius: 10px;
280
  font-size: 11px;
281
  font-weight: 800;
282
  text-align: center;
283
+ color: var(--text-muted);
284
  text-transform: uppercase;
285
  letter-spacing: 0.05em;
286
  z-index: 1000;
 
290
  .noResults {
291
  padding: 32px 20px;
292
  text-align: center;
293
+ color: var(--text-muted);
294
  font-size: 12px;
295
  font-weight: 600;
296
  }
 
309
  .dot {
310
  width: 8px;
311
  height: 8px;
312
+ background-color: var(--success);
313
  border-radius: 50%;
314
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
315
  animation: pulse 2s infinite;
 
370
 
371
  .iconButton {
372
  background: var(--bg-card);
373
+ border: 1px solid var(--border-subtle);
374
  width: 38px;
375
  height: 38px;
376
  border-radius: 8px;
 
383
  }
384
 
385
  .iconButton:hover {
386
+ background: var(--bg-hover);
387
+ border-color: var(--border-hi);
388
  }
389
 
390
  .notificationBadge {
 
395
  height: 8px;
396
  background-color: #ef4444;
397
  border-radius: 50%;
398
+ border: 2px solid var(--bg-card);
399
  }
400
 
401
  /* Logout */
 
514
  .logoutText {
515
  font-size: 18px;
516
  font-weight: 800;
517
+ color: var(--text-main);
518
  margin-bottom: 24px;
519
  }
520
 
frontend/apps/internal/src/components/TopBar.tsx CHANGED
@@ -1,6 +1,6 @@
1
  import React, { useState, useEffect } from 'react';
2
  import { useAuth, api, getWsUrl, getStorageKey, useTheme } from '@nexus/shared';
3
- import { Menu, Sun, Moon, Zap, Shield } from 'lucide-react';
4
  import styles from './TopBar.module.css';
5
 
6
  interface TopBarProps {
@@ -278,7 +278,7 @@ export const TopBar: React.FC<TopBarProps> = ({ title, subtitle, logoUrl, onTick
278
  {notifications.length > 0 && (
279
  <button
280
  onClick={(e) => { e.stopPropagation(); clearAllNotifications(); }}
281
- style={{ background: 'none', border: 'none', color: '#ef4444', fontSize: '10px', fontWeight: 800, cursor: 'pointer', padding: '4px 8px', borderRadius: '4px' }}
282
  >
283
  CLEAR ALL
284
  </button>
 
1
  import React, { useState, useEffect } from 'react';
2
  import { useAuth, api, getWsUrl, getStorageKey, useTheme } from '@nexus/shared';
3
+ import { Menu, Sun, Moon } from 'lucide-react';
4
  import styles from './TopBar.module.css';
5
 
6
  interface TopBarProps {
 
278
  {notifications.length > 0 && (
279
  <button
280
  onClick={(e) => { e.stopPropagation(); clearAllNotifications(); }}
281
+ style={{ background: 'var(--bg-hover)', border: '1px solid var(--border-subtle)', color: 'var(--text-muted)', fontSize: '10px', fontWeight: 800, cursor: 'pointer', padding: '4px 8px', borderRadius: '4px' }}
282
  >
283
  CLEAR ALL
284
  </button>
frontend/packages/shared/src/styles/theme.css CHANGED
@@ -40,6 +40,18 @@
40
  --glass-border: rgba(0, 0, 0, 0.04);
41
  --banner-gradient: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%);
42
  --glass-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
 
45
  /* 2. Theme: High-Contrast Dark */
@@ -61,7 +73,19 @@
61
  --border-hi: #475569;
62
  --glass-bg: rgba(15, 23, 42, 0.8);
63
  --glass-border: rgba(255, 255, 255, 0.1);
64
- --banner-gradient: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%);
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
66
 
67
  /* Premium Selection & Scrollbars */
 
40
  --glass-border: rgba(0, 0, 0, 0.04);
41
  --banner-gradient: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%);
42
  --glass-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
43
+
44
+ /* Legacy Aliases for Backward Compatibility */
45
+ --text1: var(--text-main);
46
+ --text2: var(--text-muted);
47
+ --text3: var(--text-dim);
48
+ --bg1: var(--bg-dark);
49
+ --bg2: var(--bg-hover);
50
+ --bg3: var(--bg-panel);
51
+ --bg4: var(--bg-hover);
52
+ --border: var(--border-subtle);
53
+ --accent: var(--primary);
54
+ --accent-glow: var(--primary-glow);
55
  }
56
 
57
  /* 2. Theme: High-Contrast Dark */
 
73
  --border-hi: #475569;
74
  --glass-bg: rgba(15, 23, 42, 0.8);
75
  --glass-border: rgba(255, 255, 255, 0.1);
76
+ --glass-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
77
+
78
+ /* Legacy Aliases for Backward Compatibility */
79
+ --text1: var(--text-main);
80
+ --text2: var(--text-muted);
81
+ --text3: var(--text-dim);
82
+ --bg1: var(--bg-dark);
83
+ --bg2: var(--bg-hover);
84
+ --bg3: var(--bg-panel);
85
+ --bg4: var(--bg-hover);
86
+ --border: var(--border-subtle);
87
+ --accent: var(--primary);
88
+ --accent-glow: var(--primary-glow);
89
  }
90
 
91
  /* Premium Selection & Scrollbars */