@@ -50,10 +50,7 @@ export default async function ProjectLayout({
50
50
notFound ( ) ;
51
51
}
52
52
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 ) ;
57
54
58
55
if ( stars !== project . stars ) {
59
56
await prisma . project . update ( {
@@ -67,13 +64,7 @@ export default async function ProjectLayout({
67
64
}
68
65
69
66
return (
70
- < ProjectProvider
71
- props = { {
72
- ...project ,
73
- githubLink,
74
- websiteLink,
75
- } }
76
- >
67
+ < ProjectProvider props = { project } >
77
68
< div className = "aspect-[4/1] w-full rounded-t-2xl bg-gradient-to-tr from-purple-100 via-violet-50 to-blue-100" />
78
69
< div className = "-mt-8 flex items-center justify-between px-4 sm:-mt-12 sm:items-end md:pr-0" >
79
70
< Image
@@ -88,16 +79,16 @@ export default async function ProjectLayout({
88
79
< EditProjectButton projectId = { project . id } />
89
80
</ Suspense >
90
81
< a
91
- href = { githubLink . shortLink }
82
+ href = { project . githubLink . shortLink }
92
83
target = "_blank"
93
84
className = { buttonLinkVariants ( { variant : "secondary" } ) }
94
85
>
95
86
< Star className = "h-4 w-4" />
96
87
< p className = "text-sm" > { nFormatter ( stars , { full : true } ) } </ p >
97
88
</ a >
98
- { websiteLink && (
89
+ { project . websiteLink && (
99
90
< a
100
- href = { websiteLink . shortLink }
91
+ href = { project . websiteLink . shortLink }
101
92
target = "_blank"
102
93
className = { buttonLinkVariants ( ) }
103
94
>
@@ -107,14 +98,16 @@ export default async function ProjectLayout({
107
98
) }
108
99
</ div >
109
100
</ div >
110
- < div className = "max-w-lg p-4" >
101
+ < div className = "max-w-lg p-4 pb-0 " >
111
102
< div className = "flex items-center space-x-2" >
112
103
< h1 className = "font-display text-3xl font-bold" > { project . name } </ h1 >
113
104
{ project . verified && (
114
105
< BadgeCheck className = "h-8 w-8 text-white" fill = "#1c9bef" />
115
106
) }
116
107
</ div >
117
108
< p className = "mt-2 text-gray-500" > { project . description } </ p >
109
+ </ div >
110
+ < div className = "px-4" >
118
111
< ProjectLayoutTabs />
119
112
{ children }
120
113
</ div >
0 commit comments