Fix rendering when trying to access server from state

This commit is contained in:
Dane Everitt 2020-08-22 19:05:43 -07:00
parent 813a671571
commit 56475d89bb
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 29 additions and 14 deletions

View file

@ -1,10 +1,8 @@
import React, { useEffect, useState } from 'react';
import { Helmet } from 'react-helmet';
import tw from 'twin.macro';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faNetworkWired } from '@fortawesome/free-solid-svg-icons';
import styled from 'styled-components/macro';
import PageContentBlock from '@/components/elements/PageContentBlock';
import GreyRowBox from '@/components/elements/GreyRowBox';
import Button from '@/components/elements/Button';
import Can from '@/components/elements/Can';
@ -19,6 +17,7 @@ import { Textarea } from '@/components/elements/Input';
import setServerAllocationNotes from '@/api/server/network/setServerAllocationNotes';
import { debounce } from 'debounce';
import InputSpinner from '@/components/elements/InputSpinner';
import ServerContentBlock from '@/components/elements/ServerContentBlock';
const Code = styled.code`${tw`font-mono py-1 px-2 bg-neutral-900 rounded text-sm block`}`;
const Label = styled.label`${tw`uppercase text-xs mt-1 text-neutral-400 block px-1 select-none transition-colors duration-150`}`;
@ -61,7 +60,7 @@ const NetworkContainer = () => {
}, [ error ]);
return (
<PageContentBlock showFlashKey={'server:network'} title={'Network'}>
<ServerContentBlock showFlashKey={'server:network'} title={'Network'}>
{!data ?
<Spinner size={'large'} centered/>
:
@ -109,7 +108,7 @@ const NetworkContainer = () => {
</GreyRowBox>
))
}
</PageContentBlock>
</ServerContentBlock>
);
};