File tree Expand file tree Collapse file tree 5 files changed +145
-105
lines changed Expand file tree Collapse file tree 5 files changed +145
-105
lines changed Original file line number Diff line number Diff line change
1
+ import { env } from 'env.mjs' ;
2
+ import { CldImage , getCldImageUrl } from 'next-cloudinary' ;
1
3
import { IoLogoGithub } from 'react-icons/io' ;
2
4
3
5
interface Contributor {
@@ -13,6 +15,15 @@ interface Props {
13
15
}
14
16
15
17
export default function ContributorCard ( { contributor } : Props ) {
18
+ const url = env . NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
19
+ ? getCldImageUrl ( {
20
+ src : contributor . avatar_url ,
21
+ deliveryType : 'fetch' ,
22
+ width : 250 ,
23
+ height : 250
24
+ } )
25
+ : contributor . avatar_url ;
26
+
16
27
return (
17
28
< div className = "text-center shadow-2xl card" >
18
29
< a
@@ -21,16 +32,15 @@ export default function ContributorCard({ contributor }: Props) {
21
32
rel = "noreferrer"
22
33
>
23
34
< figure className = "px-10 pt-10" >
24
- < img
25
- src = { contributor . avatar_url }
26
- alt = { contributor . name }
27
- className = "rounded-xl"
28
- />
35
+ < img src = { url } alt = { contributor . name } className = "rounded-xl" />
29
36
</ figure >
30
37
</ a >
31
38
< div className = "card-body items-center text-center" >
32
39
< h2 className = "card-title text-neutral-100" > { contributor . name } </ h2 >
33
- < a href = { contributor . profile } className = "link text-neutral-100 hover:text-[#dbe8d9]" >
40
+ < a
41
+ href = { contributor . profile }
42
+ className = "link text-neutral-100 hover:text-[#dbe8d9]"
43
+ >
34
44
{ contributor . profile }
35
45
</ a >
36
46
< div className = "justify-center card-actions" >
Original file line number Diff line number Diff line change @@ -5,13 +5,12 @@ export const env = createEnv({
5
5
server : {
6
6
GITHUB_TOKEN : z . string ( ) . optional ( )
7
7
} ,
8
- client : { } ,
9
- // If you're using Next.js < 13.4.4, you'll need to specify the runtimeEnv manually
8
+ client : {
9
+ NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME : z . string ( ) . optional ( )
10
+ } ,
10
11
runtimeEnv : {
11
- GITHUB_TOKEN : process . env . GITHUB_TOKEN
12
+ GITHUB_TOKEN : process . env . GITHUB_TOKEN ,
13
+ NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME :
14
+ process . env . NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
12
15
}
13
- // For Next.js >= 13.4.4, you only need to destructure client variables:
14
- // experimental__runtimeEnv: {
15
- // NEXT_PUBLIC_PUBLISHABLE_KEY: process.env.NEXT_PUBLIC_PUBLISHABLE_KEY,
16
- // }
17
16
} ) ;
Original file line number Diff line number Diff line change 20
20
"daisyui" : " ^3.7.7" ,
21
21
"framer-motion" : " ^10.16.4" ,
22
22
"next" : " ^13.5.3" ,
23
+ "next-cloudinary" : " ^4.22.0" ,
23
24
"next-seo" : " ^6.1.0" ,
24
25
"nextjs-progressbar" : " ^0.0.16" ,
25
26
"react" : " 18.2.0" ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments