diff --git a/components/core/Avatar/Avatar.module.css b/components/core/Avatar/Avatar.module.css deleted file mode 100644 index c3a2af639..000000000 --- a/components/core/Avatar/Avatar.module.css +++ /dev/null @@ -1,2 +0,0 @@ -.root { -} diff --git a/components/core/Avatar/Avatar.tsx b/components/core/Avatar/Avatar.tsx index 1575cd1d8..025a92068 100644 --- a/components/core/Avatar/Avatar.tsx +++ b/components/core/Avatar/Avatar.tsx @@ -1,22 +1,39 @@ import cn from 'classnames' import { FC } from 'react' -import s from './Avatar.module.css' - +import { random } from 'lodash' +import { useState } from 'react' interface Props { className?: string children?: any } -const Avatar: FC = ({ className }) => { - const rootClassName = cn(s.root, className) +function getRandomPairOfColors() { + const colors = ['#f33', '#7928ca', '#50e3c2', '#7928ca', '#7928CA'] + const getRandomIdx = () => random(0, colors.length - 1) + let idx = getRandomIdx() + let idx2 = getRandomIdx() + + // Has to be a different color + while (idx2 === idx) { + idx2 = getRandomIdx() + } + + // Returns a pair of colors + return [colors[idx], colors[idx2]] +} + +const Avatar: FC = ({}) => { + const [bg] = useState(getRandomPairOfColors) + return (
- {/* */} + {/* Add an image - We're generating a gradient as placeholder + */}
) }