This commit is contained in:
Cloudburst 2022-09-14 12:11:34 +02:00 committed by GitHub
parent 4aba8e0a7d
commit 55b673f4c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -3,11 +3,11 @@ import React, { useState, useEffect } from "react";
import CompatBtn from "../compatbtn"; import CompatBtn from "../compatbtn";
import { GoVerified } from "react-icons/go"; import { GoVerified } from "react-icons/go";
const RepoCard = ({ data, isFirst }) => { const RepoCard = ({ repoData, isFirst }) => {
const [data, setData] = useState(null) const [data, setData] = useState(null)
const url = (typeof data === 'string') ? data : data.url const url = (typeof repoData === 'string') ? repoData : repoData.url
const isVerified = (typeof data === 'object' && data.verified) const isVerified = (typeof repoData === 'object' && repoData.verified)
useEffect(() => { useEffect(() => {
fetch(url) fetch(url)
@ -22,8 +22,8 @@ const RepoCard = ({ data, isFirst }) => {
} }
return <article className="card bg-base-200 shadow-xl w-full mx-10 md:w-2/3 mb-5"> return <article className="card bg-base-200 shadow-xl w-full mx-10 md:w-2/3 mb-5">
<div className="card-body flex flex-row"> <div className="card-body">
<h2 className="card-title"> <h2 className="card-title flex flex-row">
{isVerified && {isVerified &&
<div class="tooltip" data-tip="Verified safe"> <div class="tooltip" data-tip="Verified safe">
<GoVerified class="stroke-current flex-shrink-0 h-6 w-6 success" /> <GoVerified class="stroke-current flex-shrink-0 h-6 w-6 success" />

View File

@ -29,7 +29,7 @@ const IndexPage = () => {
</div> </div>
</div> </div>
{repos && {repos &&
repos.map((it, index) => <RepoCard url={it} key={index} isFirst={index===0}/>) repos.map((it, index) => <RepoCard repoData={it} key={index} isFirst={index===0}/>)
} }
</div> </div>
</Layout> </Layout>