1
0
mirror of https://github.com/uetchy/namae.git synced 2025-03-16 20:20:38 +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,
"name": "namae",
"alias": "namae.dev",
"builds": [
{

View File

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

View File

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

View File

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

View File

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

View File

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