Merge version_2 into main #2
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||
import ReactLenis from "lenis/react";
|
||||
import BlogCardOne from '@/components/sections/blog/BlogCardOne';
|
||||
@@ -15,6 +16,23 @@ import TestimonialCardSixteen from '@/components/sections/testimonial/Testimonia
|
||||
import { Award, Clock, Zap } from "lucide-react";
|
||||
|
||||
export default function LandingPage() {
|
||||
const [liveScores, setLiveScores] = useState<any[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchScores = async () => {
|
||||
try {
|
||||
const response = await fetch("https://api.the-sports-data.com/v1/scores?league=mlb,nfl,nba,nhl&team_region=new-york");
|
||||
const data = await response.json();
|
||||
setLiveScores(data.scores || []);
|
||||
} catch (error) {
|
||||
console.error("Error fetching scores:", error);
|
||||
}
|
||||
};
|
||||
fetchScores();
|
||||
const interval = setInterval(fetchScores, 30000);
|
||||
return () => clearInterval(interval);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<ThemeProvider
|
||||
defaultButtonVariant="bounce-effect"
|
||||
@@ -61,13 +79,6 @@ export default function LandingPage() {
|
||||
{ imageSrc: "http://img.b2bpic.net/free-photo/funfair-top-night-with-green-blue-lights_23-2148281654.jpg", imageAlt: "sports stadium lighting" },
|
||||
]}
|
||||
buttons={[{ text: "View Live Scores", href: "#scores" }]}
|
||||
avatars={[
|
||||
{ src: "http://img.b2bpic.net/free-photo/gymnast-getting-ready-competition_23-2150867974.jpg", alt: "Gymnast getting ready" },
|
||||
{ src: "http://img.b2bpic.net/free-photo/figure-skating-ice-arena_654080-1989.jpg", alt: "Figure skating" },
|
||||
{ src: "http://img.b2bpic.net/free-photo/gymnastic-stage-getting-ready-competition_23-2150867990.jpg", alt: "Gymnastic stage" },
|
||||
{ src: "http://img.b2bpic.net/free-photo/gymnast-getting-ready-competition_23-2150867771.jpg", alt: "Gymnast" },
|
||||
{ src: "http://img.b2bpic.net/free-photo/female-gymnast-doing-complicated-trick-gymnastics-balance-beam-professional-arena_654080-2004.jpg", alt: "Gymnast trick" },
|
||||
]}
|
||||
avatarText="Join 10k+ local fans"
|
||||
marqueeItems={[{ type: "text", text: "Yankees" }, { type: "text", text: "Mets" }, { type: "text", text: "Knicks" }, { type: "text", text: "Giants" }, { type: "text", text: "Rangers" }]}
|
||||
/>
|
||||
@@ -79,7 +90,7 @@ export default function LandingPage() {
|
||||
textboxLayout="split"
|
||||
useInvertedBackground={false}
|
||||
features={[
|
||||
{ id: "f1", title: "Live Scoreboard", description: "Auto-refreshing scores every 30 seconds for the most accurate updates.", tag: "Live", imageSrc: "http://img.b2bpic.net/free-photo/soccer-fans-cheering-their-team_23-2151536148.jpg" },
|
||||
{ id: "f1", title: "Live Scoreboard", description: liveScores.length > 0 ? "Latest scores retrieved successfully." : "Loading live scores...", tag: "Live", imageSrc: "http://img.b2bpic.net/free-photo/soccer-fans-cheering-their-team_23-2151536148.jpg" },
|
||||
{ id: "f2", title: "Multi-League Support", description: "Seamless tracking across MLB, NFL, NBA, and NHL.", tag: "Coverage", imageSrc: "http://img.b2bpic.net/free-photo/view-composition-with-neatly-arranged-organized-sport-items_23-2150275220.jpg" },
|
||||
{ id: "f3", title: "Breaking News", description: "The latest updates and trade rumors directly from NYC sports media.", tag: "Updates", imageSrc: "http://img.b2bpic.net/free-photo/physical-activity-stats-around-person_23-2150163381.jpg" },
|
||||
]}
|
||||
@@ -203,4 +214,4 @@ export default function LandingPage() {
|
||||
</ReactLenis>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user