Commit 792ee493 authored by Matija Obreza's avatar Matija Obreza

No language selection for single language

parent e270e2cc
const languages = [ const languages = [
{ label: 'English', short: 'en' }, { label: 'English', short: 'en', rtl: false }, // rtl: false as template
{ label: 'Arabic', short: 'ar', rtl: true }, // { label: 'Arabic', short: 'ar', rtl: true },
// {label: 'German', short: 'de'}, // {label: 'German', short: 'de'},
// {label: 'Spanish', short: 'es'}, // {label: 'Spanish', short: 'es'},
// {label: 'Persian', short: 'fa', rtl: true}, // {label: 'Persian', short: 'fa', rtl: true},
// {label: 'French', short: 'fr'}, // {label: 'French', short: 'fr'},
{ label: 'Portuguese', short: 'pt' }, // { label: 'Portuguese', short: 'pt' },
{ label: 'Russian', short: 'ru' }, // { label: 'Russian', short: 'ru' },
// {label: 'Chinese', short: 'zh'}, // {label: 'Chinese', short: 'zh'},
]; ];
......
...@@ -88,8 +88,14 @@ class LangListComponent extends React.Component<ILangListComponentProps, any> { ...@@ -88,8 +88,14 @@ class LangListComponent extends React.Component<ILangListComponentProps, any> {
} }
public render() { public render() {
if (languages.length <= 1) {
// No dropdown for a single language
return null;
}
const { classes, i18n } = this.props; const { classes, i18n } = this.props;
let currentLang = i18n.language; let currentLang = i18n.language;
languages.some((item, i, arr) => { languages.some((item, i, arr) => {
if (item.short === i18n.language) { if (item.short === i18n.language) {
currentLang = item.label; currentLang = item.label;
......
...@@ -72,9 +72,9 @@ const Layout = ({classes, children = null, sidebar = null}: ILayoutProps) => ( ...@@ -72,9 +72,9 @@ const Layout = ({classes, children = null, sidebar = null}: ILayoutProps) => (
<div className={ classes.children }> <div className={ classes.children }>
{ children } { children }
</div> </div>
<div className={ classes.footer }> { false && <div className={ classes.footer }>
<Footer /> <Footer />
</div> </div> }
</div> </div>
) } ) }
</div> </div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment