From c0dd5cf6aed9acb4bdf011a5b7862e8c4e756ef3 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Tue, 18 Feb 2020 14:26:09 +0300 Subject: [PATCH] move footer props to config --- src/components/App/AppFooter.tsx | 20 ++++++++++++ src/components/App/index.tsx | 52 +++++++++++++++++--------------- src/config.ts | 5 +++ src/context/ConfigContext.ts | 4 +++ 4 files changed, 56 insertions(+), 25 deletions(-) create mode 100644 src/components/App/AppFooter.tsx create mode 100644 src/config.ts create mode 100644 src/context/ConfigContext.ts diff --git a/src/components/App/AppFooter.tsx b/src/components/App/AppFooter.tsx new file mode 100644 index 00000000..ef9eeeae --- /dev/null +++ b/src/components/App/AppFooter.tsx @@ -0,0 +1,20 @@ +import { Footer } from '../Footer' +import { useContext } from 'react' +import { ConfigContext } from 'src/context/ConfigContext' + +export type AppFooterProps = { + showAuthor: boolean +} + +export const AppFooter: React.FC = props => { + const config = useContext(ConfigContext) + + return ( +