Class NavbarController
java.lang.Object
ui.controller.NavbarController
Controller for the navigation bar.
Handles navigation between pages and updates the active button state.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgoHome()Navigates to the home page.voidNavigates to the organizations page.voidNavigates to the sign in page or profile page depending on authentication state.voidHides the navbar.voidsetActivePage(Page page) Highlights the navbar button corresponding to the given page.voidsetOnNavigate(Consumer<Page> onNavigate) Sets the navigation callback.voidShows the navbar.voidUpdates the sign in button text based on the user's authentication state.
-
Constructor Details
-
NavbarController
public NavbarController()
-
-
Method Details
-
setActivePage
Highlights the navbar button corresponding to the given page.- Parameters:
page- the currently active page
-
goHome
public void goHome()Navigates to the home page. -
goToSignIn
public void goToSignIn()Navigates to the sign in page or profile page depending on authentication state. -
goToOrganizations
public void goToOrganizations()Navigates to the organizations page. -
updateAuthButton
public void updateAuthButton()Updates the sign in button text based on the user's authentication state. Shows "My Profile" if signed in, "Sign In" otherwise.