mirror of
https://github.com/uetchy/namae.git
synced 2025-03-17 12:30:32 +09:00
feat: cloudflare card
This commit is contained in:
parent
ff05740c01
commit
8e7704a935
@ -42,7 +42,8 @@
|
|||||||
"slack": "Slack",
|
"slack": "Slack",
|
||||||
"spectrum": "Spectrum",
|
"spectrum": "Spectrum",
|
||||||
"reddit": "Reddit",
|
"reddit": "Reddit",
|
||||||
"twitter": "Twitter"
|
"twitter": "Twitter",
|
||||||
|
"cloudflare": "Cloudflare"
|
||||||
},
|
},
|
||||||
"showMore": "show more",
|
"showMore": "show more",
|
||||||
"title": "Grab a slick name for your new app",
|
"title": "Grab a slick name for your new app",
|
||||||
|
@ -12,6 +12,7 @@ import {
|
|||||||
FaReddit,
|
FaReddit,
|
||||||
FaSlack,
|
FaSlack,
|
||||||
FaTwitter,
|
FaTwitter,
|
||||||
|
FaCloudflare,
|
||||||
} from 'react-icons/fa';
|
} from 'react-icons/fa';
|
||||||
import { IoIosBeer, IoMdAppstore } from 'react-icons/io';
|
import { IoIosBeer, IoMdAppstore } from 'react-icons/io';
|
||||||
import { MdDomain } from 'react-icons/md';
|
import { MdDomain } from 'react-icons/md';
|
||||||
@ -52,6 +53,7 @@ const supportedProviders: Record<string, React.ReactNode> = {
|
|||||||
heroku: <DiHeroku />,
|
heroku: <DiHeroku />,
|
||||||
now: <NowIcon />,
|
now: <NowIcon />,
|
||||||
netlify: <NetlifyIcon />,
|
netlify: <NetlifyIcon />,
|
||||||
|
cloudflare: <FaCloudflare />,
|
||||||
s3: <FaAws />,
|
s3: <FaAws />,
|
||||||
firebase: <SiFirebase />,
|
firebase: <SiFirebase />,
|
||||||
jsorg: <FaJsSquare />,
|
jsorg: <FaJsSquare />,
|
||||||
|
@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { mobile } from '../../util/css';
|
import { mobile } from '../../util/css';
|
||||||
import AppStoreCard from './providers/AppStore';
|
import AppStoreCard from './providers/AppStore';
|
||||||
|
import CloudflareCard from './providers/Cloudflare';
|
||||||
import CratesioCard from './providers/Cratesio';
|
import CratesioCard from './providers/Cratesio';
|
||||||
import DomainCard from './providers/Domains';
|
import DomainCard from './providers/Domains';
|
||||||
import FirebaseCard from './providers/Firebase';
|
import FirebaseCard from './providers/Firebase';
|
||||||
@ -50,6 +51,7 @@ const Index: React.FC<{ query: string }> = ({ query }) => {
|
|||||||
<VercelCard query={query} />
|
<VercelCard query={query} />
|
||||||
<HerokuCard query={query} />
|
<HerokuCard query={query} />
|
||||||
<NetlifyCard query={query} />
|
<NetlifyCard query={query} />
|
||||||
|
<CloudflareCard query={query} />
|
||||||
<JsOrgCard query={query} />
|
<JsOrgCard query={query} />
|
||||||
<SlackCard query={query} />
|
<SlackCard query={query} />
|
||||||
{/* <InstagramCard query={query} /> */}
|
{/* <InstagramCard query={query} /> */}
|
||||||
|
40
src/components/cards/providers/Cloudflare.tsx
Normal file
40
src/components/cards/providers/Cloudflare.tsx
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { FaCloudflare } from 'react-icons/fa';
|
||||||
|
import { normalize } from '../../../util/text';
|
||||||
|
|
||||||
|
import { Card, Repeater, DedicatedAvailability } from '../core';
|
||||||
|
|
||||||
|
const CloudflareCard: React.FC<{ query: string }> = ({ query }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const normalizedQuery = normalize(query, {
|
||||||
|
alphanumeric: false,
|
||||||
|
allowUnderscore: false,
|
||||||
|
});
|
||||||
|
const lowerCase = normalizedQuery.toLowerCase();
|
||||||
|
|
||||||
|
const names = [normalizedQuery];
|
||||||
|
const moreNames = [
|
||||||
|
`${lowerCase}-web`,
|
||||||
|
`${lowerCase}-webapp`,
|
||||||
|
`${lowerCase}-site`,
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card title={t('providers.cloudflare')}>
|
||||||
|
<Repeater items={names} moreItems={moreNames}>
|
||||||
|
{(name) => (
|
||||||
|
<DedicatedAvailability
|
||||||
|
name={`${name}.pages.dev`}
|
||||||
|
service="existence"
|
||||||
|
message={`Go to ${name}.pages.dev`}
|
||||||
|
link={`https://${name}.pages.dev`}
|
||||||
|
icon={<FaCloudflare />}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Repeater>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CloudflareCard;
|
Loading…
x
Reference in New Issue
Block a user