diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 441d564..71a56de 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -45,7 +45,8 @@ "twitter": "Twitter", "cloudflare": "Cloudflare Pages", "chromeWebStore": "Chrome Web Store", - "firefoxAddons": "Firefox Add-ons" + "firefoxAddons": "Firefox Add-ons", + "youtube": "YouTube" }, "showMore": "show more", "title": "Grab a slick name for your new app", diff --git a/src/components/Welcome.tsx b/src/components/Welcome.tsx index e3a386b..dab3c3c 100644 --- a/src/components/Welcome.tsx +++ b/src/components/Welcome.tsx @@ -14,6 +14,7 @@ import { FaTwitter, FaCloudflare, FaFirefoxBrowser, + FaYoutube, } from 'react-icons/fa'; import { IoIosBeer, IoMdAppstore } from 'react-icons/io'; import { MdDomain } from 'react-icons/md'; @@ -38,6 +39,7 @@ const supportedProviders: Record = { github: , gitlab: , twitter: , + youtube: , homebrew: , npm: , rust: , diff --git a/src/components/cards/index.tsx b/src/components/cards/index.tsx index ac0e81b..7029693 100644 --- a/src/components/cards/index.tsx +++ b/src/components/cards/index.tsx @@ -30,6 +30,7 @@ import SlackCard from './providers/Slack'; import SubredditCard from './providers/Subreddit'; import TwitterCard from './providers/Twitter'; import VercelCard from './providers/Vercel'; +import YouTubeCard from './providers/YouTube'; const Index: React.FC<{ query: string }> = ({ query }) => { const { @@ -42,6 +43,7 @@ const Index: React.FC<{ query: string }> = ({ query }) => { + diff --git a/src/components/cards/providers/YouTube.tsx b/src/components/cards/providers/YouTube.tsx new file mode 100644 index 0000000..d196084 --- /dev/null +++ b/src/components/cards/providers/YouTube.tsx @@ -0,0 +1,37 @@ +import React from 'react'; +import { useTranslation } from 'react-i18next'; +import { FaYoutube } from 'react-icons/fa'; +import { normalize } from '../../../util/text'; + +import { Card, Repeater, DedicatedAvailability } from '../core'; + +const YouTubeCard: React.FC<{ query: string }> = ({ query }) => { + const { t } = useTranslation(); + const normalizedQuery = normalize(query, { + alphanumeric: false, + allowUnderscore: false, + allowHyphens: false, + }); + const lowerCase = normalizedQuery.toLowerCase(); + + const names = [normalizedQuery]; + const moreNames = [`${lowerCase}app`, `${lowerCase}team`, `${lowerCase}hq`]; + + return ( + + + {(name) => ( + } + /> + )} + + + ); +}; + +export default YouTubeCard; diff --git a/src/util/i18n.ts b/src/util/i18n.ts index df73cdc..9293423 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 = '11'; +const TRANSLATION_VERSION = '12'; i18n .use(Backend)