feat(web): activity indicator while loading

This commit is contained in:
Paul Armstrong
2021-01-30 08:52:37 -08:00
committed by Blake Blackshear
parent cc7929932b
commit 45526a7652
8 changed files with 65 additions and 19 deletions

View File

@@ -1,21 +1,17 @@
import { h, Fragment } from 'preact';
import ActivityIndicator from './components/ActivityIndicator';
import Box from './components/Box';
import Heading from './components/Heading';
import Link from './components/Link';
import { FetchStatus, useApiHost, useEvent } from './api';
import { Table, Thead, Tbody, Tfoot, Th, Tr, Td } from './components/Table';
import { useApiHost, useEvent } from './api';
export default function Event({ eventId }) {
const apiHost = useApiHost();
const { data } = useEvent(eventId);
const { data, status } = useEvent(eventId);
if (!data) {
return (
<div>
<Heading>{eventId}</Heading>
<p>loading</p>
</div>
);
if (status !== FetchStatus.LOADED) {
return <ActivityIndicator />;
}
const startime = new Date(data.start_time * 1000);