-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* finish * fix lint * remove unused code
- Loading branch information
Showing
26 changed files
with
2,385 additions
and
1,102 deletions.
There are no files selected for viewing
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,3 @@ | ||
legacy-peer-deps = false | ||
auto-install-peers=true | ||
strict-peer-dependencies=false |
This file was deleted.
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
40 changes: 40 additions & 0 deletions
40
dashboard/src/@core/layouts/components/shared-components/LanguageToggler.tsx
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,40 @@ | ||
// Copyright (c) RoochNetwork | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// ** Mui Imports | ||
import Button from '@mui/material/Button' | ||
|
||
// ** Third Party Import | ||
import { useTranslation } from 'react-i18next' | ||
|
||
// ** Types Import | ||
import { Settings } from 'src/@core/context/settingsContext' | ||
|
||
interface Props { | ||
settings: Settings | ||
saveSettings: (values: Settings) => void | ||
} | ||
|
||
const LanguageToggler = (props: Props) => { | ||
// ** Props | ||
// const { settings, saveSettings } = props | ||
|
||
// ** Hook | ||
const { i18n } = useTranslation() | ||
|
||
const handleLangItemClick = () => { | ||
if (i18n.language === 'en') { | ||
i18n.changeLanguage('en') | ||
} else { | ||
i18n.changeLanguage('cn') | ||
} | ||
} | ||
|
||
return ( | ||
<Button color="inherit" aria-haspopup="true" onClick={handleLangItemClick}> | ||
{i18n.language === 'en' ? 'EN' : 'CN'} | ||
</Button> | ||
) | ||
} | ||
|
||
export default LanguageToggler |
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
Oops, something went wrong.