fix(icons): Fix social icons not rendering

This commit is contained in:
Stuart Taylor
2018-08-08 21:52:48 +01:00
committed by mrugesh mohapatra
parent 69030797ac
commit ab9b354504
2 changed files with 18 additions and 16 deletions

View File

@ -2,12 +2,14 @@ import React from 'react';
import PropTypes from 'prop-types';
import { createSelector } from 'reselect';
import { connect } from 'react-redux';
import { Row, Col } from 'react-bootstrap';
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
import {
Row,
Col
} from 'react-bootstrap';
import FontAwesome from '@fortawesome/react-fontawesome';
// see https://github.com/FortAwesome/react-fontawesome#external-loading
faLinkedin,
faGithub,
faTwitter
} from '@fortawesome/free-brands-svg-icons';
import { faLink } from '@fortawesome/free-solid-svg-icons';
import { userByNameSelector } from '../../../redux';
@ -55,19 +57,19 @@ function mapDispatchToProps() {
function LinkedInIcon(linkedIn) {
return (
<a href={ linkedIn } rel='no-follow' target='_blank'>
<FontAwesome
icon={['fab', 'linkedin']}
<FontAwesomeIcon
icon={faLinkedin}
size='2x'
/>
</a>
);
}
function githubIcon(ghURL) {
function GithubIcon(ghURL) {
return (
<a href={ ghURL } rel='no-follow' target='_blank'>
<FontAwesome
icon={['fab', 'linkedin']}
<FontAwesomeIcon
icon={faGithub}
size='2x'
/>
</a>
@ -77,8 +79,8 @@ function githubIcon(ghURL) {
function WebsiteIcon(website) {
return (
<a href={ website } rel='no-follow' target='_blank'>
<FontAwesome
icon='link'
<FontAwesomeIcon
icon={faLink}
size='2x'
/>
</a>
@ -88,8 +90,8 @@ function WebsiteIcon(website) {
function TwitterIcon(handle) {
return (
<a href={ handle } rel='no-follow' target='_blank' >
<FontAwesome
icon={['fab', 'twitter']}
<FontAwesomeIcon
icon={faTwitter}
size='2x'
/>
</a>
@ -122,7 +124,7 @@ function SocialIcons(props) {
isLinkedIn ? LinkedInIcon(linkedIn) : null
}
{
isGithub ? githubIcon(githubProfile) : null
isGithub ? GithubIcon(githubProfile) : null
}
{
isWebsite ? WebsiteIcon(website) : null

View File

@ -52,7 +52,7 @@ export default function userServices() {
..._.pick(user, userPropsForSession),
isEmailVerified: !!user.emailVerified,
isGithub: !!user.githubProfile,
isLinkedIn: !!user.linkedIn,
isLinkedIn: !!user.linkedin,
isTwitter: !!user.twitter,
isWebsite: !!user.website,
...normaliseUserFields(user)