1
0
mirror of https://github.com/uetchy/namae.git synced 2025-07-07 00:16:00 +09:00
namae/src/components/Footer.tsx

292 lines
6.2 KiB
TypeScript
Raw Normal View History

2020-08-31 08:41:53 +09:00
import React from 'react';
2021-11-11 12:37:21 +09:00
import { Trans, useTranslation } from 'react-i18next';
2020-08-31 08:41:53 +09:00
import { FaGithub, FaProductHunt, FaTwitter } from 'react-icons/fa';
import { GoHeart } from 'react-icons/go';
import styled from 'styled-components';
2021-11-11 12:37:21 +09:00
import Contributors from '../components/Contributors';
2020-08-31 08:41:53 +09:00
import { Section } from '../theme';
import { tablet } from '../util/css';
2019-07-31 18:54:28 +09:00
2019-12-24 01:57:07 +09:00
const Footer: React.FC = () => {
2020-07-31 11:32:54 +09:00
return (
<Container>
<Languages />
<Community />
<About />
</Container>
2020-08-31 08:41:53 +09:00
);
};
export default Footer;
2020-07-31 11:32:54 +09:00
const Languages = () => {
2020-08-31 08:41:53 +09:00
const { t } = useTranslation();
2019-08-03 22:50:35 +09:00
2019-07-31 12:22:31 +09:00
return (
2020-07-31 11:32:54 +09:00
<Pane>
<Title>{t('language')}</Title>
<ul>
<li>
<a href="/?lng=en">English</a>
</li>
2020-08-01 00:08:34 +09:00
<li>
<a href="/?lng=de">Deutsch</a>
</li>
<li>
<a href="/?lng=fr">Français</a>
</li>
2020-07-31 11:32:54 +09:00
<li>
<a href="/?lng=ja"></a>
</li>
<li>
<a href="/?lng=zh-Hans"></a>
</li>
<li>
2020-07-31 11:49:21 +09:00
<a href="/?lng=zh-Hant"></a>
2020-07-31 11:32:54 +09:00
</li>
2022-01-31 12:07:25 -03:00
<li>
<a href="/?lng=pt-BR">Português-BR</a>
</li>
2022-03-28 16:28:47 +09:00
<li>
<a href="/?lng=es">Español</a>
</li>
2020-07-31 11:32:54 +09:00
</ul>
</Pane>
2020-08-31 08:41:53 +09:00
);
};
2020-07-31 11:32:54 +09:00
const Community = () => {
2020-08-31 08:41:53 +09:00
const { t } = useTranslation();
2020-07-31 11:32:54 +09:00
return (
<Pane>
<Title>{t('community')}</Title>
<ul>
<li>
2021-10-07 19:03:51 +09:00
<a
href="https://github.com/uetchy/namae"
2020-07-31 11:32:54 +09:00
aria-label="Go to GitHub repository"
2020-07-30 13:47:28 +09:00
target="_blank"
2021-10-07 19:03:51 +09:00
rel="noreferrer"
2020-07-30 13:47:28 +09:00
>
2020-07-31 11:32:54 +09:00
GitHub
2021-10-07 19:03:51 +09:00
</a>
2020-07-31 11:32:54 +09:00
</li>
<li>
2021-10-07 19:03:51 +09:00
<a
href="https://github.com/uetchy/namae/issues"
2020-07-31 11:32:54 +09:00
aria-label="Go to GitHub Issues"
target="_blank"
2021-10-07 19:03:51 +09:00
rel="noreferrer"
2020-07-31 11:32:54 +09:00
>
{t('issues')}
2021-10-07 19:03:51 +09:00
</a>
2020-07-31 11:32:54 +09:00
</li>
<li>
2021-10-07 19:03:51 +09:00
<a
href="https://dev.to/uetchy/give-your-app-slick-name-with-namae-dev-5c4h"
2020-07-31 11:32:54 +09:00
aria-label="Go to blog"
target="_blank"
2021-10-07 19:03:51 +09:00
rel="noreferrer"
2020-07-31 11:32:54 +09:00
>
{t('blog')}
2021-10-07 19:03:51 +09:00
</a>
2020-07-31 11:32:54 +09:00
</li>
</ul>
<Box>
2021-11-11 12:37:21 +09:00
<Subtitle>{t('contributors')} </Subtitle>
2020-07-31 11:32:54 +09:00
<Contributors />
2021-11-11 12:37:21 +09:00
<Subtext>
<Trans i18nKey="join-us">
Send
<a
href="https://github.com/uetchy/namae"
target="_blank"
rel="noopener noreferrer"
>
a pull request
</a>
and become a contributor!
</Trans>
</Subtext>
2020-07-31 11:32:54 +09:00
</Box>
</Pane>
2020-08-31 08:41:53 +09:00
);
};
2020-07-31 11:32:54 +09:00
const About = () => {
2020-08-31 08:41:53 +09:00
const { t } = useTranslation();
2021-07-02 16:47:49 +09:00
const {
i18n: { language },
} = useTranslation();
2020-07-31 11:32:54 +09:00
return (
<Pane>
<Title>{t('about')}</Title>
<p>
Made with{' '}
<span role="img" aria-label="coffee">
</span>{' '}
by{' '}
2021-10-07 19:03:51 +09:00
<a
href="https://twitter.com/uechz"
2020-07-31 11:32:54 +09:00
aria-label="Author page"
target="_blank"
2021-10-07 19:03:51 +09:00
rel="noreferrer"
2020-07-31 11:32:54 +09:00
>
<Bold>Yasuaki Uechi</Bold>
2021-10-07 19:03:51 +09:00
</a>
2020-07-31 11:32:54 +09:00
</p>
<ShareBox>
<Links>
2021-10-07 19:03:51 +09:00
<a
href={`https://twitter.com/intent/tweet?text=${encodeURIComponent(
2020-08-20 00:57:33 +09:00
`namae — ${t('title')}`
2020-07-31 11:32:54 +09:00
)}&url=${encodeURIComponent('https://namae.dev')}`}
aria-label="Tweet this page"
target="_blank"
2021-10-07 19:03:51 +09:00
rel="noreferrer"
2020-07-31 11:32:54 +09:00
>
<FaTwitter />
2021-10-07 19:03:51 +09:00
</a>
<a
href="https://www.producthunt.com/posts/namae"
2020-07-31 11:32:54 +09:00
aria-label="Go to ProductHunt page"
target="_blank"
2021-10-07 19:03:51 +09:00
rel="noreferrer"
2020-07-31 11:32:54 +09:00
>
<FaProductHunt />
2021-10-07 19:03:51 +09:00
</a>
<a
href="https://github.com/uetchy/namae"
2020-07-31 11:32:54 +09:00
aria-label="Go to GitHub repository"
target="_blank"
2021-10-07 19:03:51 +09:00
rel="noreferrer"
2020-07-31 11:32:54 +09:00
>
<FaGithub />
2021-10-07 19:03:51 +09:00
</a>
<a
href="https://github.com/sponsors/uetchy"
2020-07-31 11:32:54 +09:00
aria-label="Go to GitHub Sponsors"
target="_blank"
2021-10-07 19:03:51 +09:00
rel="noreferrer"
2020-07-31 11:32:54 +09:00
>
<SponsorBadge>
<GoHeart size="1.3em" />
2020-07-31 11:32:54 +09:00
<span>Sponsor</span>
</SponsorBadge>
2021-10-07 19:03:51 +09:00
</a>
2020-07-31 11:32:54 +09:00
</Links>
</ShareBox>
2021-07-02 16:47:49 +09:00
{language === 'ja' ? (
<>
<br />
<Title></Title>
<p>
Web-API機能を利用して取得した情報をもとに作成していますが
</p>
</>
) : null}
2020-07-31 11:32:54 +09:00
</Pane>
2020-08-31 08:41:53 +09:00
);
};
2019-07-31 12:22:31 +09:00
2020-07-30 13:47:28 +09:00
const Container = styled(Section)`
--text: #bdbdbd;
2021-03-05 17:32:50 +09:00
--background: #150c30;
2020-07-30 13:47:28 +09:00
2019-08-03 14:35:49 +09:00
display: flex;
2020-07-30 13:47:28 +09:00
flex-direction: row;
justify-content: space-around;
2019-07-31 12:22:31 +09:00
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
2020-07-30 13:47:28 +09:00
background: var(--background);
color: var(--text);
2019-08-01 14:32:00 +09:00
2019-08-03 14:35:49 +09:00
a {
2020-07-30 13:47:28 +09:00
color: var(--text);
2019-08-01 14:32:00 +09:00
text-decoration: none;
}
2020-07-30 13:47:28 +09:00
ul {
li {
list-style-type: none;
}
}
2020-07-30 15:39:14 +09:00
${tablet} {
2020-07-30 13:47:28 +09:00
flex-direction: column;
}
2020-08-31 08:41:53 +09:00
`;
2019-08-01 13:21:23 +09:00
2020-07-30 13:47:28 +09:00
const Pane = styled.div`
font-size: 1rem;
2020-07-30 15:39:14 +09:00
${tablet} {
2020-07-30 13:47:28 +09:00
margin-bottom: 50px;
}
2020-08-31 08:41:53 +09:00
`;
2020-02-05 16:22:46 +09:00
2020-07-30 15:39:14 +09:00
const Box = styled.div`
margin: 15px 0;
2020-08-31 08:41:53 +09:00
`;
2020-07-30 15:39:14 +09:00
2020-07-30 13:47:28 +09:00
const Title = styled.h3`
margin-bottom: 15px;
2020-08-31 08:41:53 +09:00
`;
2020-07-30 13:47:28 +09:00
2020-07-30 15:39:14 +09:00
const Subtitle = styled.h4`
margin-bottom: 12px;
2020-08-31 08:41:53 +09:00
`;
2020-07-30 15:39:14 +09:00
2021-11-11 12:37:21 +09:00
const Subtext = styled.span`
font-size: 0.8rem;
color: rgba(255, 255, 255, 0.5);
`;
2020-07-30 23:14:02 +09:00
const Links = styled.div`
display: flex;
align-items: center;
a {
margin-right: 10px;
}
2020-08-31 08:41:53 +09:00
`;
2020-07-30 23:14:02 +09:00
2020-07-30 13:47:28 +09:00
const ShareBox = styled.div`
margin-top: 15px;
line-height: 1em;
2020-02-05 16:22:46 +09:00
font-size: 1.5rem;
2020-07-30 13:47:28 +09:00
display: flex;
align-items: center;
2020-08-31 08:41:53 +09:00
`;
2019-08-01 14:00:22 +09:00
const Bold = styled.span`
font-weight: bold;
2020-08-31 08:41:53 +09:00
`;
2020-07-30 13:47:28 +09:00
const SponsorBadge = styled.div`
padding: 5px 13px 5px 10px;
display: flex;
flex-direction: row;
align-items: center;
line-height: 1rem;
font-size: 1rem;
border-radius: 5px;
background-color: #f8f9fa;
color: black;
cursor: pointer;
transition: opacity 200ms ease-out;
:hover {
opacity: 0.8;
}
svg {
color: rgb(236, 69, 171);
margin-right: 5px;
}
2020-08-31 08:41:53 +09:00
`;