Skip to content

feat: Add user menu #887

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

Merged
merged 8 commits into from
Apr 7, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
refactor: use Language object
  • Loading branch information
BrunoQuaresma committed Apr 7, 2022
commit 0455e5427c8aa3d5b6e14aef255bf1866b40b4a6
11 changes: 8 additions & 3 deletions site/src/components/Navbar/UserDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ import { UserAvatar } from "../User"
import { UserProfileCard } from "../User/UserProfileCard"
import { BorderedMenu } from "./BorderedMenu"

export const Language = {
accountLabel: "Account",
docsLabel: "Documentation",
signOutLabel: "Sign Out",
}
export interface UserDropdownProps {
user: UserResponse
onSignOut: () => void
Expand Down Expand Up @@ -75,7 +80,7 @@ export const UserDropdown: React.FC<UserDropdownProps> = ({ user, onSignOut }: U
<ListItemIcon className={styles.icon}>
<AccountIcon />
</ListItemIcon>
<ListItemText primary="Account" />
<ListItemText primary={Language.accountLabel} />
</MenuItem>
</Link>

Expand All @@ -84,15 +89,15 @@ export const UserDropdown: React.FC<UserDropdownProps> = ({ user, onSignOut }: U
<ListItemIcon className={styles.icon}>
<DocsIcon />
</ListItemIcon>
<ListItemText primary="Documentation" />
<ListItemText primary={Language.docsLabel} />
</MenuItem>
</a>

<MenuItem className={styles.menuItem} onClick={onSignOut}>
<ListItemIcon className={styles.icon}>
<LogoutIcon />
</ListItemIcon>
<ListItemText primary="Sign Out" />
<ListItemText primary={Language.signOutLabel} />
</MenuItem>
</div>
</BorderedMenu>
Expand Down