Skip to content

Commit b0a91fb

Browse files
authored
add org icons to select org dropdown (#1261)
1 parent 38d1d7b commit b0a91fb

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

apps/web/app/(org)/dashboard/settings/account/Settings.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { useEffect, useId, useState } from "react";
1616
import { toast } from "sonner";
1717
import { removeProfileImage } from "@/actions/account/remove-profile-image";
1818
import { uploadProfileImage } from "@/actions/account/upload-profile-image";
19+
import { SignedImageUrl } from "@/components/SignedImageUrl";
1920
import { useDashboardContext } from "../../Contexts";
2021
import { ProfileImage } from "./components/ProfileImage";
2122
import { patchAccountSettings } from "./server";
@@ -243,6 +244,14 @@ export const Settings = ({
243244
options={(organizationData || []).map((org) => ({
244245
value: org.organization.id,
245246
label: org.organization.name,
247+
image: (
248+
<SignedImageUrl
249+
className="size-5"
250+
image={org.organization.iconUrl}
251+
name={org.organization.name}
252+
type="organization"
253+
/>
254+
),
246255
}))}
247256
/>
248257
</Card>

packages/ui/src/components/Select.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ function Select({
1212
value,
1313
...props
1414
}: React.ComponentProps<typeof SelectPrimitive.Root> & {
15-
options: { value: string; label: string }[];
15+
options: {
16+
value: string;
17+
label: string;
18+
image?: React.ReactNode;
19+
}[];
1620
onValueChange: (value: string) => void;
1721
placeholder: string;
1822
}) {
@@ -29,7 +33,10 @@ function Select({
2933
<SelectContent>
3034
{options.map((option) => (
3135
<SelectItem key={option.value} value={option.value}>
32-
{option.label}
36+
<div className="flex gap-2 items-center">
37+
{option.image}
38+
{option.label}
39+
</div>
3340
</SelectItem>
3441
))}
3542
</SelectContent>

0 commit comments

Comments
 (0)