mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-03 11:22:25 +00:00
feat: Move logout button to menu list on mobile
- Added a new mobile-specific "Logout" button to the profile navigation list, visible only on screens smaller than `lg`. - Hid the existing footer logout button on mobile screens. - Updated `ProfileModalController` to bind the logout logic to the new mobile button. - Applied `data-variant="critical"` and spacing to the new button to match styling requirements.
This commit is contained in:
1 parent
facad9dd80
commit
486c8af4a1
36 files changed
+24
-942
No files matched your search
@@ -1211,6 +1211,7 @@ export class ProfileModalController {
|
||||
this.globalProfileAvatar = null;
|
||||
this.closeButton = null;
|
||||
this.logoutButton = null;
|
||||
this.mobileLogoutButton = null;
|
||||
this.channelLink = null;
|
||||
this.addAccountButton = null;
|
||||
this.navButtons = {
|
||||
@@ -1475,6 +1476,8 @@ export class ProfileModalController {
|
||||
this.profileModalBackButton =
|
||||
document.getElementById("profileModalBack") || null;
|
||||
this.logoutButton = document.getElementById("profileLogoutBtn") || null;
|
||||
this.mobileLogoutButton =
|
||||
document.getElementById("profileMobileLogoutBtn") || null;
|
||||
this.channelLink = document.getElementById("profileChannelLink") || null;
|
||||
this.addAccountButton =
|
||||
document.getElementById("profileAddAccountBtn") || null;
|
||||
@@ -5028,6 +5031,17 @@ export class ProfileModalController {
|
||||
});
|
||||
}
|
||||
|
||||
if (this.mobileLogoutButton instanceof HTMLElement) {
|
||||
this.mobileLogoutButton.addEventListener("click", async () => {
|
||||
try {
|
||||
await this.callbacks.onLogout(this);
|
||||
} catch (error) {
|
||||
this.showError("Failed to logout. Please try again.");
|
||||
}
|
||||
this.hide();
|
||||
});
|
||||
}
|
||||
|
||||
if (this.profileModalBackButton instanceof HTMLElement) {
|
||||
this.profileModalBackButton.addEventListener("click", () => {
|
||||
this.setMobileView("menu", { focusMenu: true });
|
||||
|
||||
Reference in new issue
Block a user