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

250 lines
5.3 KiB
TypeScript
Raw Normal View History

2019-09-17 14:30:26 +09:00
import React from 'react';
2020-07-03 12:46:34 +09:00
import { OutboundLink } from 'react-ga';
import { useTranslation } from 'react-i18next';
import { FaGithub, FaProductHunt, FaTwitter } from 'react-icons/fa';
2020-07-30 13:47:28 +09:00
import { GoHeart } from 'react-icons/go';
2019-09-17 14:30:26 +09:00
import styled from 'styled-components';
2020-07-30 13:47:28 +09:00
import { Section } from '../theme';
2020-07-30 23:14:02 +09:00
import { tablet } from '../util/css';
2020-07-30 15:39:14 +09:00
import Contributors from '../components/Contributors';
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>
);
};
export default Footer;
const Languages = () => {
2020-07-03 12:46:34 +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>
<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>
</ul>
</Pane>
);
};
const Community = () => {
const { t } = useTranslation();
return (
<Pane>
<Title>{t('community')}</Title>
<ul>
<li>
2020-03-07 12:34:47 +09:00
<OutboundLink
2020-07-31 11:32:54 +09:00
to="https://github.com/uetchy/namae"
eventLabel="GitHub Repo"
aria-label="Go to GitHub repository"
2020-07-30 13:47:28 +09:00
target="_blank"
>
2020-07-31 11:32:54 +09:00
GitHub
2020-03-07 12:34:47 +09:00
</OutboundLink>
2020-07-31 11:32:54 +09:00
</li>
<li>
<OutboundLink
to="https://github.com/uetchy/namae/issues"
eventLabel="GitHub Issues"
aria-label="Go to GitHub Issues"
target="_blank"
>
{t('issues')}
</OutboundLink>
</li>
<li>
<OutboundLink
to="https://dev.to/uetchy/give-your-app-slick-name-with-namae-dev-5c4h"
eventLabel="Blog article"
aria-label="Go to blog"
target="_blank"
>
{t('blog')}
</OutboundLink>
</li>
</ul>
<Box>
<Subtitle>{t('contributors')}</Subtitle>
<Contributors />
</Box>
</Pane>
);
};
const About = () => {
const { t } = useTranslation();
return (
<Pane>
<Title>{t('about')}</Title>
<p>
Made with{' '}
<span role="img" aria-label="coffee">
</span>{' '}
by{' '}
<OutboundLink
to="https://twitter.com/uechz"
eventLabel="Author Page"
aria-label="Author page"
target="_blank"
>
<Bold>Yasuaki Uechi</Bold>
</OutboundLink>
</p>
<ShareBox>
<Links>
<OutboundLink
to={`https://twitter.com/intent/tweet?text=${encodeURIComponent(
`namae — ${t('title')}`,
)}&url=${encodeURIComponent('https://namae.dev')}`}
eventLabel="Tweet"
aria-label="Tweet this page"
target="_blank"
>
<FaTwitter />
</OutboundLink>
<OutboundLink
to="https://www.producthunt.com/posts/namae"
eventLabel="ProductHunt"
aria-label="Go to ProductHunt page"
target="_blank"
>
<FaProductHunt />
</OutboundLink>
<OutboundLink
to="https://github.com/uetchy/namae"
eventLabel="GitHub Repo"
aria-label="Go to GitHub repository"
target="_blank"
>
<FaGithub />
</OutboundLink>
<OutboundLink
to="https://github.com/sponsors/uetchy"
eventLabel="GitHub Sponsors"
aria-label="Go to GitHub Sponsors"
target="_blank"
>
<SponsorBadge>
<GoHeart size="1.3rem" />
<span>Sponsor</span>
</SponsorBadge>
</OutboundLink>
</Links>
</ShareBox>
</Pane>
2019-09-17 14:30:26 +09:00
);
2019-12-24 01:57:07 +09:00
};
2019-07-31 12:22:31 +09:00
2020-07-30 13:47:28 +09:00
const Container = styled(Section)`
--text: #bdbdbd;
--background: #404040;
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;
}
2019-09-17 14:30:26 +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-02-05 16:22:46 +09:00
`;
2020-07-30 15:39:14 +09:00
const Box = styled.div`
margin: 15px 0;
`;
2020-07-30 13:47:28 +09:00
const Title = styled.h3`
margin-bottom: 15px;
`;
2020-07-30 15:39:14 +09:00
const Subtitle = styled.h4`
margin-bottom: 12px;
`;
2020-07-30 23:14:02 +09:00
const Links = styled.div`
display: flex;
align-items: center;
a {
margin-right: 10px;
}
`;
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;
2019-09-17 14:30:26 +09:00
`;
2019-08-01 14:00:22 +09:00
const Bold = styled.span`
font-weight: bold;
2019-09-17 14:30:26 +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;
}
`;