Skip to content

Commit 37a678d

Browse files
committed
Fix missed src
1 parent dc410a7 commit 37a678d

File tree

3 files changed

+31
-26
lines changed

3 files changed

+31
-26
lines changed

site/src/components/Avatar/Avatar.tsx

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const avatarVariants = cva(
5454
},
5555
);
5656

57-
export type AvatarProps = Omit<AvatarPrimitive.AvatarProps, "children"> &
57+
export type AvatarProps = AvatarPrimitive.AvatarProps &
5858
VariantProps<typeof avatarVariants> & {
5959
src?: string;
6060
alt?: string;
@@ -64,28 +64,35 @@ export type AvatarProps = Omit<AvatarPrimitive.AvatarProps, "children"> &
6464
const Avatar = React.forwardRef<
6565
React.ElementRef<typeof AvatarPrimitive.Root>,
6666
AvatarProps
67-
>(({ className, size, variant, alt, fallback, ...props }, ref) => {
68-
const theme = useTheme();
67+
>(
68+
(
69+
{ className, size, variant, src, alt, fallback, children, ...props },
70+
ref,
71+
) => {
72+
const theme = useTheme();
6973

70-
return (
71-
<AvatarPrimitive.Root
72-
ref={ref}
73-
className={cn(avatarVariants({ size, variant, className }))}
74-
{...props}
75-
>
76-
<AvatarPrimitive.Image
77-
className="aspect-square h-full w-full object-contain"
78-
css={getExternalImageStylesFromUrl(theme.externalImages, props.src)}
79-
alt={alt}
80-
/>
81-
{fallback && (
82-
<AvatarPrimitive.Fallback className="flex h-full w-full items-center justify-center rounded-full">
83-
{fallback.charAt(0).toUpperCase()}
84-
</AvatarPrimitive.Fallback>
85-
)}
86-
</AvatarPrimitive.Root>
87-
);
88-
});
74+
return (
75+
<AvatarPrimitive.Root
76+
ref={ref}
77+
className={cn(avatarVariants({ size, variant, className }))}
78+
{...props}
79+
>
80+
<AvatarPrimitive.Image
81+
src={src}
82+
className="aspect-square h-full w-full object-contain"
83+
css={getExternalImageStylesFromUrl(theme.externalImages, src)}
84+
alt={alt}
85+
/>
86+
{fallback && (
87+
<AvatarPrimitive.Fallback className="flex h-full w-full items-center justify-center rounded-full">
88+
{fallback.charAt(0).toUpperCase()}
89+
</AvatarPrimitive.Fallback>
90+
)}
91+
{children}
92+
</AvatarPrimitive.Root>
93+
);
94+
},
95+
);
8996
Avatar.displayName = AvatarPrimitive.Root.displayName;
9097

9198
export { Avatar };

site/src/modules/builds/BuildAvatar/BuildAvatar.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { css, cx } from "@emotion/css";
21
import { useTheme } from "@emotion/react";
3-
import Badge from "@mui/material/Badge";
42
import type { WorkspaceBuild } from "api/typesGenerated";
53
import { Avatar, type AvatarProps } from "components/Avatar/Avatar";
64
import { BuildIcon } from "components/BuildIcon/BuildIcon";

site/src/modules/management/OrganizationSettingsLayout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import {
88
BreadcrumbSeparator,
99
} from "components/Breadcrumb/Breadcrumb";
1010
import { Loader } from "components/Loader/Loader";
11-
import { UserAvatar } from "components/UserAvatar/UserAvatar";
1211
import { useAuthenticated } from "contexts/auth/RequireAuth";
1312
import { RequirePermission } from "contexts/auth/RequirePermission";
1413
import { useDashboard } from "modules/dashboard/useDashboard";
1514
import { type FC, Suspense, createContext, useContext } from "react";
1615
import { Outlet, useParams } from "react-router-dom";
1716
import { OrganizationSidebar } from "./OrganizationSidebar";
17+
import { UserAvatar } from "modules/users/UserAvatar/UserAvatar";
1818

1919
export const OrganizationSettingsContext = createContext<
2020
OrganizationSettingsValue | undefined
@@ -92,7 +92,7 @@ const OrganizationSettingsLayout: FC = () => {
9292
<BreadcrumbPage className="text-content-primary">
9393
<UserAvatar
9494
key={organization.id}
95-
size="xs"
95+
size="sm"
9696
username={organization.display_name}
9797
avatarURL={organization.icon}
9898
/>

0 commit comments

Comments
 (0)