mirror of
https://github.com/uetchy/namae.git
synced 2025-03-16 12:10:32 +09:00
Merge pull request #162 from Snazzah/feature/hexpm
feat: add Hex.pm card
This commit is contained in:
commit
36b77ed657
@ -48,7 +48,8 @@
|
||||
"cloudflare": "Cloudflare Pages",
|
||||
"chromeWebStore": "Chrome Web Store",
|
||||
"firefoxAddons": "Firefox Add-ons",
|
||||
"youtube": "YouTube"
|
||||
"youtube": "YouTube",
|
||||
"hexpm": "Hex"
|
||||
},
|
||||
"showMore": "show more",
|
||||
"try": "How about this?",
|
||||
|
@ -19,7 +19,7 @@ import {
|
||||
import { IoIosBeer, IoMdAppstore } from 'react-icons/io';
|
||||
import { MdDomain } from 'react-icons/md';
|
||||
import { RiBuilding2Fill, RiChromeFill, RiNpmjsFill } from 'react-icons/ri';
|
||||
import { SiDeno } from 'react-icons/si';
|
||||
import { SiDeno, SiElixir } from 'react-icons/si';
|
||||
import {
|
||||
SiAppstore,
|
||||
SiArchlinux,
|
||||
@ -46,6 +46,7 @@ const supportedProviders: Record<string, React.ReactNode> = {
|
||||
rust: <SiRust />,
|
||||
pypi: <FaPython />,
|
||||
rubygems: <SiRubygems />,
|
||||
hexpm: <SiElixir />,
|
||||
ocaml: <OcamlIcon />,
|
||||
archlinux: <SiArchlinux />,
|
||||
ubuntu: <SiUbuntu />,
|
||||
|
@ -13,6 +13,7 @@ import GithubCard from './providers/GitHubOrganization';
|
||||
import GithubSearchCard from './providers/GitHubSearch';
|
||||
import GitLabCard from './providers/GitLab';
|
||||
import HerokuCard from './providers/Heroku';
|
||||
import HexPmCard from './providers/HexPm';
|
||||
import HomebrewCard from './providers/Homebrew';
|
||||
// import InstagramCard from './providers/Instagram';
|
||||
import JsOrgCard from './providers/JsOrg';
|
||||
@ -50,6 +51,7 @@ const Index: React.FC<{ query: string }> = ({ query }) => {
|
||||
<PypiCard query={query} />
|
||||
<CratesioCard query={query} />
|
||||
<RubyGemsCard query={query} />
|
||||
<HexPmCard query={query} />
|
||||
<LinuxCard query={query} />
|
||||
<OcamlCard query={query} />
|
||||
<VercelCard query={query} />
|
||||
|
32
src/components/cards/providers/HexPm.tsx
Normal file
32
src/components/cards/providers/HexPm.tsx
Normal file
@ -0,0 +1,32 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { SiElixir } from 'react-icons/si';
|
||||
import { normalize } from '../../../util/text';
|
||||
import { Card, DedicatedAvailability, Repeater } from '../core';
|
||||
|
||||
const HexPmCard: React.FC<{ query: string }> = ({ query }) => {
|
||||
const { t } = useTranslation();
|
||||
const normalizedQuery = normalize(query);
|
||||
const lowerCase = normalizedQuery.toLowerCase();
|
||||
const names = [normalizedQuery];
|
||||
const moreNames = [`${lowerCase}-ex`];
|
||||
|
||||
return (
|
||||
<Card title={t('providers.hexpm')}>
|
||||
<Repeater items={names} moreItems={moreNames}>
|
||||
{(name) => (
|
||||
<DedicatedAvailability
|
||||
name={name}
|
||||
query={`hex.pm/packages/${name}`}
|
||||
service="existence"
|
||||
message="Go to Hex"
|
||||
link={`https://hex.pm/packages/${name}`}
|
||||
icon={<SiElixir />}
|
||||
/>
|
||||
)}
|
||||
</Repeater>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
export default HexPmCard;
|
Loading…
x
Reference in New Issue
Block a user