Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/avatar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export enum AvatarStyle {

export interface Props {
avatarStyle: AvatarStyle
fillCircle?: string
className?: string;
style?: React.CSSProperties
}
Expand All @@ -27,8 +28,9 @@ export default class Avatar extends React.Component<Props> {
private mask3 = uniqueId('react-mask-')

render() {
console.log('fillCircle', this.props)
const { path1, path2, path3, mask1, mask2, mask3 } = this
const { avatarStyle } = this.props
const { avatarStyle, fillCircle = '#65C9FF' } = this.props
const circle = avatarStyle === AvatarStyle.Circle
return (
<svg
Expand Down Expand Up @@ -79,7 +81,7 @@ export default class Avatar extends React.Component<Props> {
<g
id="Color/Palette/Blue-01"
mask={'url(#' + mask1 + ')'}
fill="#65C9FF">
fill={fillCircle}>
<rect id="🖍Color" x="0" y="0" width="240" height="240" />
</g>
</g>
Expand Down
5 changes: 3 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {default as PieceComponent} from './avatar/piece';

export interface Props {
avatarStyle: string
fillCircle?: string
className?: string;
style?: React.CSSProperties
topType?: string
Expand Down Expand Up @@ -49,8 +50,8 @@ export default class AvatarComponent extends React.Component<Props> {
}

render () {
const { avatarStyle, style, className } = this.props
return <Avatar avatarStyle={avatarStyle as AvatarStyle} style={style} className={className} />
const { avatarStyle, fillCircle, style, className } = this.props
return <Avatar avatarStyle={avatarStyle as AvatarStyle} fillCircle={fillCircle} style={style} className={className} />
}

private updateOptionContext (props: Props) {
Expand Down