From f470636a70943a8ecad8bddc791a1c2dddd28e1e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 4 May 2019 21:13:12 +0300 Subject: Components -> UI --- vnext/src/components/UserInfo.js | 117 --------------------------------------- 1 file changed, 117 deletions(-) delete mode 100644 vnext/src/components/UserInfo.js (limited to 'vnext/src/components/UserInfo.js') diff --git a/vnext/src/components/UserInfo.js b/vnext/src/components/UserInfo.js deleted file mode 100644 index 7d84488e..00000000 --- a/vnext/src/components/UserInfo.js +++ /dev/null @@ -1,117 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import PropTypes from 'prop-types'; -import { Link } from 'react-router-dom'; - -import { UserType } from './Types'; - -import { info, fetchUserUri } from '../api'; - -import Avatar from './Avatar'; -import Icon from './Icon'; -import SearchBox from './SearchBox'; - -import './UserInfo.css'; - -let isMounted; - -export default function UserInfo(props) { - const [user, setUser] = useState({ uname: props.user, uid: 0 }); - const { onUpdate } = props; - useEffect(() => { - isMounted = true; - if (!user.avatar) { - info(user.uname).then(response => { - if (isMounted) { - setUser(response.data); - onUpdate && onUpdate(response.data); - } - }); - } - return () => { - isMounted = false; - }; - }, [onUpdate, user, user.avatar]); - return ( - <> -