Skip to content

Commit 2c77d70

Browse files
authored
Merge pull request #1 from parthratra11/dev
Footer made dynamic
2 parents 70cb99d + 5ad4a7b commit 2c77d70

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/page.tsx

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use client";
12
import Image from "next/image";
23
import Link from "next/link";
34
import { Button } from "@/components/ui/button";
@@ -14,8 +15,17 @@ import { SocialLinks } from "@/components/SocialLinks";
1415
import { Highlight } from "@/components/ui/hero-hihglight";
1516
import PricingCard from "@/components/LandingComponents/PriceCard";
1617
import Navbar1 from "@/components/navbar";
18+
import { useEffect, useState } from "react";
1719

1820
export default function LandingPage() {
21+
const [currentYear, setCurrentYear] = useState<number>(
22+
new Date().getFullYear()
23+
);
24+
25+
useEffect(() => {
26+
// Set the current year dynamically on mount
27+
setCurrentYear(new Date().getFullYear());
28+
}, []);
1929
return (
2030
<div className="flex flex-col min-h-screen bg-background">
2131
<Navbar1 />
@@ -368,7 +378,7 @@ export default function LandingPage() {
368378
</div>
369379
<div className="flex flex-col md:flex-row justify-between items-center pt-8 border-t border-border">
370380
<p className="text-sm text-muted-foreground mb-4 md:mb-0">
371-
© 2023 LeetCode Journal. All rights reserved.
381+
© {currentYear} LeetCode Journal. All rights reserved.
372382
</p>
373383
</div>
374384
</div>

0 commit comments

Comments
 (0)