Skip to content

Commit

Permalink
Fixes fossasia#3028 - Improved Staff Pick Badge (fossasia#3030)
Browse files Browse the repository at this point in the history
* Fixes 3028 - Improved Staff Pick Badge

* Fix travis
  • Loading branch information
AuraOfDivinity authored and akshatnitd committed Nov 12, 2019
1 parent 4c14c8c commit 98ab003
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 12 deletions.
24 changes: 13 additions & 11 deletions src/components/ChatApp/MessageListItem/generateMessageBubbleUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const generateDateBubble = message => {
);
};

/*
const generateGifBubble = (
action,
index,
Expand All @@ -114,6 +115,7 @@ const generateGifBubble = (
</MessageContainer>
);
};
*/

const generateAnswerBubble = (
action,
Expand Down Expand Up @@ -366,17 +368,17 @@ export const generateMessageBubble = (
);
} else {
*/
listItems.push(
generateAnswerBubble(
actionType,
index,
replacedText,
message,
latestUserMsgID,
showFeedback,
),
);
//}
listItems.push(
generateAnswerBubble(
actionType,
index,
replacedText,
message,
latestUserMsgID,
showFeedback,
),
);
// }
break;
}
case 'anchor': {
Expand Down
8 changes: 7 additions & 1 deletion src/components/cms/SkillCardScrollList/SkillCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import getImageSrc from '../../../utils/getImageSrc';
import styled from 'styled-components';
import SkillExampleBubble from '../../shared/SkillExampleBubble';
import { ImageContainer, StaffPickImage } from '../SkillsStyle';
import Tooltip from '../../shared/ToolTip';

import {
Card,
Image,
Expand Down Expand Up @@ -211,7 +213,11 @@ class SkillCard extends Component {
>
<span>{skillName}</span>
</Link>
{staffPick && <StaffPickImage />}
{staffPick && (
<Tooltip title="Staff Pick">
<StaffPickImage />
</Tooltip>
)}
</TitleContainer>
<RatingContainer>
<Link
Expand Down
4 changes: 4 additions & 0 deletions src/components/cms/SkillPage/SkillListing.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Ratings from 'react-ratings-declarative';
import { reportSkill } from '../../../apis';
import { CenterReaderContainer } from '../../shared/Container';
import ScrollTopButton from '../../shared/ScrollTopButton';
import { StaffPickBadge } from '../../shared/Badges';

// Static Assets
import CircleImage from '../../shared/CircleImage';
Expand Down Expand Up @@ -293,6 +294,7 @@ class SkillListing extends Component {
dynamicContent,
examples,
skillRatings,
staffPick,
} = this.props.metaData;

const { loadingSkill, isAdmin, accessToken, history } = this.props;
Expand Down Expand Up @@ -348,6 +350,7 @@ class SkillListing extends Component {
{author}
</AuthorSpan>
</h4>
{staffPick && <StaffPickBadge />}
<SingleRating>
<Ratings
rating={skillRatings.avgStar}
Expand Down Expand Up @@ -535,6 +538,7 @@ SkillListing.propTypes = {
snackMessage: PropTypes.string,
accessToken: PropTypes.string,
isAdmin: PropTypes.bool,
staffPick: PropTypes.bool,
};

function mapStateToProps(store) {
Expand Down
27 changes: 27 additions & 0 deletions src/components/shared/Badges.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import _Chip from '@material-ui/core/Chip';
import _PeopleIcon from '@material-ui/icons/People';
import styled from 'styled-components';

const StaffChip = styled(_Chip)`
background-color: #f9a602;
color: white;
`;

const PeopleIcon = styled(_PeopleIcon)`
color: white;
`;

export const StaffPickBadge = () => {
return (
<StaffChip
size="small"
icon={<PeopleIcon />}
label="Staff Pick"
style={{
margin: '5px 0px',
padding: '2px',
}}
/>
);
};

0 comments on commit 98ab003

Please sign in to comment.