1
0
mirror of https://github.com/uetchy/namae.git synced 2025-03-16 12:10:32 +09:00

feat: new card "Fly.io"

Fixes #167
This commit is contained in:
uetchy 2022-06-04 17:00:40 +09:00
parent 8e13a506d5
commit 34e9db922f
5 changed files with 39 additions and 4 deletions

View File

@ -49,7 +49,8 @@
"chromeWebStore": "Chrome Web Store",
"firefoxAddons": "Firefox Add-ons",
"youtube": "YouTube",
"hexpm": "Hex"
"hexpm": "Hex",
"fly": "Fly.io"
},
"showMore": "show more",
"try": "How about this?",

View File

@ -5,7 +5,6 @@ import Home from './pages/Home';
import Search from './pages/Search';
import { GlobalStyle } from './theme';
import { useOpenSearch } from './util/hooks';
import { isStandalone } from './util/pwa';
export default function App() {
const OpenSearch = useOpenSearch('/opensearch.xml');
@ -21,7 +20,7 @@ export default function App() {
<Route path="*" element={<Navigate to="/" />} />
</Routes>
{!isStandalone() && <Footer />}
<Footer />
</>
);
}

View File

@ -32,6 +32,7 @@ import SubredditCard from './providers/Subreddit';
import TwitterCard from './providers/Twitter';
import VercelCard from './providers/Vercel';
import YouTubeCard from './providers/YouTube';
import FlyIoCard from './providers/FlyIo';
const Index: React.FC<{ query: string }> = ({ query }) => {
const {
@ -54,6 +55,7 @@ const Index: React.FC<{ query: string }> = ({ query }) => {
<HexPmCard query={query} />
<LinuxCard query={query} />
<OcamlCard query={query} />
<FlyIoCard query={query} />
<VercelCard query={query} />
<HerokuCard query={query} />
<NetlifyCard query={query} />

View File

@ -0,0 +1,33 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { FaFly } from 'react-icons/fa';
import { normalize } from '../../../util/text';
import { Card, DedicatedAvailability, Repeater } from '../core';
const FlyIoCard: React.FC<{ query: string }> = ({ query }) => {
const { t } = useTranslation();
const normalizedQuery = normalize(query, {
allowUnderscore: false,
});
const lowerCase = normalizedQuery.toLowerCase();
const names = [lowerCase];
return (
<Card title={t('providers.fly')}>
<Repeater items={names}>
{(name) => (
<DedicatedAvailability
name={`${name}.fly.dev`}
service="dns"
message={`Go to ${name}.fly.dev`}
link={`https://${name}.fly.dev`}
icon={<FaFly />}
/>
)}
</Repeater>
</Card>
);
};
export default FlyIoCard;

View File

@ -5,7 +5,7 @@ import XHR from 'i18next-xhr-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { initReactI18next } from 'react-i18next';
const TRANSLATION_VERSION = '16';
const TRANSLATION_VERSION = '17';
i18n
.use(Backend)