Skip to content

Commit

Permalink
repair two components
Browse files Browse the repository at this point in the history
  • Loading branch information
hyuraku committed Sep 18, 2023
1 parent 754de10 commit 5eb0dea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/components/RepoCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import '../css/RepoCard.css'

interface Props {
export type RepoCardType = {
repo: {
name: string
html_url: string
Expand All @@ -14,15 +14,15 @@ interface Props {
}
}

export const RepoCard: React.FC<Props> = (props) => {
export const RepoCard: React.FC<RepoCardType> = ({repo}) => {
const {
name,
html_url,
description,
owner,
language,
stargazers_count,
} = props.repo
} = repo
return (
<div className="card">
<div className="content">
Expand Down
13 changes: 7 additions & 6 deletions src/components/RepoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ interface RepoCard {
stargazers_count: number
}

export const RepoList: React.FC<Props> = (props) => {
const repos = props.repos.map((repo: RepoCard) => {
return <RepoCard key={repo.id} repo={repo} />
})
return <div className="ui container cards">{repos}</div>
}
export const RepoList: React.FC<Props> = ({ repos }) => (
<div className="ui container cards">
{repos.map((repo) => (
<RepoCard key={repo.id} repo={repo} />
))}
</div>
)

0 comments on commit 5eb0dea

Please sign in to comment.