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

fix: add more example queries

This commit is contained in:
uetchy 2022-04-21 14:22:24 +09:00
parent eebf6797b5
commit d85e4b24bf
3 changed files with 36 additions and 39 deletions

2
.github/FUNDING.yml vendored
View File

@ -3,7 +3,7 @@
github: [uetchy] github: [uetchy]
patreon: # Replace with a single Patreon username patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username ko_fi: uetchy
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username liberapay: # Replace with a single Liberapay username

View File

@ -1,31 +0,0 @@
import { send, sendError, fetch } from '../../../util/http';
import { VercelRequest, VercelResponse } from '@vercel/node';
export default async function handler(
req: VercelRequest,
res: VercelResponse
): Promise<void> {
const { query } = req.query;
if (!query || typeof query !== 'string') {
return sendError(res, new Error('No query given'));
}
if (/[^a-zA-Z0-9_-]/.test(query)) {
return sendError(res, new Error('Invalid characters'));
}
try {
const response = await fetch(
`https://spectrum.chat/${encodeURIComponent(query)}`,
'GET'
);
const body = await response.text();
const availability = body.includes(
'You may be trying to view something that is deleted'
);
send(res, { availability });
} catch (err: any) {
sendError(res, err);
}
}

View File

@ -85,6 +85,12 @@ const Welcome: React.FC = () => {
{t('gettingStartedWithExample')} {t('gettingStartedWithExample')}
</Link> </Link>
</ListButton> </ListButton>
<Subtle>or</Subtle>
<HList>
<Link to="/s/SpaceX">SpaceX</Link>
<Link to="/s/Netflix">Netflix</Link>
<Link to="/s/Zoom">Zoom</Link>
</HList>
</List> </List>
</ButtonContainer> </ButtonContainer>
</Section> </Section>
@ -105,6 +111,10 @@ const Welcome: React.FC = () => {
export default Welcome; export default Welcome;
const Subtle = styled.span`
color: #5a5a5a;
`;
const Container = styled.div` const Container = styled.div`
/* padding-bottom: 40px; */ /* padding-bottom: 40px; */
text-align: center; text-align: center;
@ -121,7 +131,7 @@ const Section = styled.div`
padding: 40px 20vw 100px; padding: 40px 20vw 100px;
${mobile} { ${mobile} {
padding: 60px 40px; padding: 0px 40px 50px;
} }
`; `;
@ -166,19 +176,36 @@ const HeroText = styled.p`
`; `;
const ButtonContainer = styled.div` const ButtonContainer = styled.div`
margin: 10px 0 0 0; margin: 30px 0 0 0;
`; `;
const List = styled.div` const List = styled.div`
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
align-items: center;
font-size: 1rem;
`;
const HList = styled.div`
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
align-items: center;
font-size: 1rem; font-size: 1rem;
${mobile} { a {
justify-content: flex-start; color: black;
border-bottom: 1px dashed black;
text-decoration: none;
font-family: monospace;
}
> *:not(:last-child) {
margin-right: 15px;
} }
`; `;
@ -211,9 +238,10 @@ const ListButton = styled.div`
} }
a { a {
color: black; color: #632bec;
padding: 12px 25px; padding: 12px 25px;
border: 1px solid black; border: 2px solid #632bec;
font-family: monospace;
border-radius: 2px; border-radius: 2px;
text-decoration: none; text-decoration: none;