Cleanup and update some dependencies

This commit is contained in:
Dane Everitt 2020-12-27 11:18:33 -08:00
parent 7f8ae7a8f9
commit 2463c3f492
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
9 changed files with 80 additions and 171 deletions

View file

@ -1,9 +1,8 @@
import React from 'react';
import React, { useEffect } from 'react';
import ContentContainer from '@/components/elements/ContentContainer';
import { CSSTransition } from 'react-transition-group';
import tw from 'twin.macro';
import FlashMessageRender from '@/components/FlashMessageRender';
import { Helmet } from 'react-helmet';
export interface PageContentBlockProps {
title?: string;
@ -12,14 +11,15 @@ export interface PageContentBlockProps {
}
const PageContentBlock: React.FC<PageContentBlockProps> = ({ title, showFlashKey, className, children }) => {
useEffect(() => {
if (title) {
document.title = title;
}
}, [ title ]);
return (
<CSSTransition timeout={150} classNames={'fade'} appear in>
<>
{title &&
<Helmet>
<title>{title}</title>
</Helmet>
}
<ContentContainer css={tw`my-4 sm:my-10`} className={className}>
{showFlashKey &&
<FlashMessageRender byKey={showFlashKey} css={tw`mb-4`}/>