mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-15 11:40:29 +03:00
Fix theme
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
18dc02c700
commit
630dbee817
5 changed files with 52 additions and 25 deletions
|
|
@ -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']),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue