@@ -50,10 +50,7 @@ export default async function ProjectLayout({
5050 notFound ( ) ;
5151 }
5252
53- const githubLink = project . links . find ( ( link ) => link . type === "GITHUB" ) ! ;
54- const websiteLink = project . links . find ( ( link ) => link . type === "WEBSITE" ) ;
55-
56- const { stars } = await getRepo ( githubLink . url ) ;
53+ const { stars } = await getRepo ( project . githubLink . url ) ;
5754
5855 if ( stars !== project . stars ) {
5956 await prisma . project . update ( {
@@ -67,13 +64,7 @@ export default async function ProjectLayout({
6764 }
6865
6966 return (
70- < ProjectProvider
71- props = { {
72- ...project ,
73- githubLink,
74- websiteLink,
75- } }
76- >
67+ < ProjectProvider props = { project } >
7768 < div className = "aspect-[4/1] w-full rounded-t-2xl bg-gradient-to-tr from-purple-100 via-violet-50 to-blue-100" />
7869 < div className = "-mt-8 flex items-center justify-between px-4 sm:-mt-12 sm:items-end md:pr-0" >
7970 < Image
@@ -88,16 +79,16 @@ export default async function ProjectLayout({
8879 < EditProjectButton projectId = { project . id } />
8980 </ Suspense >
9081 < a
91- href = { githubLink . shortLink }
82+ href = { project . githubLink . shortLink }
9283 target = "_blank"
9384 className = { buttonLinkVariants ( { variant : "secondary" } ) }
9485 >
9586 < Star className = "h-4 w-4" />
9687 < p className = "text-sm" > { nFormatter ( stars , { full : true } ) } </ p >
9788 </ a >
98- { websiteLink && (
89+ { project . websiteLink && (
9990 < a
100- href = { websiteLink . shortLink }
91+ href = { project . websiteLink . shortLink }
10192 target = "_blank"
10293 className = { buttonLinkVariants ( ) }
10394 >
@@ -107,14 +98,16 @@ export default async function ProjectLayout({
10798 ) }
10899 </ div >
109100 </ div >
110- < div className = "max-w-lg p-4" >
101+ < div className = "max-w-lg p-4 pb-0 " >
111102 < div className = "flex items-center space-x-2" >
112103 < h1 className = "font-display text-3xl font-bold" > { project . name } </ h1 >
113104 { project . verified && (
114105 < BadgeCheck className = "h-8 w-8 text-white" fill = "#1c9bef" />
115106 ) }
116107 </ div >
117108 < p className = "mt-2 text-gray-500" > { project . description } </ p >
109+ </ div >
110+ < div className = "px-4" >
118111 < ProjectLayoutTabs />
119112 { children }
120113 </ div >
0 commit comments