From 35c009b9e33a94009e43ee261a14037aec4cac10 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 31 Aug 2018 14:45:14 +0300 Subject: layout refresh --- vnext/src/components/UserInfo.js | 85 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create 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 new file mode 100644 index 00000000..147bb6f8 --- /dev/null +++ b/vnext/src/components/UserInfo.js @@ -0,0 +1,85 @@ +import React from 'react'; + +import { Link } from 'react-router-dom'; + +import { info } from '../api'; + +import Avatar from './Avatar'; +import Icon from './Icon'; +import SearchBox from './SearchBox'; + +export default class UserInfo extends React.Component { + constructor(props) { + super(props); + this.state = { + user: { uname: props.user, uid: 0 } + }; + } + componentDidMount() { + info(this.state.user.uname).then(response => { + this.setState({ + user: response.data[0] + }); + }); + } + render() { + const { user } = this.state; + return ( +