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']),
};

View file

@ -10,7 +10,7 @@ function Text({
if (className) classes.push(className);
classes.push(`text text-${variant} text-${weight}`);
if (primary) classes.push('text-primary');
if (primary) classes.push('font-primary');
const textClass = classes.join(' ');
if (span) return <span className={classes.join(' ')}>{ children }</span>;

View file

@ -24,14 +24,6 @@
}
}
.text-primary {
font-family: var(--font-primary);
--fw-light: var(--p-fw-light);
--fw-normal: var(--p-fw-normal);
--fw-medium: var(--p-fw-medium);
--fw-bold: var(--p-fw-bold);
}
.text-light {
font-weight: var(--fw-light);
}