1
0
mirror of https://github.com/uetchy/namae.git synced 2025-07-01 22:10:04 +09:00

fix: api folder name, message and normalize rules

This commit is contained in:
Arnaud Lier 2022-03-09 19:33:12 +01:00 committed by GitHub
parent 629a5351b3
commit 9bc32ffd16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -8,14 +8,14 @@ import { Card, Repeater, DedicatedAvailability } from '../core';
const SubredditCard: React.FC<{ query: string }> = ({ query }) => {
const { t } = useTranslation();
const normalizedQuery = normalize(query, {
allowUnderscore: false,
allowUnderscore: true,
});
const lowerCase = normalizedQuery.toLowerCase();
const names = [normalizedQuery];
const moreNames = [
`get${lowerCase}`,
`${lowerCase}-team`,
`${lowerCase}_team`,
];
return (
@ -25,6 +25,7 @@ const SubredditCard: React.FC<{ query: string }> = ({ query }) => {
<DedicatedAvailability
name={name}
service="reddit" // route to http://namae.dev/api/services/reddit/<query> which is /api/services/reddit/[query].ts on GitHub
message={`Go to reddit.com/r/${name}`}
link={`https://reddit.com/r/${name}`}
prefix="reddit.com/r/"
icon={<FaReddit />}