Attempt 2?
80% sure this isn't how to use react-helmet.... but it works....
This commit is contained in:
parent
4a27e56e08
commit
6d79ad23a5
10 changed files with 59 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import getServerSchedules from '@/api/server/schedules/getServerSchedules';
|
||||
import { ServerContext } from '@/state/server';
|
||||
import Spinner from '@/components/elements/Spinner';
|
||||
|
@ -22,6 +23,7 @@ export default ({ match, history }: RouteComponentProps) => {
|
|||
const [ visible, setVisible ] = useState(false);
|
||||
|
||||
const schedules = ServerContext.useStoreState(state => state.schedules.data);
|
||||
const servername = ServerContext.useStoreState(state => state.server.data.name);
|
||||
const setSchedules = ServerContext.useStoreActions(actions => actions.schedules.setSchedules);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -37,6 +39,9 @@ export default ({ match, history }: RouteComponentProps) => {
|
|||
|
||||
return (
|
||||
<PageContentBlock>
|
||||
<Helmet>
|
||||
<title> {servername} | Schedules </title>
|
||||
</Helmet>
|
||||
<FlashMessageRender byKey={'schedules'} css={tw`mb-4`}/>
|
||||
{(!schedules.length && loading) ?
|
||||
<Spinner size={'large'} centered/>
|
||||
|
|
Reference in a new issue