Skip to content

Commit 2ac7970

Browse files
authored
hide language switcher
hide language switcher
2 parents c1059ce + 9674515 commit 2ac7970

File tree

10 files changed

+45
-29
lines changed

10 files changed

+45
-29
lines changed

Diff for: components/LocalSwitcher/LocalSwitcher.tsx

+23-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@ import { useRouter } from 'next/dist/client/router'
33
import MenuItem from '@material-ui/core/MenuItem'
44
import FormControl from '@material-ui/core/FormControl'
55
import Select from '@material-ui/core/Select'
6+
import { withStyles } from '@material-ui/core/styles'
67
import { locales, languageNames } from '../../translations/config'
78
import { LocaleContext } from '../../context/LocaleContext'
89

10+
const MenuItemStyle = withStyles({
11+
root: {
12+
fontSize: '1.4rem',
13+
},
14+
})(MenuItem)
15+
916
const LocaleSwitcher: React.FC = () => {
1017
const router = useRouter()
1118
const { locale } = useContext(LocaleContext)
@@ -24,11 +31,16 @@ const LocaleSwitcher: React.FC = () => {
2431
return (
2532
<section>
2633
<FormControl>
27-
<Select value={locale} onChange={handleLocaleChange} displayEmpty>
34+
<Select
35+
className='localSwitch-select'
36+
value={locale}
37+
onChange={handleLocaleChange}
38+
displayEmpty
39+
>
2840
{locales.map(locale => (
29-
<MenuItem key={locale} value={locale}>
41+
<MenuItemStyle key={locale} value={locale}>
3042
{languageNames[locale]}
31-
</MenuItem>
43+
</MenuItemStyle>
3244
))}
3345
</Select>
3446
</FormControl>
@@ -38,9 +50,16 @@ const LocaleSwitcher: React.FC = () => {
3850
display: flex;
3951
min-height: 50px;
4052
align-items: center;
41-
justify-content: flex-end;
4253
padding: 0 20px;
4354
}
55+
56+
section :global(.localSwitch-select) {
57+
font-size: 1.4rem;
58+
}
59+
60+
section :global(li.localSwitch-select svg) {
61+
font-size: 20px;
62+
}
4463
`}</style>
4564
</section>
4665
)

Diff for: hooks/useTranslation.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export default function useTranslation() {
1212
const DEstrings: Strings = require('../translations/de.json')
1313

1414
switch (locale) {
15-
case 'de':
16-
strings = DEstrings
17-
break
15+
// case 'de':
16+
// strings = DEstrings
17+
// break
1818
default:
1919
strings = ENstrings
2020
}

Diff for: pages/[lang]/about.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NextPage } from 'next'
22
import PageLayout from '../../components/PageLayout/PageLayout'
33
import Grid from '@material-ui/core/Grid'
44
import TextSection from '../../components/Section/TextSection'
5-
import LocalSwitcher from '../../components/LocalSwitcher/LocalSwitcher'
5+
// import LocalSwitcher from '../../components/LocalSwitcher/LocalSwitcher'
66
import Button from '../../components/Button/Button'
77
import useTranslation from '../../hooks/useTranslation'
88
import WithLocale from '../../containers/withLocale'
@@ -16,9 +16,9 @@ const About: NextPage = () => {
1616
siteTitle='about.siteTitle'
1717
siteDescription={t('about.siteDescription')}
1818
>
19-
<section>
19+
{/* <section>
2020
<LocalSwitcher />
21-
</section>
21+
</section> */}
2222
<TextSection
2323
classname='default'
2424
title={t('about.history.title')}

Diff for: pages/[lang]/city/[slug].js

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import GitHubIcon from '@material-ui/icons/GitHub'
1010
import TwitterIcon from '@material-ui/icons/Twitter'
1111
import useTranslation from '../../../hooks/useTranslation'
1212
import WithLocale from '../../../containers/withLocale'
13-
import LocalSwitcher from '../../../components/LocalSwitcher/LocalSwitcher'
13+
// import LocalSwitcher from '../../../components/LocalSwitcher/LocalSwitcher'
1414
import CityLayout from '../../../components/CityLayout/CityLayout'
1515
import CityHero from '../../../components/CityHero/CityHero'
1616
import TextSection from '../../../components/Section/TextSection'
@@ -79,9 +79,9 @@ export function CityTemplate({ content, data, siteTitle, siteDescription }) {
7979
meetupName={frontmatter.meetup_name}
8080
credits={frontmatter.credits}
8181
/>
82-
<section>
82+
{/* <section>
8383
<LocalSwitcher />
84-
</section>
84+
</section> */}
8585
<TextSection classname='default'>
8686
<Grid
8787
container

Diff for: pages/[lang]/community.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { NextPage } from 'next'
33
import Link from 'next/link'
44
import PageLayout from '../../components/PageLayout/PageLayout'
55
import ChapterSection from '../../components/Section/ChapterSection'
6-
import LocalSwitcher from '../../components/LocalSwitcher/LocalSwitcher'
6+
// import LocalSwitcher from '../../components/LocalSwitcher/LocalSwitcher'
77
import useTranslation from '../../hooks/useTranslation'
88
import WithLocale from '../../containers/withLocale'
99
import TextSection from '../../components/Section/TextSection'
@@ -17,9 +17,9 @@ const Community: NextPage = () => {
1717
siteTitle={t('community.siteTitle')}
1818
siteDescription={t('community.siteDescription')}
1919
>
20-
<section>
20+
{/* <section>
2121
<LocalSwitcher />
22-
</section>
22+
</section> */}
2323

2424
<TextSection title='Community'>
2525
<Grid container justify='center' alignItems='center'>

Diff for: pages/[lang]/contribute.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NextPage } from 'next'
22
import Grid from '@material-ui/core/Grid'
33
import Link from 'next/link'
44
import PageLayout from '../../components/PageLayout/PageLayout'
5-
import LocalSwitcher from '../../components/LocalSwitcher/LocalSwitcher'
5+
// import LocalSwitcher from '../../components/LocalSwitcher/LocalSwitcher'
66
import useTranslation from '../../hooks/useTranslation'
77
import WithLocale from '../../containers/withLocale'
88
import TextSection from '../../components/Section/TextSection'
@@ -16,9 +16,9 @@ const Community: NextPage = () => {
1616
siteTitle={t('contribute.siteTitle')}
1717
siteDescription={t('contribute.siteDescription')}
1818
>
19-
<section>
19+
{/* <section>
2020
<LocalSwitcher />
21-
</section>
21+
</section> */}
2222

2323
<TextSection title={t('contribute.contribute.title')}>
2424
<Grid container justify='center' alignItems='center'>

Diff for: pages/[lang]/guides.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NextPage } from 'next'
22
import Grid from '@material-ui/core/Grid'
33
import Link from 'next/link'
44
import PageLayout from '../../components/PageLayout/PageLayout'
5-
import LocalSwitcher from '../../components/LocalSwitcher/LocalSwitcher'
5+
// import LocalSwitcher from '../../components/LocalSwitcher/LocalSwitcher'
66
import useTranslation from '../../hooks/useTranslation'
77
import WithLocale from '../../containers/withLocale'
88
import TextSection from '../../components/Section/TextSection'
@@ -15,9 +15,9 @@ const Guides: NextPage = () => {
1515
siteTitle={t('guides.siteTitle')}
1616
siteDescription={t('guides.siteDescription')}
1717
>
18-
<section>
18+
{/* <section>
1919
<LocalSwitcher />
20-
</section>
20+
</section> */}
2121

2222
<TextSection title='Guides'>
2323
<Grid container justify='space-between'>

Diff for: pages/[lang]/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import useTranslation from '../../hooks/useTranslation'
99
import useMediaQuery from '@material-ui/core/useMediaQuery'
1010
import WithLocale from '../../containers/withLocale'
1111
import PageLayout from '../../components/PageLayout/PageLayout'
12-
import LocalSwitcher from '../../components/LocalSwitcher/LocalSwitcher'
12+
// import LocalSwitcher from '../../components/LocalSwitcher/LocalSwitcher'
1313
import TextSection from '../../components/Section/TextSection'
1414
import ChapterSection, { cities } from '../../components/Section/ChapterSection'
1515
import Button from '../../components/Button/Button'
@@ -76,9 +76,9 @@ export const Index: NextPage = () => {
7676
>
7777
<Masthead />
7878

79-
<section>
79+
{/* <section>
8080
<LocalSwitcher />
81-
</section>
81+
</section> */}
8282

8383
<TextSection>
8484
<Grid container justify='space-between' alignItems='center'>

Diff for: translations/config.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
export const defaultLocale = 'en' as const
22

3-
export const locales = ['en', 'de'] as const
3+
export const locales = ['en'] as const
44

55
export const languageNames = {
66
en: 'English',
7-
de: 'Deutsch',
87
}

Diff for: translations/getInitialLocale.ts

-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,5 @@ export function getInitialLocale(): Locale {
1313
if (isLocale(browserSetting)) {
1414
return browserSetting
1515
}
16-
17-
console.log('default')
1816
return defaultLocale
1917
}

0 commit comments

Comments
 (0)