Remplacement du Loader par WithLoader

This commit is contained in:
2020-07-22 09:18:50 +02:00
parent c4373cce46
commit bc9aa1721a
9 changed files with 62 additions and 67 deletions

View File

@ -2,23 +2,18 @@ import React from 'react';
import { Page } from '../Page';
import { Dashboard } from './Dashboard';
import { useUserProfileQuery } from '../../gql/queries/profile';
import { Loader } from '../Loader';
import { WithLoader } from '../WithLoader';
export function HomePage() {
const { data, loading } = useUserProfileQuery();
if (loading) {
return (
<Loader />
);
}
const { userProfile } = (data || {});
return (
<Page title={userProfile ? 'Tableau de bord' : 'Accueil'}>
<div className="container is-fluid">
<section className="section">
<WithLoader loading={loading}>
{
userProfile ?
<Dashboard /> :
@ -30,6 +25,7 @@ export function HomePage() {
</div>
</div>
}
</WithLoader>
</section>
</div>
</Page>