daddy/client/src/components/HomePage/HomePage.tsx

28 lines
923 B
TypeScript
Raw Normal View History

import React, { useEffect } from 'react';
2020-06-15 18:10:06 +02:00
import { Page } from '../Page';
import { useSelector, useDispatch } from 'react-redux';
import { RootState } from '../../store/reducers/root';
2020-06-15 18:10:06 +02:00
export function HomePage() {
const currentUser = useSelector((state: RootState) => state.auth.currentUser);
2020-06-15 18:10:06 +02:00
return (
2020-07-16 20:21:58 +02:00
<Page title="Accueil">
2020-06-15 18:10:06 +02:00
<div className="container is-fluid">
<section className="section">
<div className="columns">
<div className="column is-4 is-offset-4">
<div className="box">
{
currentUser && currentUser.email ?
2020-07-16 20:21:58 +02:00
<p>Bonjour <span className="has-text-weight-bold">{currentUser.name ? currentUser.name : currentUser.email}</span> !</p> :
<p>Veuillez vous authentifier.</p>
}
</div>
</div>
</div>
</section>
2020-06-15 18:10:06 +02:00
</div>
</Page>
);
}