admin(ui): add document titles

This commit is contained in:
Matthew Penner 2021-01-07 09:44:24 -07:00
parent 946f907b68
commit 56c098a316
12 changed files with 43 additions and 33 deletions

View file

@ -1,9 +1,18 @@
import React from 'react';
import React, { useEffect } from 'react';
// import { CSSTransition } from 'react-transition-group';
import tw from 'twin.macro';
import FlashMessageRender from '@/components/FlashMessageRender';
const PageContentBlock: React.FC<{ showFlashKey?: string; className?: string }> = ({ children, showFlashKey }) => (
const AdminContentBlock: React.FC<{ title?: string; showFlashKey?: string; className?: string }> = ({ children, title, showFlashKey }) => {
useEffect(() => {
if (!title) {
return;
}
document.title = `Admin | ${title}`;
}, [ title ]);
return (
// <CSSTransition timeout={150} classNames={'fade'} appear in>
<>
{showFlashKey &&
@ -24,6 +33,7 @@ const PageContentBlock: React.FC<{ showFlashKey?: string; className?: string }>
</p> */}
</>
// </CSSTransition>
);
);
};
export default PageContentBlock;
export default AdminContentBlock;

View file

@ -5,7 +5,7 @@ import NewApiKeyButton from '@/components/admin/api/NewApiKeyButton';
export default () => {
return (
<AdminContentBlock>
<AdminContentBlock title={'API Keys'}>
<div css={tw`w-full flex flex-row items-center mb-8`}>
<div css={tw`flex flex-col`}>
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>API Keys</h2>

View file

@ -61,7 +61,7 @@ const DatabasesContainer = () => {
}, [ page ]);
return (
<AdminContentBlock>
<AdminContentBlock title={'Databases'}>
<div css={tw`w-full flex flex-row items-center mb-8`}>
<div css={tw`flex flex-col`}>
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Database Hosts</h2>

View file

@ -61,7 +61,7 @@ const LocationsContainer = () => {
}, [ page ]);
return (
<AdminContentBlock>
<AdminContentBlock title={'Locations'}>
<div css={tw`w-full flex flex-row items-center mb-8`}>
<div css={tw`flex flex-col`}>
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Locations</h2>

View file

@ -61,7 +61,7 @@ const MountsContainer = () => {
}, [ page ]);
return (
<AdminContentBlock>
<AdminContentBlock title={'Mounts'}>
<div css={tw`w-full flex flex-row items-center mb-8`}>
<div css={tw`flex flex-col`}>
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Mounts</h2>

View file

@ -61,7 +61,7 @@ const NestsContainer = () => {
}, [ page ]);
return (
<AdminContentBlock>
<AdminContentBlock title={'Nests'}>
<div css={tw`w-full flex flex-row items-center mb-8`}>
<div css={tw`flex flex-col`}>
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Nests</h2>

View file

@ -62,7 +62,7 @@ const NodesContainer = () => {
}, [ page ]);
return (
<AdminContentBlock>
<AdminContentBlock title={'Nodes'}>
<div css={tw`w-full flex flex-row items-center mb-8`}>
<div css={tw`flex flex-col`}>
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Nodes</h2>

View file

@ -32,7 +32,7 @@ export default () => {
}, []);
return (
<AdminContentBlock>
<AdminContentBlock title={'Overview'}>
<div css={tw`flex flex-col mb-8`}>
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Overview</h2>
<p css={tw`text-base text-neutral-400`}>A quick glance at your system.</p>

View file

@ -62,7 +62,7 @@ export default () => {
};
return (
<AdminContentBlock>
<AdminContentBlock title={'Roles'}>
<div css={tw`w-full flex flex-row items-center mb-8`}>
<div css={tw`flex flex-col`}>
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Roles</h2>

View file

@ -61,7 +61,7 @@ const UsersContainer = () => {
}, [ page ]);
return (
<AdminContentBlock>
<AdminContentBlock title={'Servers'}>
<div css={tw`w-full flex flex-row items-center mb-8`}>
<div css={tw`flex flex-col`}>
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Servers</h2>

View file

@ -4,7 +4,7 @@ import AdminContentBlock from '@/components/admin/AdminContentBlock';
export default () => {
return (
<AdminContentBlock>
<AdminContentBlock title={'Settings'}>
<div>
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Settings</h2>
<p css={tw`text-base text-neutral-400`}>Configure and manage settings for Pterodactyl.</p>

View file

@ -61,7 +61,7 @@ const UsersContainer = () => {
}, [ page ]);
return (
<AdminContentBlock>
<AdminContentBlock title={'Users'}>
<div css={tw`w-full flex flex-row items-center mb-8`}>
<div css={tw`flex flex-col`}>
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Users</h2>