fix(client): address nav UX issues (#40823)

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
This commit is contained in:
Tom
2021-01-30 00:43:06 -06:00
committed by Mrugesh Mohapatra
parent 1875984423
commit c56a9c966f
15 changed files with 485 additions and 278 deletions

View File

@@ -0,0 +1,16 @@
import { forumLocation } from '../../config/env.json';
const createExternalRedirect = (page, { clientLocale }) => {
const isNotEnglish = clientLocale !== 'english';
if (clientLocale === 'chinese') {
return `https://chinese.freecodecamp.org/${page}`;
}
if (page === 'forum') {
return `${forumLocation}/${isNotEnglish ? 'c/' + clientLocale + '/' : ''}`;
}
return `https://www.freecodecamp.org/${
isNotEnglish ? clientLocale + '/news' : 'news'
}`;
};
export default createExternalRedirect;