-
Notifications
You must be signed in to change notification settings - Fork 1
Add video section #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a video section to the site by fetching videos from an external API and rendering them using social media embeds and a fallback to YouTube embeds. Key changes include:
- Creating a new API call (fetchVideos) and a corresponding Videos component to fetch and display videos.
- Introducing a VideosClient component that renders embeds for Facebook, TikTok, Instagram, and YouTube.
- Updating the page and SiteCard components to include the new Videos section within Suspense wrappers for improved user experience.
Reviewed Changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/(map)/sites/[site]/videos.tsx | Adds API fetch function and Videos component integration. |
| app/(map)/sites/[site]/videos.client.tsx | Implements video rendering using various social media embeds. |
| app/(map)/sites/[site]/site.tsx | Adjusts SiteCard layout to include the new videos and updates styling. |
| app/(map)/sites/[site]/page.tsx | Wraps the new Videos component in Suspense alongside Nearby. |
| app/(map)/sites/[site]/nearby.tsx | Minor styling adjustment by removing a top margin. |
Files not reviewed (2)
- app/globals.css: Language not supported
- package.json: Language not supported
| if (!videos || videos.length === 0) return null; | ||
| return ( | ||
| <VideosClient | ||
| videos={videos.sort((a, b) => b.link.localeCompare(a.link))} |
Copilot
AI
Apr 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider sorting videos based on a more meaningful attribute (e.g., publication date or title) rather than using the video link, unless the link-based sorting is intentional. Adding a comment to clarify the reasoning may help future maintainers.
| videos={videos.sort((a, b) => b.link.localeCompare(a.link))} | |
| videos={videos.sort((a, b) => new Date(b.publishedDate).getTime() - new Date(a.publishedDate).getTime())} |
No description provided.