diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 88fa8e1..c7c1d60 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -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?", diff --git a/src/components/Welcome.tsx b/src/components/Welcome.tsx index fbbd170..76ed94c 100644 --- a/src/components/Welcome.tsx +++ b/src/components/Welcome.tsx @@ -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 = { rust: , pypi: , rubygems: , + hexpm: , ocaml: , archlinux: , ubuntu: , diff --git a/src/components/cards/index.tsx b/src/components/cards/index.tsx index bc812a2..5312b71 100644 --- a/src/components/cards/index.tsx +++ b/src/components/cards/index.tsx @@ -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 }) => { + diff --git a/src/components/cards/providers/HexPm.tsx b/src/components/cards/providers/HexPm.tsx new file mode 100644 index 0000000..bd6add2 --- /dev/null +++ b/src/components/cards/providers/HexPm.tsx @@ -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 ( + + + {(name) => ( + } + /> + )} + + + ); +}; + +export default HexPmCard; diff --git a/src/util/i18n.ts b/src/util/i18n.ts index 4ef054b..62f46dd 100644 --- a/src/util/i18n.ts +++ b/src/util/i18n.ts @@ -5,7 +5,7 @@ import XHR from 'i18next-xhr-backend'; import LanguageDetector from 'i18next-browser-languagedetector'; import { initReactI18next } from 'react-i18next'; -const TRANSLATION_VERSION = '14'; +const TRANSLATION_VERSION = '15'; i18n .use(Backend)