fix(client): address nav UX issues (#40823)
Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
This commit is contained in:
16
client/src/components/createExternalRedirects.js
Normal file
16
client/src/components/createExternalRedirects.js
Normal 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;
|
Reference in New Issue
Block a user