Skip to content

Commit 78397b5

Browse files
committed
Add help translate
1 parent 762ad32 commit 78397b5

File tree

6 files changed

+85
-7
lines changed

6 files changed

+85
-7
lines changed

components/content/index.tsx

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { PropsWithChildren } from 'react'
2+
import styled from 'styled-components'
3+
4+
import MaxWidthWrapper from 'components/max-width-wrapper'
5+
import Spacer from 'components/spacer'
6+
7+
const Wrapper = styled.div`
8+
h1 {
9+
margin: 2rem 0 1rem;
10+
font-size: 1.875rem;
11+
}
12+
13+
h2 {
14+
margin: 1rem 0;
15+
font-size: 1.5rem;
16+
}
17+
`
18+
19+
export type ContentProps = PropsWithChildren<{}>
20+
21+
const Content = ({ children }: ContentProps) => (
22+
<Wrapper>
23+
<Spacer size="6.75rem" />
24+
25+
<MaxWidthWrapper>{children}</MaxWidthWrapper>
26+
</Wrapper>
27+
)
28+
29+
export default Content

components/footer/index.tsx

+47-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,59 @@
1+
import useTranslation from 'next-translate/useTranslation'
2+
import Link from 'next/link'
3+
import { useRouter } from 'next/router'
14
import styled from 'styled-components'
25

36
import MaxWidthWrapper from 'components/max-width-wrapper'
47

58
const Wrapper = styled.div`
69
padding: 2rem 0;
710
font-size: 0.875rem;
11+
12+
& > ${MaxWidthWrapper} {
13+
display: flex;
14+
flex-wrap: wrap;
15+
gap: 1.5rem;
16+
}
17+
`
18+
19+
const Copyright = styled.div`
20+
flex: 1;
821
opacity: 0.8;
922
`
1023

11-
const Footer = () => (
12-
<Wrapper>
13-
<MaxWidthWrapper>&copy; 2021-{new Date().getFullYear()} LinearMouse</MaxWidthWrapper>
14-
</Wrapper>
15-
)
24+
const Links = styled.ol`
25+
display: flex;
26+
gap: 1rem;
27+
28+
&,
29+
li {
30+
margin: 0;
31+
padding: 0;
32+
}
33+
34+
a {
35+
color: var(--color-text);
36+
text-decoration: none;
37+
font-weight: 500;
38+
}
39+
`
40+
41+
const Footer = () => {
42+
const { t } = useTranslation('common')
43+
44+
return (
45+
<Wrapper>
46+
<MaxWidthWrapper>
47+
<Copyright>&copy; 2021-{new Date().getFullYear()} LinearMouse</Copyright>
48+
49+
<Links>
50+
<a href="https://crowdin.com/profile/lujjjh" target="_blank" rel="noreferrer noopener">
51+
{t('footer.help_translate')}
52+
</a>
53+
</Links>
54+
</MaxWidthWrapper>
55+
</Wrapper>
56+
)
57+
}
1658

1759
export default Footer

components/language-select/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const LanguageSelect = () => {
6969
<span>{t('navigation.language')}</span>
7070
<menu>
7171
{Object.entries(localesToShow).map(([locale, language]) => (
72-
<Link key={locale} href="/" locale={locale}>
72+
<Link key={locale} href="" locale={locale}>
7373
<a onClick={() => persistLocale(locale)}>{language}</a>
7474
</Link>
7575
))}

i18n.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ module.exports = {
3434
],
3535
pages: {
3636
'*': ['common'],
37-
'/': ['index']
37+
'/': ['index'],
38+
'/contributing': ['contributing']
3839
}
3940
}

locales/en/common.json

+3
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
"github": "GitHub",
44
"discussions": "Discussions",
55
"language": "Language"
6+
},
7+
"footer": {
8+
"help_translate": "Help translate"
69
}
710
}

locales/en/contributing.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"title": "Contributing | LinearMouse"
3+
}

0 commit comments

Comments
 (0)