Skip to content

Commit

Permalink
Add dynamic copyright to footer (#2)
Browse files Browse the repository at this point in the history
Adds a dynamic copyright to the footer using a call to JavaScript’s Date object for the current year. This ensures that the copyright is updated with no manual intervention necessary.

Modified: Footer.tsx

---------

Co-authored-by: Tim Baker <tbakerx@gmail.com>
  • Loading branch information
ggfevans and tbakerx committed Nov 25, 2023
1 parent 0058ed3 commit d6e52cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Sections/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {FC, memo} from 'react';
import {SectionId} from '../../data/data';
import Socials from '../Socials';

const currentYear = new Date().getFullYear();

const Footer: FC = memo(() => (
<div className="relative bg-neutral-900 px-4 pb-6 pt-12 sm:px-8 sm:pb-8 sm:pt-14">
<div className="absolute inset-x-0 -top-4 flex justify-center sm:-top-6">
Expand All @@ -26,7 +28,7 @@ const Footer: FC = memo(() => (
<span className="italic text-yellow">Resume</span>
</span>
</a>
<span className="text-sm text-neutral-700">© Copyright 2022 Tim Baker</span>
<span className="text-sm text-neutral-700">© Copyright {currentYear} Tim Baker</span>
</div>
</div>
));
Expand Down

0 comments on commit d6e52cd

Please sign in to comment.