fix: use forumLocation everywhere (#39405)

* fix: use forumLocation everywhere
pull/39391/head
Oliver Eyton-Williams 2020-08-14 11:56:14 +02:00 committed by GitHub
parent 42686db303
commit 5409e1e62e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -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();

View File

@ -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>

View File

@ -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>
.

View File

@ -6,6 +6,7 @@ import { Button, Modal } from '@freecodecamp/react-bootstrap';
import { createQuestion, closeModal, isHelpModalOpenSelector } from '../redux';
import { executeGA } from '../../../redux';
import { forumLocation } from '../../../../config/env.json';
import './help-modal.css';
@ -23,7 +24,7 @@ const propTypes = {
isOpen: PropTypes.bool
};
const RSA = 'https://forum.freecodecamp.org/t/19514';
const RSA = forumLocation + '/t/19514';
export class HelpModal extends Component {
render() {