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,29 +1,39 @@
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 }) => (
// <CSSTransition timeout={150} classNames={'fade'} appear in>
<>
{showFlashKey &&
<FlashMessageRender byKey={showFlashKey} css={tw`mb-4`}/>
const AdminContentBlock: React.FC<{ title?: string; showFlashKey?: string; className?: string }> = ({ children, title, showFlashKey }) => {
useEffect(() => {
if (!title) {
return;
}
{children}
{/* <p css={tw`text-center text-neutral-500 text-xs mt-4`}>
&copy; 2015 - 2021&nbsp;
<a
rel={'noopener nofollow noreferrer'}
href={'https://pterodactyl.io'}
target={'_blank'}
css={tw`no-underline text-neutral-500 hover:text-neutral-300`}
>
Pterodactyl Software
</a>
</p> */}
</>
// </CSSTransition>
);
document.title = `Admin | ${title}`;
}, [ title ]);
export default PageContentBlock;
return (
// <CSSTransition timeout={150} classNames={'fade'} appear in>
<>
{showFlashKey &&
<FlashMessageRender byKey={showFlashKey} css={tw`mb-4`}/>
}
{children}
{/* <p css={tw`text-center text-neutral-500 text-xs mt-4`}>
&copy; 2015 - 2021&nbsp;
<a
rel={'noopener nofollow noreferrer'}
href={'https://pterodactyl.io'}
target={'_blank'}
css={tw`no-underline text-neutral-500 hover:text-neutral-300`}
>
Pterodactyl Software
</a>
</p> */}
</>
// </CSSTransition>
);
};
export default AdminContentBlock;