Skip to content

feat(site): add an organization switcher to the user menu #13269

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 7 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
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
🧹
  • Loading branch information
aslilac committed May 14, 2024
commit c95dbed87df3a20889c12016ff13f42df119d0d6
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { css, type Interpolation, type Theme, useTheme } from "@emotion/react";
import Badge from "@mui/material/Badge";
import type { FC } from "react";
import { useQuery } from "react-query";
import { myOrganizations } from "api/queries/users";
import type * as TypesGen from "api/typesGenerated";
import { DropdownArrow } from "components/DropdownArrow/DropdownArrow";
import {
Expand All @@ -12,7 +13,6 @@ import {
import { UserAvatar } from "components/UserAvatar/UserAvatar";
import { BUTTON_SM_HEIGHT, navHeight } from "theme/constants";
import { UserDropdownContent } from "./UserDropdownContent";
import { myOrganizations } from "api/queries/users";

export interface UserDropdownProps {
user: TypesGen.User;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const UserDropdownContent: FC<UserDropdownContentProps> = ({
{/* <LogoutIcon css={styles.menuItemIcon} /> */}
<Stack direction="row" spacing={1} css={styles.menuItemText}>
{org.name}
{organizationId == org.id && (
{organizationId === org.id && (
<span css={{ fontSize: 12, color: "gray" }}>Current</span>
)}
</Stack>
Expand All @@ -166,7 +166,7 @@ export const UserDropdownContent: FC<UserDropdownContentProps> = ({
</div>
)}

<Divider css={{ marginBottom: 8 }} />
<Divider css={{ marginTop: organizations ? 8 : 0, marginBottom: 8 }} />

<Link to="/settings/account" css={styles.link}>
<MenuItem css={styles.menuItem} onClick={onPopoverClose}>
Expand Down
Loading