[offers][fix] add loading and fix ci (#554)

* [offers][fix] add check for loading

* [offers][fix] remove navbar
pull/556/head
Zhang Ziqing 2 years ago committed by GitHub
parent 8e53e8dd4d
commit 0e02e23015
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -157,9 +157,10 @@ export default function AppShell({ children }: Props) {
if (session == null) {
return OffersNavigation;
}
return !isOffersAdminResultsLoading && isOffersAdmin
? OffersNavigationAdmin
: OffersNavigationAuthenticated;
if (!isOffersAdminResultsLoading && isOffersAdmin) {
return OffersNavigationAdmin;
}
return OffersNavigationAuthenticated;
}
if (path.startsWith('/questions')) {

@ -4,7 +4,7 @@ import Link from 'next/link';
import { useRouter } from 'next/router';
import { useState } from 'react';
import { MapPinIcon } from '@heroicons/react/24/outline';
import { Banner } from '@tih/ui';
import { Banner, Spinner } from '@tih/ui';
import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics';
import OffersTable from '~/components/offers/admin/OffersTable';
@ -52,8 +52,11 @@ export default function OffersHomePage({
if (!isLoading && !isAuthorized) {
router.push('/offers');
}
return (
isAuthorized && (
return isLoading ? (
<div className="flex justify-center py-32">
<Spinner display="block" size="lg" />
</div>
) : (
<>
<Head>
<title>Admin Home - Tech Offers Repo</title>
@ -173,6 +176,5 @@ export default function OffersHomePage({
</Container>
</main>
</>
)
);
}

Loading…
Cancel
Save