Skip to content

Footer - Hide Join Community if user logged in #5135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/shared/components/TopcoderFooter/index.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import cookies from 'browser-cookies';
import moment from 'moment';
import PT from 'prop-types';
import React from 'react';
Expand Down Expand Up @@ -33,9 +34,10 @@ Link.propTypes = {

export default function TopcoderFooter() {
const base = config.URL.BASE;
const auth = config.URL.AUTH;
const authUrl = config.URL.AUTH;
const retUrl = isomorphy.isClientSide() ? encodeURIComponent(window.location.href) : '';
const currentYear = moment().year();
const loggedIn = cookies.get('tcjwt') !== null;
return (
<div styleName="footer" role="contentinfo">
<div styleName="footer-wrap">
Expand Down Expand Up @@ -92,7 +94,9 @@ export default function TopcoderFooter() {
<ul styleName="navi-col-links">
<Link to={`${base}/community/admins`}>Admins</Link>
<Link to={`${base}/community/contact`}>Contact Us</Link>
<Link to={`${auth}?utm_source=community&utm_campaign=tc-footer&utm_medium=promotion&retUrl=${retUrl}`}>Join Community</Link>
{!loggedIn
&& <Link to={`${authUrl}?utm_source=community&utm_campaign=tc-footer&utm_medium=promotion&retUrl=${retUrl}`}>Join Community</Link>
}
<Link to={`${base}/community/learn`}>About Community</Link>
<Link to={`${base}/community/changelog`}>Changelog</Link>
<Link to={`${base}/contact-us/`}>Talk to Sales</Link>
Expand Down