Skip to content

Commit 606ec75

Browse files
authored
Fix locales import (#1648)
* Fix locales imports * Add shell * Add direct access to login form * Uptate snapshot
1 parent db88e1a commit 606ec75

4 files changed

Lines changed: 19 additions & 5 deletions

File tree

src/components/header/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ export const Header: React.FunctionComponent = () => {
2222
<NavLink to={Routes.ABOUT}>{t('About')}</NavLink>
2323
</li>
2424

25+
{!authState.token && (
26+
<li>
27+
<NavLink to={Routes.LOGIN}>{t('Login')}</NavLink>
28+
</li>
29+
)}
30+
2531
{!!authState.token && (
2632
<>
2733
<li>

src/containers/home/__snapshots__/index.test.tsx.snap

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
exports[`Home component should render successfully 1`] = `
44
<Wrapper>
5-
Homepage
5+
<div
6+
className="o-shell"
7+
>
8+
Homepage
9+
</div>
610
</Wrapper>
711
`;

src/containers/home/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { Wrapper } from '@components';
66
export const Home: React.FunctionComponent = () => {
77
const { t } = useTranslation();
88

9-
return <Wrapper>{t('Homepage')}</Wrapper>;
9+
return (
10+
<Wrapper>
11+
<div className="o-shell">{t('Homepage')}</div>
12+
</Wrapper>
13+
);
1014
};
1115

1216
export default Home;

src/i18n/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import i18n from 'i18next';
22
import LanguageDetector from 'i18next-browser-languagedetector';
33
import { initReactI18next } from 'react-i18next';
44

5-
import en from '../assets/locale/translations.json';
6-
import de from '../assets/locale/de.json';
5+
import * as en from '../assets/locale/translations.json';
6+
import * as de from '../assets/locale/de.json';
77

88
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
99
// @ts-ignore
10-
import locales from './locales';
10+
import * as locales from './locales';
1111

1212
const resources = {
1313
en: {

0 commit comments

Comments
 (0)