Copyright component extraction
This commit is contained in:
1 parent
c0dd5cf6ae
commit
5b19a6a359
4 files changed
+18
-11
No files matched your search
@@ -0,0 +1,10 @@
|
||||
import { useContext } from 'react'
|
||||
import { ConfigContext } from 'src/context/ConfigContext'
|
||||
|
||||
export const Copyright: React.FC = () => {
|
||||
const { yearStart, yearEnd } = useContext(ConfigContext)
|
||||
|
||||
return (
|
||||
<span>© {yearStart}—{yearEnd} Шлиссельбургская детская художественная школа</span>
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as React from 'react'
|
||||
import { Copyright } from '../Copyright'
|
||||
|
||||
const mailto = email => `mailto:${email}`
|
||||
const currentYear = () => (new Date()).getFullYear()
|
||||
|
||||
export interface IFooterProps {
|
||||
address: string
|
||||
@@ -24,10 +23,7 @@ export const Footer: React.FC<IFooterProps> = props => (
|
||||
</div>
|
||||
|
||||
<div className="copyright">
|
||||
<Copyright
|
||||
yearStart={2012}
|
||||
yearEnd={currentYear()}
|
||||
/>
|
||||
<Copyright />
|
||||
{!props.showAuthor ? null : (
|
||||
<Author />
|
||||
)}
|
||||
@@ -43,7 +39,3 @@ const Author = () => (
|
||||
</a>
|
||||
</span>
|
||||
)
|
||||
|
||||
const Copyright = ({ yearStart, yearEnd }) => (
|
||||
<span>© {yearStart}—{yearEnd} Шлиссельбургская детская художественная школа</span>
|
||||
)
|
||||
Reference in new issue
Block a user