cleanup code

pull/681/head
Audric Ackermann 5 years ago
parent 4999ececfd
commit 2fdb4c3540

@ -54,11 +54,9 @@ export class Avatar extends React.PureComponent<Props, State> {
return this.renderNoImage(); return this.renderNoImage();
} }
const borderRadius = '50%';
const borderStyle = this.getBorderStyle( const borderStyle = this.getBorderStyle(
borderColor, borderColor,
borderWidth, borderWidth,
borderRadius
); );
// Generate the seed // Generate the seed
@ -213,19 +211,15 @@ export class Avatar extends React.PureComponent<Props, State> {
: this.renderIdenticon(); : this.renderIdenticon();
} }
private getBorderStyle(color?: string, width?: number, radius?: string) { private getBorderStyle(color?: string, width?: number) {
const borderWidth = typeof width === 'number' ? width : 3; const borderWidth = typeof width === 'number' ? width : 3;
return color return color
? { ? {
borderColor: color, borderColor: color,
borderStyle: 'solid', borderStyle: 'solid',
borderWidth: borderWidth, borderWidth: borderWidth,
} }
: radius : undefined;
? {
borderRadius: radius,
}
: undefined;
} }
} }

Loading…
Cancel
Save