Fix dropdown menu and add Back to Dashboard button in profile and wallet pages

- Add visible 'Back to Dashboard' button in profile.html header
- Add visible 'Back to Dashboard' button in wallet.html header
- Add logout function to wallet.html
- Both buttons use role-based navigation (player -> player.html, broker -> broker.html)
parent 669defdf
......@@ -15,6 +15,7 @@
</div>
<div class="user-info">
<span id="user-balance" class="balance-display">Balance: $0.00</span>
<a href="#" class="btn btn-secondary" id="back-to-dashboard" onclick="goToDashboard(); return false;">Back to Dashboard</a>
<div class="nav-user">
<div class="user-profile" onclick="toggleUserDropdown()">
<img id="user-avatar" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='%234a5568'/%3E%3Ccircle cx='50' cy='35' r='20' fill='%23718096'/%3E%3Cellipse cx='50' cy='85' rx='35' ry='25' fill='%23718096'/%3E%3C/svg%3E" alt="Avatar" class="user-avatar">
......
......@@ -15,6 +15,7 @@
</div>
<div class="user-info">
<span id="user-balance" class="balance-display">Balance: $0.00</span>
<a href="#" class="btn btn-secondary" id="back-to-dashboard" onclick="goToDashboard(); return false;">Back to Dashboard</a>
<div class="nav-user">
<div class="user-profile" onclick="toggleUserDropdown()">
<img id="user-avatar" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='%234a5568'/%3E%3Ccircle cx='50' cy='35' r='20' fill='%23718096'/%3E%3Cellipse cx='50' cy='85' rx='35' ry='25' fill='%23718096'/%3E%3C/svg%3E" alt="Avatar" class="user-avatar">
......@@ -565,6 +566,15 @@
});
}
});
// Logout function
function logout() {
localStorage.removeItem('authToken');
localStorage.removeItem('currentUser');
localStorage.removeItem('refreshToken');
localStorage.removeItem('tokenExpiresAt');
window.location.href = 'index.html';
}
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment