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,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/>
|
||||
:
|
||||
|
|
Reference in a new issue