1
0
mirror of https://github.com/uetchy/namae.git synced 2025-03-17 04:30:31 +09:00

fix: add getting started button

This commit is contained in:
uetchy 2020-03-06 23:46:19 +09:00
parent 9c096db248
commit ea61ecc9dc
6 changed files with 20 additions and 39 deletions

View File

@ -1,6 +1,5 @@
{ {
"version": 2, "version": 2,
"name": "namae",
"alias": "namae.dev", "alias": "namae.dev",
"builds": [ "builds": [
{ {

View File

@ -30,5 +30,6 @@
"try": "How about this?", "try": "How about this?",
"showMore": "show more", "showMore": "show more",
"noResult": "No Result", "noResult": "No Result",
"exampleQueries": "Try these queries" "gettingStarted": "Getting Started",
"pressEnterToSearch": "Press Enter to search"
} }

View File

@ -1,6 +1,6 @@
{ {
"title": "その名前、もう使われてる?", "title": "唯一無二の名前を見つけましょう",
"description": "あなたの新しいアプリやライブラリにつける「名前」が被っていないか調べましょう。", "description": "namae は、あなたのアプリやライブラリにつける最適な名前を見つけるお手伝いをします。",
"placeholder": "検索", "placeholder": "検索",
"providers": { "providers": {
"domains": "ドメイン", "domains": "ドメイン",
@ -30,5 +30,6 @@
"try": "これはどう?", "try": "これはどう?",
"showMore": "もっと見る", "showMore": "もっと見る",
"noResult": "該当なし", "noResult": "該当なし",
"exampleQueries": "これらのワードでお試しください" "gettingStarted": "試してみる",
"pressEnterToSearch": "エンターキーで検索"
} }

View File

@ -75,9 +75,7 @@ const Form: React.FC<{
/> />
{isFocused && ( {isFocused && (
<Tips> <Tips>
<span> <span>{t('pressEnterToSearch')}</span>
Press <kbd>Enter</kbd> to search
</span>
</Tips> </Tips>
)} )}
</form> </form>

View File

@ -22,46 +22,26 @@ import {IoIosBeer} from 'react-icons/io';
import {DiRust, DiHeroku} from 'react-icons/di'; import {DiRust, DiHeroku} from 'react-icons/di';
import {SpectrumIcon, NowIcon, NetlifyIcon, OcamlIcon} from './Icons'; import {SpectrumIcon, NowIcon, NetlifyIcon, OcamlIcon} from './Icons';
import {shuffleArray} from '../util/array';
import {mobile} from '../util/css'; import {mobile} from '../util/css';
import {sendExampleQueryEvent} from '../util/analytics'; import {sendExampleQueryEvent} from '../util/analytics';
const QUERY_WORDS = [
'Name',
'Colorful',
'Ghost',
'Animate',
'Graph',
'Compile',
'Crop',
'Test',
'Cat',
'Machine',
'Craft',
];
const Welcome: React.FC = () => { const Welcome: React.FC = () => {
const {t} = useTranslation(); const {t} = useTranslation();
const queries = shuffleArray(QUERY_WORDS).slice(0, 5);
return ( return (
<Container> <Container>
<Hero> <Hero>
<HeroTitle>{t('title')}</HeroTitle> <HeroTitle>{t('title')}</HeroTitle>
<HeroText>{t('description')}</HeroText> <HeroText>{t('description')}</HeroText>
<ButtonContainer> <ButtonContainer>
<h5>{t('exampleQueries')}</h5>
<List> <List>
{queries.map((query) => ( <ListButton>
<ListButton key={query}> <Link
<Link to="/s/namae"
to={`/s/${query}`} onClick={() => sendExampleQueryEvent('namae')}>
onClick={() => sendExampleQueryEvent(query)}> {t('gettingStarted')}
{query} </Link>
</Link> </ListButton>
</ListButton>
))}
</List> </List>
</ButtonContainer> </ButtonContainer>
</Hero> </Hero>
@ -161,7 +141,7 @@ const HeroTitle = styled.h1`
const HeroText = styled.p` const HeroText = styled.p`
font-size: 1.2em; font-size: 1.2em;
font-weight: 300; font-weight: 400;
line-height: 1.3em; line-height: 1.3em;
color: #3c3c3c; color: #3c3c3c;
`; `;
@ -178,7 +158,7 @@ const Hero = styled.div`
`; `;
const ButtonContainer = styled.div` const ButtonContainer = styled.div`
margin: 30px 0 0 0; margin: 10px 0 0 0;
`; `;
const List = styled.div` const List = styled.div`
@ -244,7 +224,7 @@ const ListButton = styled.div`
a { a {
color: black; color: black;
padding: 10px; padding: 12px 25px;
border: 1px solid black; border: 1px solid black;
border-radius: 2px; border-radius: 2px;
text-decoration: none; text-decoration: none;

View File

@ -5,6 +5,8 @@ import XHR from 'i18next-xhr-backend';
import LanguageDetector from 'i18next-browser-languagedetector'; import LanguageDetector from 'i18next-browser-languagedetector';
import {initReactI18next} from 'react-i18next'; import {initReactI18next} from 'react-i18next';
const TRANSLATION_VERSION = '1.11';
i18n i18n
.use(Backend) .use(Backend)
.use(LanguageDetector) .use(LanguageDetector)
@ -14,7 +16,7 @@ i18n
backends: [LocalStorageBackend, XHR], backends: [LocalStorageBackend, XHR],
backendOptions: [ backendOptions: [
{ {
versions: {en: '1.10', ja: '1.10'}, versions: {en: TRANSLATION_VERSION, ja: TRANSLATION_VERSION},
}, },
], ],
}, },