Fix theme

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2021-12-17 11:32:21 +05:30
parent 18dc02c700
commit 630dbee817
5 changed files with 52 additions and 25 deletions

View file

@ -8,7 +8,7 @@ import Text from '../text/Text';
import RawIcon from '../system-icons/RawIcon';
function Avatar({
text, bgColor, iconSrc, imageSrc, size,
text, bgColor, iconSrc, iconColor, imageSrc, size,
}) {
const [image, updateImage] = useState(imageSrc);
let textSize = 's1';
@ -30,7 +30,7 @@ function Avatar({
>
{
iconSrc !== null
? <RawIcon size={size} src={iconSrc} />
? <RawIcon size={size} src={iconSrc} color={iconColor} />
: text !== null && (
<Text variant={textSize} weight="medium" primary>
{twemojify([...text][0])}
@ -48,6 +48,7 @@ Avatar.defaultProps = {
text: null,
bgColor: 'transparent',
iconSrc: null,
iconColor: null,
imageSrc: null,
size: 'normal',
};
@ -56,6 +57,7 @@ Avatar.propTypes = {
text: PropTypes.string,
bgColor: PropTypes.string,
iconSrc: PropTypes.string,
iconColor: PropTypes.string,
imageSrc: PropTypes.string,
size: PropTypes.oneOf(['large', 'normal', 'small', 'extra-small']),
};