Skip to content

Commit 227a5ed

Browse files
committed
fixed insta feed
1 parent dd693ee commit 227a5ed

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed

app/archive/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default function ArchivePage() {
7777
<p>View photo albums and program booklets from past MESH events</p>
7878
</div>
7979
<div className="flex flex-row-reverse mr-10 mb-10">
80-
<button onClick={handleSortToggle} class="bg-[#43B697] rounded-lg w-40 p-1 text-xl">
80+
<button onClick={handleSortToggle} className="bg-[#43B697] rounded-lg w-40 p-1 text-xl">
8181
sort by {sortBy === 'asc' ? '↑' : '↓'}
8282
</button>
8383
</div>

app/page.js

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async function getEvents() {
2626

2727
export default async function Home() {
2828
const events = await getEvents();
29-
console.log(events)
29+
// console.log(events)
3030

3131
return (
3232

@@ -105,7 +105,7 @@ export default async function Home() {
105105

106106

107107
{/* Instagram Feed */}
108-
{/* <div className="mb-4 mx-12 sm:mx-24">
108+
<div className="mb-4 mx-12 sm:mx-24">
109109
<div className={fabulous.className}>
110110
<h1 className="text-center text-white text-3xl mt-4 mb-4">Instagram Feed</h1>
111111
</div>
@@ -117,7 +117,7 @@ export default async function Home() {
117117
<a href="https://www.instagram.com/mesh.uw/?hl=en">View Full Feed</a>
118118
</button>
119119
</div>
120-
</div> */}
120+
</div>
121121

122122
<div className="mb-4 mx-24">
123123
<div className={fabulous.className}>
@@ -167,49 +167,49 @@ async function InstagramFeed() {
167167
try {
168168
const url = `https://graph.instagram.com/me/media?fields=id,caption,media_url,media_type,timestamp,permalink&access_token=${process.env.IG_TOKEN}`;
169169
const data = await fetch(url);
170-
console.log("data", data);
170+
// console.log("data", data);
171171
if (!data.ok) {
172172
throw new Error("Failed to fetch Instagram feed");
173173
}
174174
instagramFeed = await data.json();
175-
console.log("Instagram feed:", instagramFeed);
175+
// console.log("Instagram feed:", instagramFeed);
176176
} catch (err) {
177177
console.error("Error fetching Instagram feed:", err.message);
178178
error = err.message;
179179
}
180180

181-
// const feed = (instagramFeed.data.map(post => (
182-
// <div key={post.id} className="flex justify-center items-center w-full h-auto overflow-hidden">
183-
// <div className="aspect-square overflow-hidden border border-solid border-white">
184-
// <Link
185-
// href={post.permalink}
186-
// target="_blank"
187-
// rel="noopener noreferrer"
188-
// className="aspect-content border"
189-
// >
190-
// {post.media_type === "VIDEO" ? (
191-
// <video
192-
// src={post.media_url}
193-
// controls={false}
194-
// className="object-cover "
195-
// />
196-
// ) : (
197-
// <Image
198-
// src={post.media_url}
199-
// alt={post.caption}
200-
// className="object-cover"
201-
// layout="fill"
202-
// />
203-
// )}
204-
// </Link>
205-
// </div>
181+
const feed = (instagramFeed.data.map(post => (
182+
<div key={post.id} className="flex justify-center items-center w-full h-auto overflow-hidden">
183+
<div className="aspect-square overflow-hidden border border-solid border-white">
184+
<Link
185+
href={post.permalink}
186+
target="_blank"
187+
rel="noopener noreferrer"
188+
className="aspect-content border"
189+
>
190+
{post.media_type === "VIDEO" ? (
191+
<video
192+
src={post.media_url}
193+
controls={false}
194+
className="object-cover"
195+
/>
196+
) : (
197+
<Image
198+
src={post.media_url}
199+
alt={post.caption}
200+
className="object-cover"
201+
layout="fill"
202+
/>
203+
)}
204+
</Link>
205+
</div>
206206

207-
// </div>
208-
// ))).slice(0, 6)
207+
</div>
208+
))).slice(0, 6)
209209

210210
return (
211211
<>
212-
{/* {feed} */}
212+
{feed}
213213
</>
214214

215215
);

next.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const nextConfig = {
66
remotePatterns: [
77
{
88
protocol: "https",
9-
hostname: "scontent-sea1-1.cdninstagram.com",
9+
hostname: "*.cdninstagram.com",
1010
pathname: "**",
1111
},
1212
{

0 commit comments

Comments
 (0)