Просмотр исходного кода

Add contact us link to the footer

poeti8 7 лет назад
Родитель
Сommit
a9acccfdc7
2 измененных файлов с 15 добавлено и 3 удалено
  1. 12 3
      client/components/Footer/Footer.js
  2. 3 0
      client/config.example.js

+ 12 - 3
client/components/Footer/Footer.js

@@ -1,9 +1,10 @@
-import React, { Component } from 'react';
+import React, { Component, Fragment } from 'react';
 import PropTypes from 'prop-types';
 import { connect } from 'react-redux';
 import styled from 'styled-components';
 import ReCaptcha from './ReCaptcha';
 import showRecaptcha from '../../helpers/recaptcha';
+import config from '../../config';
 
 const Wrapper = styled.footer`
   width: 100%;
@@ -53,13 +54,21 @@ class Footer extends Component {
             GitHub
           </a>
           {' | '}
-          <a href="/terms" title="Terms of Service" target="_blank">
+          <a href="/terms" title="Terms of Service">
             Terms of Service
           </a>
           {' | '}
-          <a href="/report" title="Report abuse" target="_blank">
+          <a href="/report" title="Report abuse">
             Report Abuse
           </a>
+          {config.CONTACT_EMAIL && (
+            <Fragment>
+              {' | '}
+              <a href={`mailto:${config.CONTACT_EMAIL}`} title="Contact us">
+                Contact us
+              </a>
+            </Fragment>
+          )}
           .
         </Text>
       </Wrapper>

+ 3 - 0
client/config.example.js

@@ -8,6 +8,9 @@ module.exports = {
   // Google analytics tracking ID
   GOOGLE_ANALYTICS_ID: '6Lc4TUAUAAAAAMRHnlEEt21UkPlOXKCXHaIapdTT',
 
+  // Contact email address
+  CONTACT_EMAIL: '',
+
   // Report email address
   REPORT_EMAIL: '',
 };