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.
42 lines
1.3 KiB
42 lines
1.3 KiB
import React, { FC } from 'react'
|
|
import { Link } from 'react-router-dom'
|
|
|
|
import { User } from 'src/types'
|
|
|
|
import './user-info.scss'
|
|
|
|
interface Props {
|
|
authenticated: boolean
|
|
user?: User
|
|
}
|
|
|
|
const UserInfo: FC<Props> = ({ authenticated, user }) => {
|
|
const hasAvatar = authenticated && user && user.imageUrl
|
|
const imageUrl = hasAvatar ? user!.imageUrl : undefined
|
|
|
|
return (
|
|
<article id="user-info" className="media has-background-black">
|
|
{hasAvatar &&
|
|
<figure className="media-left">
|
|
<p className="image is-64x64">
|
|
<img src={imageUrl} />
|
|
</p>
|
|
</figure>
|
|
}
|
|
|
|
<div className="media-content">
|
|
<div className="content">
|
|
<div className="has-text-centered">
|
|
<Link to="/login" className="is-size-5 has-text-white">Log In to Flexor</Link>
|
|
<p className="is-size-7 has-text-primary is-uppercase">
|
|
or
|
|
</p>
|
|
<Link to="/communities" className="is-size-6 has-text-light">Create an Account</Link>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
)
|
|
}
|
|
|
|
export default UserInfo
|