Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const SelectLang: React.FC = props => {
const { className } = props;
const selectedLang = getLocale();
const changeLang = ({ key }: ClickParam): void => setLocale(key, false);
const locales = [
'zh-CN',
// 'zh-TW',
'en-US',
// 'pt-BR'
];
const languageLabels = {
'zh-CN': '简体中文',
'zh-TW': '繁体中文',
'en-US': 'English',
'pt-BR': 'Português',
};
const languageIcons = {
'zh-CN': '🇨🇳',
// 'zh-TW': '🇭🇰',
const SelectLang: React.FC = props => {
const { className } = props;
const selectedLang = getLocale();
const changeLang = ({ key }: ClickParam): void => setLocale(key, false);
const locales = ['zh-CN', 'zh-TW', 'en-US', 'pt-BR'];
const languageLabels = {
'zh-CN': '简体中文',
'zh-TW': '繁体中文',
'en-US': 'English',
'pt-BR': 'Português',
};
const languageIcons = {
'zh-CN': '🇨🇳',
'zh-TW': '🇭🇰',
'en-US': '🇬🇧',
'pt-BR': '🇧🇷',
};
const langMenu = (
function handleRememberme(e) {
if (e.target.checked) {
setRememberme(true)
return removeDoNotRememberme()
}
setRememberme(false)
return setDoNotRememberme()
}
const { getFieldDecorator } = form
return (
<div>
<div>
</div>
<div>
<div>
<span>
</span>
</div>
<form>
{getFieldDecorator('account', {</form></div></div>
const SelectLang: React.FC = props => {
const { className } = props;
const selectedLang = getLocale();
const changeLang = ({ key }: ClickParam): void => setLocale(key);
const locales = ['zh-CN', 'en-US'];
const languageLabels = {
'zh-CN': '简体中文',
'en-US': 'English',
};
const languageIcons = {
'zh-CN': '🇨🇳',
'en-US': '🇺🇸',
};
const langMenu = (
<menu>
{locales.map(locale => (
<span aria-label="{languageLabels[locale]}" role="img">
{languageIcons[locale]}</span></menu>
const SelectLang = props => {
const { className } = props;
const selectedLang = getLocale();
const changeLang = ({ key }) => setLocale(key);
const locales = ['zh-CN', 'zh-TW', 'en-US', 'pt-BR'];
const languageLabels = {
'zh-CN': '简体中文',
'zh-TW': '繁体中文',
'en-US': 'English',
'pt-BR': 'Português'
};
const languageIcons = {
'zh-CN': '🇨🇳',
'zh-TW': '🇭🇰',
'en-US': '🇬🇧',
'pt-BR': '🇧🇷'
};
const langMenu = (
const SelectLang: React.FC = props => {
const { className } = props;
const selectedLang = getLocale();
const changeLang = ({ key }: ClickParam): void => setLocale(key, false);
const locales = ['zh-CN', 'zh-TW', 'en-US', 'pt-BR'];
const languageLabels = {
'zh-CN': '简体中文',
'zh-TW': '繁体中文',
'en-US': 'English',
'pt-BR': 'Português',
};
const languageIcons = {
'zh-CN': '🇨🇳',
'zh-TW': '🇭🇰',
'en-US': '🇬🇧',
'pt-BR': '🇧🇷',
};
const langMenu = (
<menu></menu>
const DepsInstallBtn: React.SFC = props => {
const {
children,
installType,
path,
onClick,
payload,
loadingChild,
onFailure,
onProgress,
onSuccess,
...restProps
} = props;
const locale = getLocale();
const { npmClient: needNpmClient } = payload;
const { npmClient, error } = useNpmClients();
const [loading, setLoading] = useState(false);
const [modalVisible, setModalVisible] = useState(false);
const projectPath = path || window.g_uiCurrentProject.path || '';
const projectKey = window.g_uiCurrentProject.key || '';
const [form] = Form.useForm();
useEffect(
() => {
if (Array.isArray(npmClient) && npmClient.length > 0) {
form.setFieldsValue({
npmClient: npmClient[0],
});
}
},
export const getLocale = () => {
const locale = umiGetLocale() || '';
return localeMapping[locale.toLowerCase()] || 'zh-CN';
};
const SelectLang: React.FC = props => {
const { className } = props;
const selectedLang = getLocale();
const changeLang = ({ key }: ClickParam): void => setLocale(key, false);
const locales = ['zh-CN', 'zh-TW', 'en-US', 'ja-JP'];
const languageLabels = {
'zh-CN': '简体中文',
'zh-TW': '繁体中文',
'en-US': 'English',
'ja-JP': '日本語',
};
const languageIcons = {
'zh-CN': '🇨🇳',
'zh-TW': '🇭🇰',
'en-US': '🇬🇧',
'ja-JP': '🇯🇵',
};
const langMenu = (
<menu></menu>