You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
43 lines
1.2 KiB
import React, { FC } from 'react'
|
|
import { Link } from 'react-router-dom'
|
|
|
|
import { User } from '../../types'
|
|
|
|
import './user-info.scss'
|
|
|
|
interface Props {
|
|
authenticated: boolean
|
|
user?: User
|
|
}
|
|
|
|
const UserInfo: FC<Props> = ({ authenticated, user }) => {
|
|
const getAvatar = () => {
|
|
if (authenticated && user && user.imageUrl) {
|
|
return <img src={user.imageUrl} />
|
|
}
|
|
|
|
return <div className="empty-image"></div>
|
|
}
|
|
|
|
return (
|
|
<article id="user-info" className="media has-background-black">
|
|
<figure className="media-left">
|
|
<p className="image is-64x64">
|
|
{getAvatar()}
|
|
</p>
|
|
</figure>
|
|
|
|
<div className="media-content">
|
|
<div className="content">
|
|
<p>
|
|
<Link to="/login" className="is-size-5 has-text-white has-text-weight-bold">Log In</Link>
|
|
<br />
|
|
<Link to="/communities" className="is-size-7 has-text-primary">Sign Up</Link>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
)
|
|
}
|
|
|
|
export default UserInfo
|