Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavBar index.tsx Documentation #304

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions frontend/src/components/utils/NavBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@ function GetButtonColor(lab: string) {
: 'primary';
}

/**
* NavBar Component
*
* This component is the navigation bar that is used on all pages throughout the CUApts website. It provides routing to the Home and FAQ pages
* and the Login/Sign Out buttons.
* @param headersData: An array of objects representing navigation links. Each object should have label (string) and href (string) properties.
* @param user: (firebase.User | null) The current user object, can be null if the user is not authenticated.
* @param setUser: function to set user.
* @returns the NavBar component.
*/

const NavBar = ({ headersData, user, setUser }: Props): ReactElement => {
const initialUserState = !user ? 'Sign In' : 'Sign Out';
const [buttonText, setButtonText] = useState(initialUserState);
Expand Down
Loading