-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd56d0e
commit c789574
Showing
52 changed files
with
2,452 additions
and
806 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Text } from '@mantine/core'; | ||
|
||
interface Props { | ||
text?: string; | ||
} | ||
|
||
export default function ListEmpty(props: Props) { | ||
const { text = 'Данных нет' } = props; | ||
const { t } = useTranslation(); | ||
const { text = t('components.list.textDefault') } = props; | ||
return <Text size="sm">{text}</Text>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import IconLanguage from '@tabler/icons-react/dist/esm/icons/IconLanguage'; | ||
import { ActionIcon } from '@mantine/core'; | ||
|
||
type Props = { | ||
className?: string; | ||
}; | ||
|
||
export function LanguageSwitcher({ className }: Props) { | ||
const { i18n } = useTranslation(); | ||
const handleChange = () => { | ||
const nextLanguage = i18n.language === 'en' ? 'ru' : 'en'; | ||
if (nextLanguage === i18n.language) return; | ||
i18n.changeLanguage(nextLanguage); | ||
}; | ||
return ( | ||
<ActionIcon className={className} onClick={handleChange}> | ||
<IconLanguage color="grey" size="1.2rem" /> | ||
</ActionIcon> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { LanguageSwitcher } from './Language'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import React from 'react'; | ||
import type { ReactNode } from 'react'; | ||
import styles from './Page.css'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import i18n from 'i18next'; | ||
import LanguageDetector from 'i18next-browser-languagedetector'; | ||
import { initReactI18next } from 'react-i18next'; | ||
import ru from './translations/ru.json'; | ||
import en from './translations/en.json'; | ||
|
||
i18n | ||
// detect user language | ||
// learn more: https://github.com/i18next/i18next-browser-languageDetector | ||
.use(LanguageDetector) | ||
// pass the i18n instance to react-i18next. | ||
.use(initReactI18next) | ||
// init i18next | ||
// for all options read: https://www.i18next.com/overview/configuration-options | ||
.init({ | ||
resources: { | ||
ru: { | ||
translation: ru, | ||
}, | ||
en: { | ||
translation: en, | ||
}, | ||
}, | ||
fallbackLng: 'en', | ||
interpolation: { | ||
escapeValue: false, // not needed for react! | ||
}, | ||
debug: false, | ||
}); | ||
|
||
export default i18n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.root { | ||
box-shadow: 0 4px 56px rgba(0, 0, 0, 0.12); | ||
box-shadow: 0 4px 56px rgb(0 0 0 / 12%); | ||
} |
Oops, something went wrong.