mirror of https://github.com/buster-so/buster.git
AVatar tooltip is the default
This commit is contained in:
parent
4bb83dbf17
commit
65c08cd641
|
@ -12,16 +12,17 @@ export interface AvatarProps {
|
||||||
fallbackClassName?: string;
|
fallbackClassName?: string;
|
||||||
useToolTip?: boolean;
|
useToolTip?: boolean;
|
||||||
size?: number;
|
size?: number;
|
||||||
|
tooltipTitle?: string | React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Avatar: React.FC<AvatarProps> = React.memo(
|
export const Avatar: React.FC<AvatarProps> = React.memo(
|
||||||
({ image, name, className, useToolTip, size, fallbackClassName }) => {
|
({ image, name, className, useToolTip = true, size, fallbackClassName, tooltipTitle }) => {
|
||||||
const hasName = !!name;
|
const hasName = !!name;
|
||||||
const nameLetters = createNameLetters(name);
|
const nameLetters = createNameLetters(name);
|
||||||
const hasImage = !!image;
|
const hasImage = !!image;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip delayDuration={300} title={useToolTip ? name || '' : ''}>
|
<Tooltip delayDuration={300} title={useToolTip ? tooltipTitle || name || '' : ''}>
|
||||||
<AvatarBase
|
<AvatarBase
|
||||||
className={className}
|
className={className}
|
||||||
style={{
|
style={{
|
||||||
|
|
Loading…
Reference in New Issue