Create our own dedicated avatar widget.
parent
1a1bdc77af
commit
360a6ad826
@ -0,0 +1,25 @@
|
||||
import * as React from 'react';
|
||||
import { pure } from 'recompose';
|
||||
|
||||
export const Avatar = pure((props: { children: React.ReactNode[] | React.ReactNode, size?: number, style?: any }) => {
|
||||
const size = (props.size) ? props.size : 40;
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
backgroundColor: 'grey',
|
||||
color: 'white',
|
||||
display: 'inline-flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
borderRadius: '50%',
|
||||
height: size,
|
||||
width: size,
|
||||
marginRight: 15,
|
||||
...props.style,
|
||||
}}
|
||||
>
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
});
|
Loading…
Reference in New Issue