Skip to content

Commit

Permalink
Hide social network logos if the url is not defined with an env var
Browse files Browse the repository at this point in the history
  • Loading branch information
willemarcel committed Dec 15, 2020
1 parent 0c25080 commit 29cdfb8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
20 changes: 11 additions & 9 deletions frontend/src/components/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,17 @@ export function Footer({ location }: Object) {
</Link>
))}
<p className="pt5-l pt4 pb3">
{socialNetworks.map((item, n) => (
<a
key={n}
href={item.link}
className="link barlow-condensed white f4 ttu di-l dib ph2"
>
{item.icon}
</a>
))}
{socialNetworks
.filter((item) => item.link)
.map((item, n) => (
<a
key={n}
href={item.link}
className="link barlow-condensed white f4 ttu di-l dib ph2"
>
{item.icon}
</a>
))}
</p>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const USER_STATS_API_URL =

// APPLICATION SETTINGS
export const DEFAULT_LOCALE = process.env.REACT_APP_DEFAULT_LOCALE || 'en';
export const ENVIRONMENT= process.env.REACT_APP_ENVIRONMENT || '';
export const ENVIRONMENT = process.env.REACT_APP_ENVIRONMENT || '';
export const PROJECTCARD_CONTRIBUTION_SHOWN_THRESHOLD =
process.env.REACT_APP_PROJECTCARD_CONTRIBUTION_SHOWN_THRESHOLD || 5;
export const INTERMEDIATE_LEVEL_COUNT =
Expand All @@ -32,11 +32,11 @@ export const OSM_CONSUMER_SECRET = process.env.REACT_APP_OSM_CONSUMER_SECRET ||
export const ORG_PRIVACY_POLICY_URL = process.env.REACT_APP_ORG_PRIVACY_POLICY_URL || '';
export const OSM_REGISTER_URL =
process.env.REACT_APP_OSM_REGISTER_URL || 'https://www.openstreetmap.org/user/new';
export const ORG_TWITTER = process.env.REACT_APP_ORG_TWITTER || 'http://twitter.com';
export const ORG_FB = process.env.REACT_APP_ORG_FB || 'https://www.facebook.com';
export const ORG_INSTAGRAM = process.env.REACT_APP_ORG_INSTAGRAM || 'https://www.instagram.com';
export const ORG_YOUTUBE = process.env.REACT_APP_ORG_YOUTUBE || 'https://www.youtube.com';
export const ORG_GITHUB = process.env.REACT_APP_ORG_GITHUB || 'https://github.com/';
export const ORG_TWITTER = process.env.REACT_APP_ORG_TWITTER || '';
export const ORG_FB = process.env.REACT_APP_ORG_FB || '';
export const ORG_INSTAGRAM = process.env.REACT_APP_ORG_INSTAGRAM || '';
export const ORG_YOUTUBE = process.env.REACT_APP_ORG_YOUTUBE || '';
export const ORG_GITHUB = process.env.REACT_APP_ORG_GITHUB || '';
export const MATOMO_ID = process.env.REACT_APP_MATOMO_ID || '';
export const IMAGE_UPLOAD_SERVICE = process.env.REACT_APP_IMAGE_UPLOAD_API_URL || '';
export const HOMEPAGE_VIDEO_URL = process.env.REACT_APP_HOMEPAGE_VIDEO_URL || '';
Expand Down

0 comments on commit 29cdfb8

Please sign in to comment.