From faaac72b8169df1271abfd662788ebf20088c76c Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Tue, 8 Mar 2022 16:29:01 +0530 Subject: [PATCH] Add forward ref in avatar component Signed-off-by: Ajay Bura --- src/app/atoms/avatar/Avatar.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/atoms/avatar/Avatar.jsx b/src/app/atoms/avatar/Avatar.jsx index 6120e55..fc46c25 100644 --- a/src/app/atoms/avatar/Avatar.jsx +++ b/src/app/atoms/avatar/Avatar.jsx @@ -10,16 +10,16 @@ import RawIcon from '../system-icons/RawIcon'; import ImageBrokenSVG from '../../../../public/res/svg/image-broken.svg'; import { avatarInitials } from '../../../util/common'; -function Avatar({ +const Avatar = React.forwardRef(({ text, bgColor, iconSrc, iconColor, imageSrc, size, -}) { +}, ref) => { let textSize = 's1'; if (size === 'large') textSize = 'h1'; if (size === 'small') textSize = 'b1'; if (size === 'extra-small') textSize = 'b3'; return ( -
+
{ imageSrc !== null ? ( @@ -50,7 +50,7 @@ function Avatar({ }
); -} +}); Avatar.defaultProps = { text: null,