From 517ef364096882d5d8245e22a7fa82829f3f42a6 Mon Sep 17 00:00:00 2001 From: Snazzah <7025343+Snazzah@users.noreply.github.com> Date: Sun, 17 Apr 2022 05:53:28 +0000 Subject: [PATCH 1/2] feat: add YouTube card --- public/locales/en/translation.json | 3 +- src/components/Welcome.tsx | 2 ++ src/components/cards/index.tsx | 2 ++ src/components/cards/providers/YouTube.tsx | 37 ++++++++++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/components/cards/providers/YouTube.tsx 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; From 615492fe6bc1694474f853fb98792dadbfcee669 Mon Sep 17 00:00:00 2001 From: Snazzah <7025343+Snazzah@users.noreply.github.com> Date: Sun, 17 Apr 2022 13:46:42 -0500 Subject: [PATCH 2/2] fix: bump translation version --- src/util/i18n.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)