[ABANDONED] React/Redux front end for the Flexor social network.
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.
 
 

36 lines
843 B

import React, { FC, useEffect } from 'react'
import { RouteComponentProps } from 'react-router-dom'
import { setTitle } from 'src/utils'
import { Entity } from 'src/types'
import PageHeader from 'src/components/page-header'
interface Props extends RouteComponentProps {
authenticated: boolean
user?: Entity
}
const Self: FC<Props> = ({ authenticated, user, history }) => {
useEffect(() => {
if (!authenticated) history.push('/login')
}, [authenticated])
useEffect(() => {
if (user) setTitle(user.name as string)
}, [user])
return (
<div>
<PageHeader title={user ? user.name as string : '?'} />
<div className="main-content">
<p>
Hello.
</p>
</div>
</div>
)
}
export default Self