Remplacement du Loader par WithLoader
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user