fix: update supporter badge logic (#38461)

* fix: update supporter badge logic

* fix: update snapshot
This commit is contained in:
Ahmad Abdolsaheb
2020-03-28 10:04:48 +03:00
committed by GitHub
parent b7e9795466
commit 562f28e8b9
3 changed files with 16 additions and 9 deletions

View File

@ -20,6 +20,7 @@ const propTypes = {
isLocked: PropTypes.bool, isLocked: PropTypes.bool,
showAbout: PropTypes.bool, showAbout: PropTypes.bool,
showCerts: PropTypes.bool, showCerts: PropTypes.bool,
showDonation: PropTypes.bool,
showHeatMap: PropTypes.bool, showHeatMap: PropTypes.bool,
showLocation: PropTypes.bool, showLocation: PropTypes.bool,
showName: PropTypes.bool, showName: PropTypes.bool,
@ -97,6 +98,7 @@ function renderProfile(user) {
profileUI: { profileUI: {
showAbout = false, showAbout = false,
showCerts = false, showCerts = false,
showDonation = false,
showHeatMap = false, showHeatMap = false,
showLocation = false, showLocation = false,
showName = false, showName = false,
@ -126,12 +128,14 @@ function renderProfile(user) {
isDonating isDonating
} = user; } = user;
console.log(showDonation);
return ( return (
<Fragment> <Fragment>
<Camper <Camper
about={showAbout ? about : null} about={showAbout ? about : null}
githubProfile={githubProfile} githubProfile={githubProfile}
isDonating={isDonating} isDonating={showDonation ? isDonating : null}
isGithub={isGithub} isGithub={isGithub}
isLinkedIn={isLinkedIn} isLinkedIn={isLinkedIn}
isTwitter={isTwitter} isTwitter={isTwitter}

View File

@ -20,11 +20,15 @@ exports[`<Profile/> renders correctly 1`] = `
<div <div
class="avatar-container col-xs-12" class="avatar-container col-xs-12"
> >
<img <div
alt="string's avatar" class=""
class="avatar img-responsive" >
src="string" <img
/> alt="string's avatar"
class="avatar img-responsive"
src="string"
/>
</div>
</div> </div>
</div> </div>
<div <div

View File

@ -68,7 +68,6 @@ 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}
@ -78,7 +77,7 @@ function Camper({
) : ( ) : (
<Image <Image
alt={username + "'s avatar"} alt={username + "'s avatar"}
className={`avatar${isDonating ? ' supporter-img' : ''}`} className='avatar'
responsive={true} responsive={true}
src={picture} src={picture}
/> />
@ -87,7 +86,7 @@ function Camper({
<div> <div>
<Row> <Row>
<Col className='avatar-container' xs={12}> <Col className='avatar-container' xs={12}>
{avatar} <div className={isDonating ? 'supporter-img' : ''}>{avatar}</div>
</Col> </Col>
</Row> </Row>
<SocialIcons <SocialIcons