Skip to content

Commit 311e913

Browse files
Footer - Hide Join Community if user logged in
1 parent 6ff2a97 commit 311e913

File tree

1 file changed

+6
-2
lines changed
  • src/shared/components/TopcoderFooter

1 file changed

+6
-2
lines changed

src/shared/components/TopcoderFooter/index.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import cookies from 'browser-cookies';
12
import moment from 'moment';
23
import PT from 'prop-types';
34
import React from 'react';
@@ -33,9 +34,10 @@ Link.propTypes = {
3334

3435
export default function TopcoderFooter() {
3536
const base = config.URL.BASE;
36-
const auth = config.URL.AUTH;
37+
const authUrl = config.URL.AUTH;
3738
const retUrl = isomorphy.isClientSide() ? encodeURIComponent(window.location.href) : '';
3839
const currentYear = moment().year();
40+
const loggedIn = cookies.get('tcjwt') !== null;
3941
return (
4042
<div styleName="footer" role="contentinfo">
4143
<div styleName="footer-wrap">
@@ -92,7 +94,9 @@ export default function TopcoderFooter() {
9294
<ul styleName="navi-col-links">
9395
<Link to={`${base}/community/admins`}>Admins</Link>
9496
<Link to={`${base}/community/contact`}>Contact Us</Link>
95-
<Link to={`${auth}?utm_source=community&utm_campaign=tc-footer&utm_medium=promotion&retUrl=${retUrl}`}>Join Community</Link>
97+
{!loggedIn
98+
&& <Link to={`${authUrl}?utm_source=community&utm_campaign=tc-footer&utm_medium=promotion&retUrl=${retUrl}`}>Join Community</Link>
99+
}
96100
<Link to={`${base}/community/learn`}>About Community</Link>
97101
<Link to={`${base}/community/changelog`}>Changelog</Link>
98102
<Link to={`${base}/contact-us/`}>Talk to Sales</Link>

0 commit comments

Comments
 (0)