2020-12-27 11:18:33 -08:00
|
|
|
import React, { useEffect } from 'react';
|
2020-04-17 11:07:32 -07:00
|
|
|
import ContentContainer from '@/components/elements/ContentContainer';
|
|
|
|
import { CSSTransition } from 'react-transition-group';
|
2020-07-03 14:50:37 -07:00
|
|
|
import tw from 'twin.macro';
|
2020-07-09 19:56:46 -07:00
|
|
|
import FlashMessageRender from '@/components/FlashMessageRender';
|
2020-04-17 11:07:32 -07:00
|
|
|
|
2020-08-22 19:05:43 -07:00
|
|
|
export interface PageContentBlockProps {
|
2020-08-22 15:43:28 -07:00
|
|
|
title?: string;
|
|
|
|
className?: string;
|
|
|
|
showFlashKey?: string;
|
|
|
|
}
|
|
|
|
|
2020-08-22 19:05:43 -07:00
|
|
|
const PageContentBlock: React.FC<PageContentBlockProps> = ({ title, showFlashKey, className, children }) => {
|
2020-12-27 11:18:33 -08:00
|
|
|
useEffect(() => {
|
|
|
|
if (title) {
|
|
|
|
document.title = title;
|
|
|
|
}
|
|
|
|
}, [ title ]);
|
|
|
|
|
2020-08-22 15:43:28 -07:00
|
|
|
return (
|
|
|
|
<CSSTransition timeout={150} classNames={'fade'} appear in>
|
|
|
|
<>
|
2020-09-13 10:49:57 -07:00
|
|
|
<ContentContainer css={tw`my-4 sm:my-10`} className={className}>
|
2020-08-22 15:43:28 -07:00
|
|
|
{showFlashKey &&
|
|
|
|
<FlashMessageRender byKey={showFlashKey} css={tw`mb-4`}/>
|
|
|
|
}
|
|
|
|
{children}
|
|
|
|
</ContentContainer>
|
|
|
|
<ContentContainer css={tw`mb-4`}>
|
|
|
|
<p css={tw`text-center text-neutral-500 text-xs`}>
|
|
|
|
© 2015 - 2020
|
|
|
|
<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>
|
|
|
|
</ContentContainer>
|
|
|
|
</>
|
|
|
|
</CSSTransition>
|
|
|
|
);
|
|
|
|
};
|
2020-07-04 09:28:03 -07:00
|
|
|
|
|
|
|
export default PageContentBlock;
|