forked from crowetic/commerce
Adding gradient on the clientside
This commit is contained in:
parent
a6ad6daa6f
commit
b1c476f3e4
@ -1,12 +1,5 @@
|
|||||||
import cn from 'classnames'
|
import cn from 'classnames'
|
||||||
import {
|
import { FC, useState, useMemo, useRef, useEffect } from 'react'
|
||||||
FC,
|
|
||||||
useState,
|
|
||||||
useMemo,
|
|
||||||
useRef,
|
|
||||||
useEffect,
|
|
||||||
HTMLInputElement,
|
|
||||||
} from 'react'
|
|
||||||
import { getRandomPairOfColors } from '@lib/colors'
|
import { getRandomPairOfColors } from '@lib/colors'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@ -16,7 +9,7 @@ interface Props {
|
|||||||
|
|
||||||
const Avatar: FC<Props> = ({}) => {
|
const Avatar: FC<Props> = ({}) => {
|
||||||
const [bg] = useState(useMemo(() => getRandomPairOfColors, []))
|
const [bg] = useState(useMemo(() => getRandomPairOfColors, []))
|
||||||
const ref = useRef(null) as React.MutableRefObject<HTMLInputElement>
|
let ref = useRef() as React.MutableRefObject<HTMLInputElement>
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (ref && ref.current) {
|
if (ref && ref.current) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user