File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import AuthorsLoading from "@/components/Authors/loading";
55import NewsTicker from "@/components/NewsTicker/NewsTicker" ;
66import PageTitle from "@/components/PageTitle" ;
77import Subheading from "@/components/Subheading" ;
8+ import Sidebar from "@/components/Sidebar" ;
89import { Suspense } from "react" ;
910import type { Metadata } from "next" ;
1011import JsonLd from "@/components/JsonLd" ;
@@ -165,7 +166,7 @@ export default async function Home() {
165166 < NewsTicker />
166167 </ Suspense >
167168
168- < LatestPosts initialPosts = { articles } />
169+ < LatestPosts initialPosts = { articles } sidebar = { < Sidebar /> } />
169170
170171 < Subheading className = "text-subheading" url = "/team" linkText = "Full Team" >
171172 Team
Original file line number Diff line number Diff line change 11"use client" ;
22
3- import { useEffect , useState } from "react" ;
3+ import { useEffect , useState , ReactNode } from "react" ;
44import { Timestamp } from "firebase/firestore" ;
5- import Sidebar from "../Sidebar" ;
65import { Separator } from "@radix-ui/react-separator" ;
76import Link from "next/link" ;
87import Loading from "./loading" ;
@@ -42,9 +41,13 @@ const formatDate = (date: string | Timestamp) => {
4241
4342interface LatestPostsProps {
4443 initialPosts : Article [ ] ;
44+ sidebar ?: ReactNode ;
4545}
4646
47- export default function LatestPosts ( { initialPosts } : LatestPostsProps ) {
47+ export default function LatestPosts ( {
48+ initialPosts,
49+ sidebar,
50+ } : LatestPostsProps ) {
4851 // If initialPosts are passed, just use them.
4952 // We can also just render them directly.
5053 // We need to sort them here if they aren't already sorted, but let's assume parent passes sorted.
@@ -162,9 +165,7 @@ export default function LatestPosts({ initialPosts }: LatestPostsProps) {
162165 </ article >
163166 ) ) }
164167 </ div >
165- < div className = "lg:w-1/4" >
166- < Sidebar />
167- </ div >
168+ < div className = "lg:w-1/4" > { sidebar } </ div >
168169 </ div >
169170 </ >
170171 ) ;
You can’t perform that action at this time.
0 commit comments