1
0
mirror of https://github.com/uetchy/namae.git synced 2025-08-20 09:58:13 +09:00

feat: add PyPI

This commit is contained in:
2019-07-31 01:43:12 +09:00
parent f9c70c3363
commit 396cd18aa6
4 changed files with 43 additions and 3 deletions

View File

@@ -86,7 +86,7 @@ export function ExistenceAvailability({
const response = useFetch(target, null, { metadata: true })
if (response.status !== 404 && response.status !== 200) {
throw new Error(`Homebrew: ${response.statusText}`)
throw new Error(`${name}: ${response.status}`)
}
const availability = response.status === 404
@@ -106,8 +106,6 @@ export function ExistenceAvailability({
export function Alternatives({ nameList, children }) {
const [show, setShow] = useState(false)
console.log(children)
function onClick() {
setShow(true)
}

View File

@@ -0,0 +1,17 @@
import React from 'react'
import { Card, CardTitle, DedicatedAvailability } from './Card'
import { FaPython } from 'react-icons/fa'
export default function PypiCard({ name }) {
return (
<Card key={name}>
<CardTitle>PyPI</CardTitle>
<DedicatedAvailability
name={name}
provider="pypi"
url={`https://pypi.org/project/${name}`}
icon={<FaPython />}
/>
</Card>
)
}