blob: 603e015b0bec857886525f0b43c4ec40a7350bfa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import { Component } from "react";
interface AccountAvatarProps {
size: number;
image?: string;
dummy?: boolean;
fallbackFill?: string;
round?: boolean;
}
export class AccountAvatar extends Component<AccountAvatarProps> {
render() {
var image = this.props.dummy ?
"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQYV2P4z/j/PwAHAQL/gXZXNQAAAABJRU5ErkJggg==)" :
this.props.image;
return <div style={{
width: this.props.size,
height: this.props.size,
backgroundImage: image,
backgroundSize: "cover",
display: "inline-block",
borderRadius: this.props.size / 2 * Number(this.props.round || 0)
}}/>;
}
}
|