File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -288,9 +288,7 @@ img { max-width: 100%; }
288288# theme-toggle .icon-moon { display : none; }
289289: root [data-theme = "light" ] # theme-toggle .icon-sun { display : none; }
290290: root [data-theme = "light" ] # theme-toggle .icon-moon { display : block; }
291- /* Theme label text */
292- # theme-toggle .theme-label ::after { content : 'Light mode' ; }
293- : root [data-theme = "light" ] # theme-toggle .theme-label ::after { content : 'Dark mode' ; }
291+ /* Theme label text — set via JS updateLabel() */
294292
295293/* Avatar button + dropdown */
296294.topbar-avatar-wrap {
Original file line number Diff line number Diff line change @@ -149,6 +149,16 @@ const CP = (() => {
149149 } catch { /* keep defaults */ }
150150 }
151151
152+ async function loadTopbarEarnings ( ) {
153+ try {
154+ await loadExchangeRates ( ) ;
155+ const data = await api ( '/api/earnings/summary' ) ;
156+ setTextContent ( 'topbar-total' , formatCurrency ( data . total || 0 ) ) ;
157+ } catch {
158+ setTextContent ( 'topbar-total' , formatCurrency ( 0 ) ) ;
159+ }
160+ }
161+
152162 async function loadDashboard ( ) {
153163 await loadExchangeRates ( ) ;
154164 await Promise . all ( [
@@ -1650,6 +1660,9 @@ const CP = (() => {
16501660 _displayCurrency = localStorage . getItem ( 'cp-display-currency' ) || detectDefaultCurrency ( ) ;
16511661 initTopbarCurrency ( ) ;
16521662
1663+ // Load topbar earnings on every page
1664+ loadTopbarEarnings ( ) ;
1665+
16531666 const page = document . body . dataset . page ;
16541667 switch ( page ) {
16551668 case 'dashboard' :
You can’t perform that action at this time.
0 commit comments