mirror of
https://github.com/uetchy/namae.git
synced 2025-03-17 12:30:32 +09:00
fix: card popup
This commit is contained in:
parent
b3328a1ce6
commit
618512b4f8
@ -4,6 +4,8 @@ const googleIt = require('google-it')
|
|||||||
module.exports = async (req, res) => {
|
module.exports = async (req, res) => {
|
||||||
const { query } = req.query
|
const { query } = req.query
|
||||||
|
|
||||||
|
return send(res, { result: [] }) // DISABLE
|
||||||
|
|
||||||
if (!query) {
|
if (!query) {
|
||||||
return res.status(400).json({ error: 'no query given' })
|
return res.status(400).json({ error: 'no query given' })
|
||||||
}
|
}
|
||||||
|
@ -20,5 +20,5 @@
|
|||||||
"google": "Google Search"
|
"google": "Google Search"
|
||||||
},
|
},
|
||||||
"countryCode": "us",
|
"countryCode": "us",
|
||||||
"try": "How about"
|
"try": "AI Godfather"
|
||||||
}
|
}
|
||||||
|
@ -20,5 +20,5 @@
|
|||||||
"google": "Google 検索"
|
"google": "Google 検索"
|
||||||
},
|
},
|
||||||
"countryCode": "jp",
|
"countryCode": "jp",
|
||||||
"try": "これはどう?"
|
"try": "全自動名前考え機"
|
||||||
}
|
}
|
||||||
|
@ -67,8 +67,10 @@ export function Repeater({ items = [], moreItems = [], children }) {
|
|||||||
export function DedicatedAvailability({
|
export function DedicatedAvailability({
|
||||||
name,
|
name,
|
||||||
message = '',
|
message = '',
|
||||||
|
messageIfTaken = undefined,
|
||||||
service,
|
service,
|
||||||
link,
|
link,
|
||||||
|
linkIfTaken = undefined,
|
||||||
prefix = '',
|
prefix = '',
|
||||||
suffix = '',
|
suffix = '',
|
||||||
icon,
|
icon,
|
||||||
@ -82,8 +84,8 @@ export function DedicatedAvailability({
|
|||||||
return (
|
return (
|
||||||
<Result
|
<Result
|
||||||
title={name}
|
title={name}
|
||||||
message={message}
|
message={response.availability ? message : messageIfTaken || message}
|
||||||
link={link}
|
link={response.availability ? link : linkIfTaken || link}
|
||||||
icon={icon}
|
icon={icon}
|
||||||
color={response.availability ? COLORS.available : COLORS.unavailable}
|
color={response.availability ? COLORS.available : COLORS.unavailable}
|
||||||
prefix={prefix}
|
prefix={prefix}
|
||||||
@ -95,8 +97,10 @@ export function DedicatedAvailability({
|
|||||||
export function ExistentialAvailability({
|
export function ExistentialAvailability({
|
||||||
name,
|
name,
|
||||||
message = '',
|
message = '',
|
||||||
|
messageIfTaken = undefined,
|
||||||
target,
|
target,
|
||||||
link,
|
link,
|
||||||
|
linkIfTaken = undefined,
|
||||||
prefix = '',
|
prefix = '',
|
||||||
suffix = '',
|
suffix = '',
|
||||||
icon,
|
icon,
|
||||||
@ -112,8 +116,8 @@ export function ExistentialAvailability({
|
|||||||
return (
|
return (
|
||||||
<Result
|
<Result
|
||||||
title={name}
|
title={name}
|
||||||
message={message}
|
message={availability ? message : messageIfTaken || message}
|
||||||
link={link}
|
link={availability ? link : linkIfTaken || link}
|
||||||
icon={icon}
|
icon={icon}
|
||||||
color={availability ? COLORS.available : COLORS.unavailable}
|
color={availability ? COLORS.available : COLORS.unavailable}
|
||||||
prefix={prefix}
|
prefix={prefix}
|
||||||
|
@ -23,7 +23,7 @@ export default function DomainCard({ query }) {
|
|||||||
{(name) => (
|
{(name) => (
|
||||||
<DedicatedAvailability
|
<DedicatedAvailability
|
||||||
name={name}
|
name={name}
|
||||||
message="Go Domainr.com"
|
message="Go to Domainr.com"
|
||||||
service="domain"
|
service="domain"
|
||||||
link={`https://domainr.com/?q=${name}`}
|
link={`https://domainr.com/?q=${name}`}
|
||||||
icon={<FaMapSigns />}
|
icon={<FaMapSigns />}
|
||||||
|
@ -23,7 +23,10 @@ export default function GithubCard({ query }) {
|
|||||||
<DedicatedAvailability
|
<DedicatedAvailability
|
||||||
name={name}
|
name={name}
|
||||||
service="github"
|
service="github"
|
||||||
link={`https://github.com/${name}`}
|
message="Create GitHub Organization"
|
||||||
|
link="https://github.com/organizations/new"
|
||||||
|
messageIfTaken={`Go to github.com/${name}`}
|
||||||
|
linkIfTaken={`https://github.com/${name}`}
|
||||||
prefix="github.com/"
|
prefix="github.com/"
|
||||||
icon={<FaGithub />}
|
icon={<FaGithub />}
|
||||||
/>
|
/>
|
||||||
|
@ -19,7 +19,9 @@ function Search({ query }) {
|
|||||||
repos.map((repo) => (
|
repos.map((repo) => (
|
||||||
<Result
|
<Result
|
||||||
title={repo.full_name}
|
title={repo.full_name}
|
||||||
message={`${repo.description} (🌟${repo.stargazers_count})`}
|
message={`${repo.description || repo.full_name} (🌟${
|
||||||
|
repo.stargazers_count
|
||||||
|
})`}
|
||||||
link={repo.html_url}
|
link={repo.html_url}
|
||||||
icon={<FaGithub />}
|
icon={<FaGithub />}
|
||||||
key={repo.id}
|
key={repo.id}
|
||||||
|
@ -18,13 +18,19 @@ export default function HomebrewCard({ query }) {
|
|||||||
<ExistentialAvailability
|
<ExistentialAvailability
|
||||||
name={name}
|
name={name}
|
||||||
target={`https://formulae.brew.sh/api/formula/${name}.json`}
|
target={`https://formulae.brew.sh/api/formula/${name}.json`}
|
||||||
link={`https://formulae.brew.sh/formula/${name}`}
|
message="Read Contribution Guide"
|
||||||
|
link="https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request"
|
||||||
|
messageIfTaken="Go to formula page"
|
||||||
|
linkIfTaken={`https://formulae.brew.sh/formula/${name}`}
|
||||||
icon={<IoIosBeer />}
|
icon={<IoIosBeer />}
|
||||||
/>
|
/>
|
||||||
<ExistentialAvailability
|
<ExistentialAvailability
|
||||||
name={name}
|
name={name}
|
||||||
target={`https://formulae.brew.sh/api/cask/${name}.json`}
|
target={`https://formulae.brew.sh/api/cask/${name}.json`}
|
||||||
link={`https://formulae.brew.sh/cask/${name}`}
|
message="Read Contribution Guide"
|
||||||
|
link="https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request"
|
||||||
|
messageIfTaken="Go to formula page"
|
||||||
|
linkIfTaken={`https://formulae.brew.sh/cask/${name}`}
|
||||||
suffix=" (Cask)"
|
suffix=" (Cask)"
|
||||||
icon={<IoIosBeer />}
|
icon={<IoIosBeer />}
|
||||||
/>
|
/>
|
||||||
|
@ -17,7 +17,10 @@ export default function JsOrgCard({ query }) {
|
|||||||
<DedicatedAvailability
|
<DedicatedAvailability
|
||||||
name={`${name}.js.org`}
|
name={`${name}.js.org`}
|
||||||
service="dns"
|
service="dns"
|
||||||
link={`https://${name}.js.org`}
|
message="Go to js.org repository"
|
||||||
|
link="https://github.com/js-org/js.org"
|
||||||
|
messageIfTaken={`Go to ${name}.js.org`}
|
||||||
|
linkIfTaken={`https://${name}.js.org`}
|
||||||
icon={<FaJsSquare />}
|
icon={<FaJsSquare />}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -19,13 +19,19 @@ export default function NpmCard({ query }) {
|
|||||||
<DedicatedAvailability
|
<DedicatedAvailability
|
||||||
name={name}
|
name={name}
|
||||||
service="npm"
|
service="npm"
|
||||||
link={`https://www.npmjs.com/package/${name}`}
|
message="Read publishing guide"
|
||||||
|
link="https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry"
|
||||||
|
messageIfTaken={`See ${name}`}
|
||||||
|
linkIfTaken={`https://www.npmjs.com/package/${name}`}
|
||||||
icon={<FaNpm />}
|
icon={<FaNpm />}
|
||||||
/>
|
/>
|
||||||
<DedicatedAvailability
|
<DedicatedAvailability
|
||||||
name={name}
|
name={name}
|
||||||
service="npm-org"
|
service="npm-org"
|
||||||
link={`https://www.npmjs.com/org/${name}`}
|
message="Create Org"
|
||||||
|
link="https://www.npmjs.com/org/create"
|
||||||
|
messageIfTaken={`See @${name}`}
|
||||||
|
linkIfTaken={`https://www.npmjs.com/org/${name}`}
|
||||||
prefix="@"
|
prefix="@"
|
||||||
suffix=" (Organization)"
|
suffix=" (Organization)"
|
||||||
icon={<FaNpm />}
|
icon={<FaNpm />}
|
||||||
|
@ -18,7 +18,10 @@ export default function PypiCard({ query }) {
|
|||||||
<DedicatedAvailability
|
<DedicatedAvailability
|
||||||
name={name}
|
name={name}
|
||||||
service="pypi"
|
service="pypi"
|
||||||
link={`https://pypi.org/project/${name}`}
|
message="Read Python Packaging User Guide"
|
||||||
|
link="https://packaging.python.org/"
|
||||||
|
messageIfTaken="Go to PyPI"
|
||||||
|
linkIfTaken={`https://pypi.org/project/${name}`}
|
||||||
icon={<FaPython />}
|
icon={<FaPython />}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -17,7 +17,10 @@ export default function RubyGemsCard({ query }) {
|
|||||||
<DedicatedAvailability
|
<DedicatedAvailability
|
||||||
name={name}
|
name={name}
|
||||||
service="rubygems"
|
service="rubygems"
|
||||||
link={`https://rubygems.org/gems/${name}`}
|
message="Read Publishing Guide"
|
||||||
|
link="https://guides.rubygems.org/publishing/"
|
||||||
|
messageIfTaken="Go to RubyGems"
|
||||||
|
linkIfTaken={`https://rubygems.org/gems/${name}`}
|
||||||
icon={<FaGem />}
|
icon={<FaGem />}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -17,7 +17,10 @@ export default function S3Card({ query }) {
|
|||||||
<DedicatedAvailability
|
<DedicatedAvailability
|
||||||
name={name}
|
name={name}
|
||||||
service="s3"
|
service="s3"
|
||||||
link={`https://${name}.s3.amazonaws.com`}
|
message="Go to S3 console"
|
||||||
|
link="https://s3.console.aws.amazon.com"
|
||||||
|
messageIfTaken={`Go to ${name}.s3.amazonaws.com`}
|
||||||
|
linkIfTaken={`https://${name}.s3.amazonaws.com`}
|
||||||
suffix=".s3.amazonaws.com"
|
suffix=".s3.amazonaws.com"
|
||||||
icon={<FaAws />}
|
icon={<FaAws />}
|
||||||
/>
|
/>
|
||||||
|
@ -17,7 +17,10 @@ export default function SlackCard({ query }) {
|
|||||||
<DedicatedAvailability
|
<DedicatedAvailability
|
||||||
name={name}
|
name={name}
|
||||||
service="slack"
|
service="slack"
|
||||||
link={`https://${name}.slack.com`}
|
message="Create Slack Team"
|
||||||
|
link="https://slack.com/create"
|
||||||
|
messageIfTaken={`Go to ${name}.slack.com`}
|
||||||
|
linkIfTaken={`https://${name}.slack.com`}
|
||||||
suffix=".slack.com"
|
suffix=".slack.com"
|
||||||
icon={<FaSlack />}
|
icon={<FaSlack />}
|
||||||
/>
|
/>
|
||||||
|
@ -27,6 +27,7 @@ export default function TwitterCard({ query }) {
|
|||||||
<DedicatedAvailability
|
<DedicatedAvailability
|
||||||
name={name}
|
name={name}
|
||||||
service="twitter"
|
service="twitter"
|
||||||
|
message="Go to Twitter"
|
||||||
link={`https://twitter.com/${name}`}
|
link={`https://twitter.com/${name}`}
|
||||||
prefix="twitter.com/"
|
prefix="twitter.com/"
|
||||||
icon={<FaTwitter />}
|
icon={<FaTwitter />}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user