|
1 | 1 | import Image from "next/image"; |
2 | 2 | import { Repositories } from "./Repositories"; |
| 3 | +import Link from "next/link"; |
3 | 4 |
|
4 | 5 | export interface GithubRepo { |
5 | 6 | id: number; |
@@ -28,33 +29,59 @@ export interface GithubUser { |
28 | 29 | export const User = (selectedUser: GithubUser) => { |
29 | 30 | return ( |
30 | 31 | <div className="col-span-full"> |
31 | | - <div className="border border-blue-highlight-light rounded-lg p-4 text-center bg-blue-highlight"> |
32 | | - <Image |
33 | | - src={selectedUser.avatar_url || "/avatar-default.jpg"} |
34 | | - alt={selectedUser.login} |
35 | | - width={300} |
36 | | - height={300} |
37 | | - className="w-[300px] h-[300px] rounded-full mx-auto mb-3" |
38 | | - unoptimized |
39 | | - /> |
40 | | - |
41 | | - <h3 className="font-semibold text-light text-2xl"> |
42 | | - {selectedUser.login} |
43 | | - </h3> |
44 | | - |
45 | | - {selectedUser.name && ( |
46 | | - <p className="text-default">{selectedUser.name}</p> |
47 | | - )} |
48 | | - {selectedUser.bio && <p className="text-default">{selectedUser.bio}</p>} |
49 | | - |
50 | | - <p className="text-default mt-2"> |
51 | | - Followers: {selectedUser.followers} | Following:{" "} |
52 | | - {selectedUser.following} |
53 | | - </p> |
54 | | - |
55 | | - {selectedUser.location && <p>{selectedUser.location}</p>} |
56 | | - {selectedUser.blog && <p>{selectedUser.blog}</p>} |
57 | | - {selectedUser.company && <p>{selectedUser.company}</p>} |
| 32 | + <div className=" border border-blue-highlight-light rounded-lg p-4 bg-blue-highlight flex flex-col gap-10"> |
| 33 | + <div className="text-center flex flex-col gap-4 items-center"> |
| 34 | + <Image |
| 35 | + src={selectedUser.avatar_url || "/avatar-default.jpg"} |
| 36 | + alt={selectedUser.login} |
| 37 | + width={300} |
| 38 | + height={300} |
| 39 | + className="w-[300px] h-[300px] rounded-full mx-auto mb-3" |
| 40 | + unoptimized |
| 41 | + /> |
| 42 | + |
| 43 | + <div> |
| 44 | + <h1 className="font-semibold text-light text-3xl"> |
| 45 | + {selectedUser.login} |
| 46 | + </h1> |
| 47 | + |
| 48 | + {selectedUser.name && ( |
| 49 | + <h2 className="text-default text-xl">{selectedUser.name}</h2> |
| 50 | + )} |
| 51 | + </div> |
| 52 | + |
| 53 | + {selectedUser.bio && ( |
| 54 | + <p className="text-default max-w-[400px] ">{selectedUser.bio}</p> |
| 55 | + )} |
| 56 | + <div className="flex gap-4"> |
| 57 | + <div className="flex items-center justify-center text-default text-[14px] font-semibold rounded-[10px] border border-blue-highlight-light py-2 px-6 w-[200px] text-center"> |
| 58 | + <p>Followers: {selectedUser.followers}</p> |
| 59 | + </div> |
| 60 | + |
| 61 | + <div className="flex items-center justify-center text-default text-[14px] font-semibold rounded-[10px] border border-blue-highlight-light py-2 px-4 w-[200px] text-center"> |
| 62 | + <p>Following: {selectedUser.following}</p> |
| 63 | + </div> |
| 64 | + </div> |
| 65 | + </div> |
| 66 | + |
| 67 | + <div className="flex flex-col gap-6"> |
| 68 | + <div className="flex flex-col gap-2"> |
| 69 | + {selectedUser.location && ( |
| 70 | + <p>📌 Location: {selectedUser.location}</p> |
| 71 | + )} |
| 72 | + {selectedUser.blog && ( |
| 73 | + <Link href={selectedUser.blog} target="_blank"> |
| 74 | + 🔗 Page:{" "} |
| 75 | + <span className="text-blue-400 hover:text-blue-600"> |
| 76 | + {selectedUser.blog} |
| 77 | + </span> |
| 78 | + </Link> |
| 79 | + )} |
| 80 | + {selectedUser.company && ( |
| 81 | + <p>💼 Enterprise: {selectedUser.company}</p> |
| 82 | + )} |
| 83 | + </div> |
| 84 | + </div> |
58 | 85 | </div> |
59 | 86 | <Repositories repos={selectedUser.repos || []} /> |
60 | 87 | </div> |
|
0 commit comments