1- import React from "react" ;
21import "../styles/components/RepoCard.css" ;
32import { REPO_DATA_TYPE } from "../utils/types" ;
4- import { Link } from "react-router-dom" ;
53
64const RepoCard = ( { repoData } : { repoData : REPO_DATA_TYPE } ) => {
75 const repo_link = `https://github.com/metakgp/${ repoData . name } ` ;
86
9- const Surround = repoData . homepage ? ( { children } : { children : React . ReactNode } ) => (
10- < a href = { repoData . homepage } target = "_blank" rel = "noreferrer" className = "gh-card-container" >
11- { children }
12- </ a >
13- ) : ( { children } : { children : React . ReactNode } ) => (
14- < div className = "gh-card-container" >
15- { children }
16- </ div >
17- ) ;
18-
197 return (
20- < Surround >
8+ < div className = "gh-card-container" >
219 < div className = "gh-card-header" >
22- < span className = "icon" >
23- < svg aria-hidden = "true" height = "16" viewBox = "0 0 16 16" version = "1.1" width = "16" data-view-component = "true" className = "octicon" >
24- < path d = "M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z" > </ path >
25- </ svg >
26- </ span >
27- < a href = { repoData . homepage ? repoData . homepage : repo_link } target = "_blank" rel = "noreferrer" >
28- < span className = "gh-repo-name" > { repoData . name } </ span >
29- </ a >
30- < a href = { repo_link } target = "_blank" rel = "noreferrer" >
10+ < div className = "project-title" >
3111 < span className = "icon" >
32- < svg width = "25 " height = "25 " viewBox = "0 0 30 30" className = "octicon" >
33- < path d = "M15,3C8.373,3,3,8.373,3,15c0,5.623,3.872,10.328,9.092,11.63C12.036,26.468,12,26.28,12,26.047v-2.051 c-0.487,0-1.303,0-1.508,0c-0.821,0-1.551-0.353-1.905-1.009c-0.393-0.729-0.461 -1.844-1.435-2.526 c-0.289-0.227-0.069-0.486,0.264-0.451c0.615,0.174,1.125,0.596,1.605,1.222c0.478,0.627,0.703,0.769,1.596,0.769 c0.433,0,1.081-0.025,1.691-0.121c0.328-0.833,0.895-1.6,1.588-1.962c-3.996-0.411-5.903-2.399-5.903-5.098 c0-1.162,0.495-2.286,1.336-3.233C9.053,10.647,8.706,8.73,9.435,8c1.798,0,2.885,1.166,3.146,1.481C13.477,9.174,14.461,9,15.495,9 c1.036,0,2.024,0.174,2.922,0.483C18.675,9.17,19.763,8,21.565,8c0.732,0.731,0.381,2.656,0.102,3.594 c0.836,0.945,1.328,2.066,1.328,3.226c0,2.697-1.904,4.684-5.894,5.097C18.199,20.49,19,22.1,19,23.313v2.734 c0,0.104-0.023,0.179-0.035,0.268C23.641,24.676,27,20.236,27,15C27,8.373,21.627,3,15,3z " > </ path >
12+ < svg aria-hidden = "true " height = "20 " viewBox = "0 0 16 16" version = "1.1" width = "20" data-view-component = "true" className = "octicon" >
13+ < path d = "M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0 -1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z " > </ path >
3414 </ svg >
3515 </ span >
36- </ a >
16+ < span className = "gh-repo-name" > { repoData . name } </ span >
17+ </ div >
18+ < div className = "header-links" >
19+ { repoData . homepage && < a href = { repoData . homepage } className = "header-link" > Web</ a > }
20+ < a href = { repo_link } target = "_blank" rel = "noreferrer" className = "header-link" >
21+ < span className = "icon" >
22+ < svg width = "20" height = "20" viewBox = "0 0 30 30" className = "octicon" >
23+ < path d = "M15,3C8.373,3,3,8.373,3,15c0,5.623,3.872,10.328,9.092,11.63C12.036,26.468,12,26.28,12,26.047v-2.051 c-0.487,0-1.303,0-1.508,0c-0.821,0-1.551-0.353-1.905-1.009c-0.393-0.729-0.461-1.844-1.435-2.526 c-0.289-0.227-0.069-0.486,0.264-0.451c0.615,0.174,1.125,0.596,1.605,1.222c0.478,0.627,0.703,0.769,1.596,0.769 c0.433,0,1.081-0.025,1.691-0.121c0.328-0.833,0.895-1.6,1.588-1.962c-3.996-0.411-5.903-2.399-5.903-5.098 c0-1.162,0.495-2.286,1.336-3.233C9.053,10.647,8.706,8.73,9.435,8c1.798,0,2.885,1.166,3.146,1.481C13.477,9.174,14.461,9,15.495,9 c1.036,0,2.024,0.174,2.922,0.483C18.675,9.17,19.763,8,21.565,8c0.732,0.731,0.381,2.656,0.102,3.594 c0.836,0.945,1.328,2.066,1.328,3.226c0,2.697-1.904,4.684-5.894,5.097C18.199,20.49,19,22.1,19,23.313v2.734 c0,0.104-0.023,0.179-0.035,0.268C23.641,24.676,27,20.236,27,15C27,8.373,21.627,3,15,3z" > </ path >
24+ </ svg >
25+ </ span >
26+ Repo
27+ </ a >
28+ </ div >
3729 </ div >
3830 < div className = "gh-card-body" >
3931 { repoData . description }
@@ -60,7 +52,7 @@ const RepoCard = ({ repoData }: { repoData: REPO_DATA_TYPE }) => {
6052 { repoData . forks }
6153 </ div >
6254 </ div >
63- </ Surround >
55+ </ div >
6456 )
6557}
6658
0 commit comments