Skip to content

Commit 2a4a059

Browse files
authored
Merge pull request #2611 from topcoder-platform/develop-from-master-23may
Add verified badge to skills
2 parents d4ea7ea + 928addc commit 2a4a059

File tree

8 files changed

+73
-14
lines changed

8 files changed

+73
-14
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ workflows:
189189
filters:
190190
branches:
191191
only:
192-
- hot-fixes
192+
- hot-fixes-2
193193
- develop
194194
- general-features
195195
- develop-from-master-23may

__tests__/shared/components/ProfilePage/Skill/__snapshots__/index.jsx.snap

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,23 @@ exports[`renders a skill correctly 1`] = `
1515
/>
1616
</div>
1717
<div
18-
className="src-shared-components-ProfilePage-Skill-___styles__name___31cKG"
18+
className="src-shared-components-ProfilePage-Skill-___styles__name-wrapper___2hnPT"
1919
>
20-
Test Skill
20+
<div
21+
className="src-shared-components-ProfilePage-Skill-___styles__name___31cKG"
22+
>
23+
Test Skill
24+
</div>
25+
<div
26+
className="src-shared-components-ProfilePage-Skill-___styles__verified-badge____BoiH"
27+
>
28+
<VerifiedBadgeIcon
29+
height="14"
30+
viewBox="0 0 14 14"
31+
width="14"
32+
xmlns="http://www.w3.org/2000/svg"
33+
/>
34+
</div>
2135
</div>
2236
</div>
2337
`;

__tests__/shared/components/ProfilePage/Skill/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ it('renders a skill correctly', () => {
99
rnd.render((<Skill
1010
tagId="1"
1111
tagName="Test Skill"
12+
isVerified
1213
/>));
1314
expect(rnd.getRenderOutput()).toMatchSnapshot();
1415
});

__tests__/shared/components/ProfilePage/__snapshots__/index.jsx.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ exports[`renders a full Profile correctly 1`] = `
8383
className="src-shared-components-ProfilePage-___styles__skill___17_DJ"
8484
>
8585
<Skill
86+
isVerified={false}
8687
tagId="117"
8788
tagName="API"
8889
/>
@@ -91,6 +92,7 @@ exports[`renders a full Profile correctly 1`] = `
9192
className="src-shared-components-ProfilePage-___styles__skill___17_DJ"
9293
>
9394
<Skill
95+
isVerified={false}
9496
tagId="125"
9597
tagName="Bash"
9698
/>
@@ -99,6 +101,7 @@ exports[`renders a full Profile correctly 1`] = `
99101
className="src-shared-components-ProfilePage-___styles__skill___17_DJ"
100102
>
101103
<Skill
104+
isVerified={false}
102105
tagId="132"
103106
tagName="C#"
104107
/>
@@ -107,6 +110,7 @@ exports[`renders a full Profile correctly 1`] = `
107110
className="src-shared-components-ProfilePage-___styles__skill___17_DJ"
108111
>
109112
<Skill
113+
isVerified={false}
110114
tagId="153"
111115
tagName="CSS"
112116
/>
@@ -115,6 +119,7 @@ exports[`renders a full Profile correctly 1`] = `
115119
className="src-shared-components-ProfilePage-___styles__skill___17_DJ"
116120
>
117121
<Skill
122+
isVerified={false}
118123
tagId="159"
119124
tagName="Database"
120125
/>
@@ -123,6 +128,7 @@ exports[`renders a full Profile correctly 1`] = `
123128
className="src-shared-components-ProfilePage-___styles__skill___17_DJ"
124129
>
125130
<Skill
131+
isVerified={false}
126132
tagId="168"
127133
tagName="EC2"
128134
/>
@@ -131,6 +137,7 @@ exports[`renders a full Profile correctly 1`] = `
131137
className="src-shared-components-ProfilePage-___styles__skill___17_DJ"
132138
>
133139
<Skill
140+
isVerified={false}
134141
tagId="170"
135142
tagName="EJB"
136143
/>
@@ -139,6 +146,7 @@ exports[`renders a full Profile correctly 1`] = `
139146
className="src-shared-components-ProfilePage-___styles__skill___17_DJ"
140147
>
141148
<Skill
149+
isVerified={false}
142150
tagId="176"
143151
tagName="Excel"
144152
/>
@@ -147,6 +155,7 @@ exports[`renders a full Profile correctly 1`] = `
147155
className="src-shared-components-ProfilePage-___styles__skill___17_DJ"
148156
>
149157
<Skill
158+
isVerified={false}
150159
tagId="212"
151160
tagName="HTML"
152161
/>
@@ -155,6 +164,7 @@ exports[`renders a full Profile correctly 1`] = `
155164
className="src-shared-components-ProfilePage-___styles__skill___17_DJ"
156165
>
157166
<Skill
167+
isVerified={false}
158168
tagId="247"
159169
tagName="Java"
160170
/>
Lines changed: 14 additions & 0 deletions
Loading

src/shared/components/ProfilePage/Skill/index.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import PT from 'prop-types';
66
import { truncate } from 'lodash';
77

88
import FallbackIcon from 'assets/images/profile/skills/id-develop.svg';
9+
import VerifiedBadgeIcon from 'assets/images/verified-skill-badge.svg';
910
import { isomorphy } from 'topcoder-react-utils';
1011

1112
import './styles.scss';
@@ -18,20 +19,25 @@ if (isomorphy.isClientSide()) {
1819
const Skill = ({
1920
tagId,
2021
tagName,
22+
isVerified,
2123
}) => (
2224
<div styleName="container">
2325
<div styleName="skill-icon">
2426
{ assets && assets.keys().includes(`./id-${tagId}.svg`) ? <img src={assets(`./id-${tagId}.svg`)} alt="Skill Icon" /> : <FallbackIcon /> }
2527
</div>
26-
<div styleName="name">
27-
{truncate(tagName, 20)}
28+
<div styleName="name-wrapper">
29+
<div styleName="name">
30+
{truncate(tagName, 20)}
31+
</div>
32+
{ isVerified && <div styleName="verified-badge"><VerifiedBadgeIcon /></div> }
2833
</div>
2934
</div>
3035
);
3136

3237
Skill.propTypes = {
3338
tagId: PT.string.isRequired,
3439
tagName: PT.string.isRequired,
40+
isVerified: PT.string.isRequired,
3541
};
3642

3743
export default Skill;

src/shared/components/ProfilePage/Skill/styles.scss

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,27 @@
4444
}
4545
}
4646

47-
.name {
48-
@include sofia-pro-light;
49-
47+
.name-wrapper {
5048
margin-top: 8px;
51-
font-size: 12px;
52-
color: $tc-gray-90;
53-
text-align: center;
49+
display: flex;
50+
align-items: center;
51+
justify-content: center;
5452

55-
@media (min-width: 768px) {
56-
font-size: 14px;
53+
.name {
54+
@include sofia-pro-light;
55+
56+
font-size: 12px;
57+
color: $tc-gray-90;
58+
text-align: center;
59+
60+
@media (min-width: 768px) {
61+
font-size: 14px;
62+
}
63+
}
64+
65+
.verified-badge {
66+
padding-left: 5px;
67+
font-size: 0;
5768
}
5869
}
5970
}

src/shared/components/ProfilePage/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,16 @@ Skills
212212
</h3>
213213
<div styleName="list">
214214
{
215-
skills.map(({ tagId, tagName, hidden }) => (
215+
skills.map(({
216+
tagId, tagName, hidden, sources,
217+
}) => (
216218
!hidden
217219
&& (
218220
<div key={tagId} styleName="skill">
219221
<Skill
220222
tagId={tagId}
221223
tagName={tagName}
224+
isVerified={_.includes(sources, 'CHALLENGE')}
222225
/>
223226
</div>
224227
)

0 commit comments

Comments
 (0)