From f61efb225fdafbfe502d620c39bc2ab95e3cdc45 Mon Sep 17 00:00:00 2001
From: Mrugesh Mohapatra
Date: Mon, 18 Feb 2019 17:13:00 +0530
Subject: [PATCH] fix(links): unify linking to pages internal/external
---
client/src/components/Footer/index.js | 23 +---
client/src/components/Supporters.js | 2 +-
client/src/components/helpers/Link.js | 20 +++
client/src/components/helpers/index.js | 1 +
client/src/pages/about.js | 168 +++++++++++--------------
client/src/pages/index.js | 2 +-
client/src/pages/learn.js | 2 +-
client/src/pages/sponsors.js | 74 +++++------
8 files changed, 135 insertions(+), 157 deletions(-)
create mode 100644 client/src/components/helpers/Link.js
diff --git a/client/src/components/Footer/index.js b/client/src/components/Footer/index.js
index 0b098af7bd..8b7d723df9 100644
--- a/client/src/components/Footer/index.js
+++ b/client/src/components/Footer/index.js
@@ -1,8 +1,8 @@
import React from 'react';
-import PropTypes from 'prop-types';
-import { Link as GatsbyLink } from 'gatsby';
import { Grid, Row, Col } from '@freecodecamp/react-bootstrap';
+import Link from '../helpers/Link';
+
import './footer.css';
const propTypes = {
@@ -22,23 +22,6 @@ const linkPropTypes = {
to: PropTypes.string.isRequired
};
-const Link = ({ children, to, external, ...other }) => {
- if (!external && /^\/[^/]?/.test(to)) {
- return (
-
- {children}
-
- );
- }
-
- return (
-
- {children}
-
- );
-};
-Link.propTypes = linkPropTypes;
-
function Footer() {
return (
How big is the freeCodeCamp community?
If you add up all the people who use our learning platform, read
our{' '}
-
Medium publication
-
+
, watch our{' '}
-
YouTube channel
-
+
, and post on our forum, each month we
help millions of people learn about coding and technology.
Yes. Our cryptographically signed wallet details are{' '}
-
+
here
-
+
.
@@ -153,13 +147,12 @@ const AboutPage = () => {
How did freeCodeCamp get started?
-
Quincy
- {' '}
+ {' '}
started the freeCodeCamp community in 2014. He is now just one
of thousands of active contributors.
@@ -196,40 +189,36 @@ const AboutPage = () => {
Does freeCodeCamp have a mobile app?
You can learn on the go by listening to the{' '}
-
freeCodeCamp Podcast
- {' '}
+ {' '}
or watching{' '}
-
freeCodeCamp's YouTube channel
-
+
. And if you want a mobile app designed specifically for
learning to code, we recommend Grasshopper. It's free and
designed by a freeCodeCamp contributor and her team. You can
download it on{' '}
-
iOS
- {' '}
+ {' '}
or{' '}
-
Android
-
+
.
Can I get a job at freeCodeCamp?
@@ -237,13 +226,12 @@ const AboutPage = () => {
We're a small donor-supported nonprofit. We've hired several
prominent contributors from within the freeCodeCamp community,
but you're much more likely to get a job at{' '}
-
one of the hundreds of companies
- {' '}
+ {' '}
where freeCodeCamp alumni work.