fix: use forumLocation everywhere (#39405)
* fix: use forumLocation everywhere
This commit is contained in:
committed by
GitHub
parent
42686db303
commit
5409e1e62e
@@ -5,6 +5,8 @@ import TestRenderer from 'react-test-renderer';
|
||||
import { UniversalNav } from './components/UniversalNav';
|
||||
import NavLinks from './components/NavLinks';
|
||||
|
||||
import { forumLocation } from '../../../config/env.json';
|
||||
|
||||
describe('<UniversalNav />', () => {
|
||||
it('renders to the DOM', () => {
|
||||
const shallow = new ShallowRenderer();
|
||||
@@ -23,7 +25,7 @@ describe('<NavLinks />', () => {
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
const expectedLinks = ['/learn', '/news', 'https://forum.freecodecamp.org'];
|
||||
const expectedLinks = ['/learn', '/news', forumLocation];
|
||||
|
||||
it('renders to the DOM', () => {
|
||||
expect(root).toBeTruthy();
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Link } from '../../helpers';
|
||||
import { forumLocation } from '../../../../../config/env.json';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
@@ -17,11 +18,7 @@ function NavLinks({ displayMenu }) {
|
||||
</Link>
|
||||
</li>
|
||||
<li className='nav-forum'>
|
||||
<Link
|
||||
external={true}
|
||||
sameTab={true}
|
||||
to='https://forum.freecodecamp.org'
|
||||
>
|
||||
<Link external={true} sameTab={true} to={forumLocation}>
|
||||
/forum
|
||||
</Link>
|
||||
</li>
|
||||
|
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Link, Spacer, Loader, FullWidthRow } from '../helpers';
|
||||
import { Row, Col } from '@freecodecamp/react-bootstrap';
|
||||
import { apiLocation } from '../../../config/env.json';
|
||||
import { apiLocation, forumLocation } from '../../../config/env.json';
|
||||
import { randomQuote } from '../../utils/get-words';
|
||||
import CurrentChallengeLink from '../helpers/CurrentChallengeLink';
|
||||
|
||||
@@ -153,7 +153,7 @@ function Intro({
|
||||
</p>
|
||||
<p>
|
||||
You can do this on Twitter and GitHub, and also on{' '}
|
||||
<Link className='inline' to='/forum'>
|
||||
<Link className='inline' to={forumLocation}>
|
||||
the freeCodeCamp forum
|
||||
</Link>
|
||||
.
|
||||
|
Reference in New Issue
Block a user