mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-27 19:42:11 +10:00
Url helpers added
This commit is contained in:
parent
8bebb12ea6
commit
0e98125449
3 changed files with 24 additions and 14 deletions
|
|
@ -2,6 +2,7 @@ import React from 'react';
|
|||
import { string } from 'prop-types';
|
||||
import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
|
||||
import classNames from 'classnames';
|
||||
import { twitterPageURL } from '../../util/urlHelpers';
|
||||
import config from '../../config';
|
||||
import {
|
||||
IconSocialMediaFacebook,
|
||||
|
|
@ -14,15 +15,6 @@ import {
|
|||
|
||||
import css from './Footer.css';
|
||||
|
||||
const twitterPageURL = siteTwitterHandle => {
|
||||
if (siteTwitterHandle && siteTwitterHandle.charAt(0) === '@') {
|
||||
return `https://twitter.com/${siteTwitterHandle.substring(1)}`;
|
||||
} else if (siteTwitterHandle) {
|
||||
return `https://twitter.com/${siteTwitterHandle}`;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const renderSocialMediaLinks = intl => {
|
||||
const { siteFacebookPage, siteInstagramPage, siteTwitterHandle } = config;
|
||||
const siteTwitterPage = twitterPageURL(siteTwitterHandle);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
import React from 'react';
|
||||
import config from '../../config';
|
||||
import { twitterPageURL } from '../../util/urlHelpers';
|
||||
import { StaticPage, TopbarContainer } from '../../containers';
|
||||
import {
|
||||
LayoutSingleColumn,
|
||||
|
|
@ -13,6 +15,8 @@ import css from './AboutPage.css';
|
|||
import image from './about-us.jpg';
|
||||
|
||||
const AboutPage = () => {
|
||||
const { siteTwitterHandle, siteFacebookPage } = config;
|
||||
const siteTwitterPage = twitterPageURL(siteTwitterHandle);
|
||||
return (
|
||||
<StaticPage
|
||||
title="About Us"
|
||||
|
|
@ -60,7 +64,7 @@ const AboutPage = () => {
|
|||
|
||||
<h3 id="contact">Get in touch</h3>
|
||||
<p>
|
||||
We are happy to help you in anything you have in your mind.?Best way to reach us is
|
||||
We are happy to help you in anything you have in your mind? Best way to reach us is
|
||||
by emailing us at{' '}
|
||||
<ExternalLink href="mailto:hello@saunatime.io?Subject=Hello%20friends">
|
||||
hello@saunatime.io
|
||||
|
|
@ -68,10 +72,8 @@ const AboutPage = () => {
|
|||
</p>
|
||||
<p>
|
||||
You can also checkout our{' '}
|
||||
<ExternalLink href="https://www.facebook.com/Sharetribe/">
|
||||
Facebook
|
||||
</ExternalLink>{' '}
|
||||
and <ExternalLink href="https://twitter.com/sharetribe">Twitter</ExternalLink>.
|
||||
<ExternalLink href={siteFacebookPage}>Facebook</ExternalLink> and{' '}
|
||||
<ExternalLink href={siteTwitterPage}>Twitter</ExternalLink>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -167,3 +167,19 @@ export const parse = (search, options = {}) => {
|
|||
return result;
|
||||
}, {});
|
||||
};
|
||||
|
||||
/**
|
||||
* Create Twitter page url from twitterHandle
|
||||
*
|
||||
* @param {String} twitterHandle - handle is used for generating Twitter page URL
|
||||
*
|
||||
* @return {String} twitterPageURL
|
||||
*/
|
||||
export const twitterPageURL = twitterHandle => {
|
||||
if (twitterHandle && twitterHandle.charAt(0) === '@') {
|
||||
return `https://twitter.com/${twitterHandle.substring(1)}`;
|
||||
} else if (twitterHandle) {
|
||||
return `https://twitter.com/${twitterHandle}`;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue