mirror of
https://github.com/uetchy/namae.git
synced 2025-03-17 04:30:31 +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) => {
|
||||
const { query } = req.query
|
||||
|
||||
return send(res, { result: [] }) // DISABLE
|
||||
|
||||
if (!query) {
|
||||
return res.status(400).json({ error: 'no query given' })
|
||||
}
|
||||
|
@ -20,5 +20,5 @@
|
||||
"google": "Google Search"
|
||||
},
|
||||
"countryCode": "us",
|
||||
"try": "How about"
|
||||
"try": "AI Godfather"
|
||||
}
|
||||
|
@ -20,5 +20,5 @@
|
||||
"google": "Google 検索"
|
||||
},
|
||||
"countryCode": "jp",
|
||||
"try": "これはどう?"
|
||||
"try": "全自動名前考え機"
|
||||
}
|
||||
|
@ -67,8 +67,10 @@ export function Repeater({ items = [], moreItems = [], children }) {
|
||||
export function DedicatedAvailability({
|
||||
name,
|
||||
message = '',
|
||||
messageIfTaken = undefined,
|
||||
service,
|
||||
link,
|
||||
linkIfTaken = undefined,
|
||||
prefix = '',
|
||||
suffix = '',
|
||||
icon,
|
||||
@ -82,8 +84,8 @@ export function DedicatedAvailability({
|
||||
return (
|
||||
<Result
|
||||
title={name}
|
||||
message={message}
|
||||
link={link}
|
||||
message={response.availability ? message : messageIfTaken || message}
|
||||
link={response.availability ? link : linkIfTaken || link}
|
||||
icon={icon}
|
||||
color={response.availability ? COLORS.available : COLORS.unavailable}
|
||||
prefix={prefix}
|
||||
@ -95,8 +97,10 @@ export function DedicatedAvailability({
|
||||
export function ExistentialAvailability({
|
||||
name,
|
||||
message = '',
|
||||
messageIfTaken = undefined,
|
||||
target,
|
||||
link,
|
||||
linkIfTaken = undefined,
|
||||
prefix = '',
|
||||
suffix = '',
|
||||
icon,
|
||||
@ -112,8 +116,8 @@ export function ExistentialAvailability({
|
||||
return (
|
||||
<Result
|
||||
title={name}
|
||||
message={message}
|
||||
link={link}
|
||||
message={availability ? message : messageIfTaken || message}
|
||||
link={availability ? link : linkIfTaken || link}
|
||||
icon={icon}
|
||||
color={availability ? COLORS.available : COLORS.unavailable}
|
||||
prefix={prefix}
|
||||
|
@ -23,7 +23,7 @@ export default function DomainCard({ query }) {
|
||||
{(name) => (
|
||||
<DedicatedAvailability
|
||||
name={name}
|
||||
message="Go Domainr.com"
|
||||
message="Go to Domainr.com"
|
||||
service="domain"
|
||||
link={`https://domainr.com/?q=${name}`}
|
||||
icon={<FaMapSigns />}
|
||||
|
@ -23,7 +23,10 @@ export default function GithubCard({ query }) {
|
||||
<DedicatedAvailability
|
||||
name={name}
|
||||
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/"
|
||||
icon={<FaGithub />}
|
||||
/>
|
||||
|
@ -19,7 +19,9 @@ function Search({ query }) {
|
||||
repos.map((repo) => (
|
||||
<Result
|
||||
title={repo.full_name}
|
||||
message={`${repo.description} (🌟${repo.stargazers_count})`}
|
||||
message={`${repo.description || repo.full_name} (🌟${
|
||||
repo.stargazers_count
|
||||
})`}
|
||||
link={repo.html_url}
|
||||
icon={<FaGithub />}
|
||||
key={repo.id}
|
||||
|
@ -18,13 +18,19 @@ export default function HomebrewCard({ query }) {
|
||||
<ExistentialAvailability
|
||||
name={name}
|
||||
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 />}
|
||||
/>
|
||||
<ExistentialAvailability
|
||||
name={name}
|
||||
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)"
|
||||
icon={<IoIosBeer />}
|
||||
/>
|
||||
|
@ -17,7 +17,10 @@ export default function JsOrgCard({ query }) {
|
||||
<DedicatedAvailability
|
||||
name={`${name}.js.org`}
|
||||
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 />}
|
||||
/>
|
||||
)}
|
||||
|
@ -19,13 +19,19 @@ export default function NpmCard({ query }) {
|
||||
<DedicatedAvailability
|
||||
name={name}
|
||||
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 />}
|
||||
/>
|
||||
<DedicatedAvailability
|
||||
name={name}
|
||||
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="@"
|
||||
suffix=" (Organization)"
|
||||
icon={<FaNpm />}
|
||||
|
@ -18,7 +18,10 @@ export default function PypiCard({ query }) {
|
||||
<DedicatedAvailability
|
||||
name={name}
|
||||
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 />}
|
||||
/>
|
||||
)}
|
||||
|
@ -17,7 +17,10 @@ export default function RubyGemsCard({ query }) {
|
||||
<DedicatedAvailability
|
||||
name={name}
|
||||
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 />}
|
||||
/>
|
||||
)}
|
||||
|
@ -17,7 +17,10 @@ export default function S3Card({ query }) {
|
||||
<DedicatedAvailability
|
||||
name={name}
|
||||
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"
|
||||
icon={<FaAws />}
|
||||
/>
|
||||
|
@ -17,7 +17,10 @@ export default function SlackCard({ query }) {
|
||||
<DedicatedAvailability
|
||||
name={name}
|
||||
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"
|
||||
icon={<FaSlack />}
|
||||
/>
|
||||
|
@ -27,6 +27,7 @@ export default function TwitterCard({ query }) {
|
||||
<DedicatedAvailability
|
||||
name={name}
|
||||
service="twitter"
|
||||
message="Go to Twitter"
|
||||
link={`https://twitter.com/${name}`}
|
||||
prefix="twitter.com/"
|
||||
icon={<FaTwitter />}
|
||||
|
Loading…
x
Reference in New Issue
Block a user