chore: removed gravatar (#11153)
This commit is contained in:
1 parent
7143923ea4
commit
3f0380617a
23 files changed
+22
-165
No files matched your search
@@ -3,7 +3,7 @@ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
||||
import Link from "next/link";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { defaultAvatarSrc } from "@calcom/lib/defaultAvatarImage";
|
||||
import { AVATAR_FALLBACK } from "@calcom/lib/constants";
|
||||
|
||||
import type { Maybe } from "@trpc/server";
|
||||
|
||||
@@ -17,7 +17,6 @@ export type AvatarProps = {
|
||||
title?: string;
|
||||
alt: string;
|
||||
href?: string;
|
||||
gravatarFallbackMd5?: string;
|
||||
fallback?: React.ReactNode;
|
||||
accepted?: boolean;
|
||||
asChild?: boolean; // Added to ignore the outer span on the fallback component - messes up styling
|
||||
@@ -35,7 +34,7 @@ const sizesPropsBySize = {
|
||||
} as const;
|
||||
|
||||
export function Avatar(props: AvatarProps) {
|
||||
const { imageSrc, gravatarFallbackMd5, size = "md", alt, title, href } = props;
|
||||
const { imageSrc, size = "md", alt, title, href } = props;
|
||||
const rootClass = classNames("aspect-square rounded-full", sizesPropsBySize[size]);
|
||||
let avatar = (
|
||||
<AvatarPrimitive.Root
|
||||
@@ -55,15 +54,7 @@ export function Avatar(props: AvatarProps) {
|
||||
asChild={props.asChild}
|
||||
className="flex h-full items-center justify-center">
|
||||
<>
|
||||
{props.fallback ? (
|
||||
props.fallback
|
||||
) : (
|
||||
<img
|
||||
src={defaultAvatarSrc({ md5: gravatarFallbackMd5 ?? "fallback" })}
|
||||
alt={alt}
|
||||
className={rootClass}
|
||||
/>
|
||||
)}
|
||||
{props.fallback ? props.fallback : <img src={AVATAR_FALLBACK} alt={alt} className={rootClass} />}
|
||||
</>
|
||||
</AvatarPrimitive.Fallback>
|
||||
{props.accepted && (
|
||||
|
||||
@@ -29,10 +29,10 @@ Avatar group can be composed differently based on the number of user profile.
|
||||
|
||||
<Examples title="Avatar style">
|
||||
<Example title="Small">
|
||||
<Avatar size="sm" alt="Avatar Story" gravatarFallbackMd5="[email protected]" />
|
||||
<Avatar size="sm" alt="Avatar Story" />
|
||||
</Example>
|
||||
<Example title="Large">
|
||||
<Avatar size="lg" alt="Avatar Story" gravatarFallbackMd5="[email protected]" />
|
||||
<Avatar size="lg" alt="Avatar Story" />
|
||||
</Example>
|
||||
</Examples>
|
||||
|
||||
@@ -146,7 +146,6 @@ Avatar group can be composed differently based on the number of user profile.
|
||||
args={{
|
||||
size: "sm",
|
||||
alt: "Avatar Story",
|
||||
gravatarFallbackMd5: "[email protected]",
|
||||
}}
|
||||
argTypes={{
|
||||
size: {
|
||||
@@ -156,12 +155,11 @@ Avatar group can be composed differently based on the number of user profile.
|
||||
},
|
||||
},
|
||||
alt: { control: "text" },
|
||||
gravatarFallbackMd5: { control: "text" },
|
||||
}}>
|
||||
{({ size, alt, gravatarFallbackMd5 }) => (
|
||||
{({ size, alt }) => (
|
||||
<VariantsTable titles={["Default"]} columnMinWidth={150}>
|
||||
<VariantRow variant={size}>
|
||||
<Avatar size={size} alt={alt} gravatarFallbackMd5={gravatarFallbackMd5} />
|
||||
<Avatar size={size} alt={alt} />
|
||||
</VariantRow>
|
||||
</VariantsTable>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user