feat: border on avatar and badge for donating campers (#38434)

This commit is contained in:
Ahmad Abdolsaheb
2020-03-27 11:51:35 +03:00
committed by GitHub
parent 46c3cd3265
commit 8aa68be560
4 changed files with 20 additions and 4 deletions

View File

@ -1,5 +1,6 @@
:root { :root {
--theme-color: #0a0a23; --theme-color: #0a0a23;
--yellow-gold: #ffbf00;
--gray-00: #ffffff; --gray-00: #ffffff;
--gray-05: #f5f6f7; --gray-05: #f5f6f7;
--gray-10: #dfdfe2; --gray-10: #dfdfe2;

View File

@ -48,7 +48,8 @@ const propTypes = {
twitter: PropTypes.string, twitter: PropTypes.string,
username: PropTypes.string, username: PropTypes.string,
website: PropTypes.string, website: PropTypes.string,
yearsTopContributor: PropTypes.array yearsTopContributor: PropTypes.array,
isDonating: PropTypes.bool
}) })
}; };
@ -121,7 +122,8 @@ function renderProfile(user) {
picture, picture,
portfolio, portfolio,
about, about,
yearsTopContributor yearsTopContributor,
isDonating
} = user; } = user;
return ( return (
@ -129,6 +131,7 @@ function renderProfile(user) {
<Camper <Camper
about={showAbout ? about : null} about={showAbout ? about : null}
githubProfile={githubProfile} githubProfile={githubProfile}
isDonating={isDonating}
isGithub={isGithub} isGithub={isGithub}
isLinkedIn={isLinkedIn} isLinkedIn={isLinkedIn}
isTwitter={isTwitter} isTwitter={isTwitter}

View File

@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Col, Row, Image } from '@freecodecamp/react-bootstrap'; import { Col, Row, Image } from '@freecodecamp/react-bootstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faAward } from '@fortawesome/free-solid-svg-icons'; import { faAward, faHeart } from '@fortawesome/free-solid-svg-icons';
import Identicon from 'react-identicons'; import Identicon from 'react-identicons';
import SocialIcons from './SocialIcons'; import SocialIcons from './SocialIcons';
@ -12,6 +12,7 @@ import './camper.css';
const propTypes = { const propTypes = {
about: PropTypes.string, about: PropTypes.string,
githubProfile: PropTypes.string, githubProfile: PropTypes.string,
isDonating: PropTypes.bool,
isGithub: PropTypes.bool, isGithub: PropTypes.bool,
isLinkedIn: PropTypes.bool, isLinkedIn: PropTypes.bool,
isTwitter: PropTypes.bool, isTwitter: PropTypes.bool,
@ -54,6 +55,7 @@ function Camper({
about, about,
yearsTopContributor, yearsTopContributor,
githubProfile, githubProfile,
isDonating,
isLinkedIn, isLinkedIn,
isGithub, isGithub,
isTwitter, isTwitter,
@ -66,6 +68,7 @@ function Camper({
const avatar = /example.com|identicon.org/.test(picture) ? ( const avatar = /example.com|identicon.org/.test(picture) ? (
<Identicon <Identicon
bg={'#858591'} bg={'#858591'}
className={`${isDonating ? 'supporter-img' : ''}`}
count={5} count={5}
fg={'#0A0A23'} fg={'#0A0A23'}
padding={5} padding={5}
@ -75,7 +78,7 @@ function Camper({
) : ( ) : (
<Image <Image
alt={username + "'s avatar"} alt={username + "'s avatar"}
className='avatar' className={`avatar${isDonating ? ' supporter-img' : ''}`}
responsive={true} responsive={true}
src={picture} src={picture}
/> />
@ -102,6 +105,11 @@ function Camper({
<h2 className='text-center username'>@{username}</h2> <h2 className='text-center username'>@{username}</h2>
{name && <p className='text-center name'>{name}</p>} {name && <p className='text-center name'>{name}</p>}
{location && <p className='text-center location'>{location}</p>} {location && <p className='text-center location'>{location}</p>}
{isDonating && (
<p className='text-center supporter'>
<FontAwesomeIcon icon={faHeart} /> Supporter
</p>
)}
{about && <p className='bio text-center'>{about}</p>} {about && <p className='bio text-center'>{about}</p>}
{typeof points === 'number' ? ( {typeof points === 'number' ? (
<p className='text-center points'> <p className='text-center points'>

View File

@ -13,3 +13,7 @@
.location { .location {
overflow-wrap: break-word; overflow-wrap: break-word;
} }
.supporter-img {
border: 10px solid var(--yellow-gold);
}