Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const style = { marginLeft: 5 };
if (locale.language === language && locale.country === country) {
style.color = "white";
style.background = "red";
}
return (
<a style="{style}">{data[language].language}</a>
);
})}
);
LanguagePicker.propTypes = {
locale: localeShape.isRequired,
siteLocales: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired
};
export default withLocale(LanguagePicker);
import { connect } from "react-redux";
import { applyReducers } from "soya-next/redux";
import { withLocale } from "soya-next/i18n";
import { localeShape } from "soya-next/prop-types";
import dictionary from "../reducers/DictionaryReducer";
import { generateId } from "../utils/DictionaryUtil";
import { fetchTranslation } from "../actions/DictionaryAction";
class Dictionary extends React.Component {
static propTypes = {
component: PropTypes.node,
renderProp: PropTypes.string,
entryKey: PropTypes.string.isRequired,
params: PropTypes.object,
translation: PropTypes.string,
locale: localeShape.isRequired,
fetchTranslation: PropTypes.func.isRequired
};
static defaultProps = {
component: "span",
renderProp: "children",
params: null
};
componentDidMount() {
this.props.fetchTranslation();
}
componentDidUpdate(prevProps) {
if (
this.props.locale.language !== prevProps.locale.language ||
<a>{data[locale.language].menuHome}</a>
{" "}
<a>{data[locale.language].menuAboutUs}</a>
{children}
<hr>
);
Layout.propTypes = {
children: PropTypes.node,
locale: localeShape.isRequired,
siteLocales: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired
};
export default withLocale(Layout);
style.color = "white";
style.background = "red";
}
return (
<a style="{style}">
</a>
);
})}
);
LanguagePicker.propTypes = {
locale: localeShape.isRequired,
siteLocales: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired
};
export default withLocale(LanguagePicker);