chore: update variable name from groupSize to contextSize (#42396)

This commit is contained in:
yiwwhl 2023-05-16 16:19:14 +08:00 committed by GitHub
parent 3fb12b9e65
commit 26590f6b35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,7 @@ const InternalAvatar: React.ForwardRefRenderFunction<HTMLSpanElement, AvatarProp
props,
ref,
) => {
const groupSize = React.useContext(SizeContext);
const contextSize = React.useContext<AvatarSize>(SizeContext);
const [scale, setScale] = React.useState(1);
const [mounted, setMounted] = React.useState(false);
@ -108,7 +108,7 @@ const InternalAvatar: React.ForwardRefRenderFunction<HTMLSpanElement, AvatarProp
...others
} = props;
const size = customSize === 'default' ? groupSize : customSize;
const size = customSize === 'default' ? contextSize : customSize;
const needResponsive = Object.keys(typeof size === 'object' ? size || {} : {}).some((key) =>
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].includes(key),