1- import * as React from 'react'
1+ import React from 'react'
22import MaterialAvatar , {
33 AvatarProps as MaterialAvatarProps
44} from '@material-ui/core/Avatar'
@@ -12,25 +12,26 @@ import {
1212 FlexboxProps
1313} from '@material-ui/system'
1414import { fractionToPercent } from '../../util'
15+ import { Theme } from '../../theme'
1516
16- export const textColor = style ( {
17+ const textColor = style < 'color' , Theme > ( {
1718 prop : 'color' ,
1819 themeKey : 'palette'
1920} )
2021
21- export const bgcolor = style ( {
22- prop : 'bg ' ,
22+ const bgcolor = style < 'bgcolor' , Theme > ( {
23+ prop : 'bgcolor ' ,
2324 cssProperty : 'backgroundColor' ,
2425 themeKey : 'palette'
2526} )
2627
27- export const width = style ( {
28+ const width = style < 'size' , Theme > ( {
2829 prop : 'size' ,
2930 cssProperty : 'width' ,
3031 transform : fractionToPercent
3132} )
3233
33- export const height = style ( {
34+ const height = style < 'size' , Theme > ( {
3435 prop : 'size' ,
3536 cssProperty : 'height' ,
3637 transform : fractionToPercent
@@ -42,18 +43,20 @@ export type AvatarProps = MaterialAvatarProps &
4243 /**
4344 * The background color
4445 */
45- bg ?: string
46+ bgcolor ?: string
4647 /**
4748 * The color of the icon or text
4849 */
4950 color ?: string
5051 /**
5152 * The size (width and height) of the avatar, e.g. (24px)
5253 */
53- size ?: string
54+ size ?: string | number
5455 }
5556
56- export const Avatar = styled < React . ComponentType < AvatarProps > > ( MaterialAvatar ) (
57+ export const Avatar : React . ComponentType < AvatarProps > = styled <
58+ React . ComponentType < AvatarProps >
59+ > ( MaterialAvatar ) (
5760 compose (
5861 spacing ,
5962 flexbox ,
0 commit comments