Skip to content

Commit cc8a7bb

Browse files
Add org icon
1 parent 8dd319f commit cc8a7bb

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed
1.81 KB
Loading
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { cn } from "@/lib/utils";
2+
import placeholderAvatar from "@/public/placeholder_avatar.png";
3+
import { cva } from "class-variance-authority";
4+
import Image from "next/image";
5+
6+
interface OrgIconProps {
7+
className?: string;
8+
size?: "default";
9+
}
10+
11+
const iconVariants = cva(
12+
"rounded-full",
13+
{
14+
variants: {
15+
size: {
16+
default: "w-5 h-5"
17+
}
18+
},
19+
defaultVariants: {
20+
size: "default"
21+
}
22+
},
23+
)
24+
25+
export const OrgIcon = ({
26+
className,
27+
size,
28+
}: OrgIconProps) => {
29+
return (
30+
<Image
31+
src={placeholderAvatar}
32+
alt="Organization avatar"
33+
className={cn(iconVariants({ size, className }))}
34+
/>
35+
)
36+
}

packages/web/src/app/components/orgSelector/orgSelectorDropdown.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import { Button } from "@/components/ui/button";
55
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command";
66
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
77
import { isServiceError } from "@/lib/utils";
8-
import { CaretSortIcon, CheckIcon, GitHubLogoIcon } from "@radix-ui/react-icons";
8+
import { CaretSortIcon, CheckIcon } from "@radix-ui/react-icons";
99
import { useRouter } from "next/navigation";
1010
import { useCallback, useMemo, useState } from "react";
1111
import { OrgCreationDialog } from "./orgCreationDialog";
12+
import { OrgIcon } from "./orgIcon";
1213

1314

1415
interface OrgSelectorDropdownProps {
@@ -106,7 +107,7 @@ export const OrgSelectorDropdown = ({
106107
>
107108
<DropdownMenuTrigger asChild>
108109
<Button variant="ghost" size="default">
109-
<GitHubLogoIcon className="h-5 w-5 mr-1.5" />
110+
<OrgIcon className="mr-1.5" />
110111
<p className="font-medium text-sm mr-1">{activeOrg.name}</p>
111112
<CaretSortIcon className="h-5 w-5 font-medium" />
112113
</Button>
@@ -146,7 +147,7 @@ export const OrgSelectorDropdown = ({
146147
onSelect={() => onSwitchOrg(org.id, org.name)}
147148
>
148149
<div className="flex flex-row gap-1.5 items-center">
149-
<GitHubLogoIcon className="h-5 w-5" />
150+
<OrgIcon />
150151
{org.name}
151152
</div>
152153
{org.id === activeOrgId && (

0 commit comments

Comments
 (0)