Attempt 2?

80% sure this isn't how to use react-helmet.... but it works....
This commit is contained in:
Charles Morgan 2020-07-26 23:32:24 -04:00
parent 4a27e56e08
commit 6d79ad23a5
No known key found for this signature in database
GPG key ID: D71946CD723249BD
10 changed files with 59 additions and 1 deletions

View file

@ -1,4 +1,6 @@
import React, { useEffect, useState } from 'react';
import { Helmet } from 'react-helmet';
import { ServerContext } from '@/state/server';
import tw from 'twin.macro';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faNetworkWired } from '@fortawesome/free-solid-svg-icons';
@ -28,6 +30,8 @@ const NetworkContainer = () => {
const [ loading, setLoading ] = useState<false | number>(false);
const { data, error, mutate } = useSWR<Allocation[]>(uuid, key => getServerAllocations(key), { initialData: allocations });
const servername = ServerContext.useStoreState(state => state.server.data.name);
const setPrimaryAllocation = (id: number) => {
clearFlashes('server:network');
@ -61,6 +65,9 @@ const NetworkContainer = () => {
return (
<PageContentBlock showFlashKey={'server:network'}>
<Helmet>
<title> {servername} | Network </title>
</Helmet>
{!data ?
<Spinner size={'large'} centered/>
: