@@ -13,7 +13,7 @@ import {
1313 UncontrolledTooltip ,
1414 ModalHeader ,
1515} from 'reactstrap' ;
16- import './Badge.css' ;
16+ import styles from './Badge.module .css' ;
1717import BadgeSummaryViz from '~/components/Reports/BadgeSummaryViz' ;
1818import NewBadges from './NewBadges' ;
1919import OldBadges from './OldBadges' ;
@@ -58,13 +58,44 @@ function Badge(props) {
5858 } ) ;
5959
6060 const roundedHours = Math . floor ( personalBestMaxHrs ) ;
61- const personalMaxText = newBadges . find ( badgeObj => badgeObj ?. badge ?. type === 'Personal Max' )
62- ? ` and a personal best of ${ roundedHours } ${ roundedHours === 1 ? 'hour' : 'hours' } in a week`
63- : '' ;
61+ const personalMaxText = newBadges . find (
62+ badgeObj => badgeObj ?. badge ?. type === 'Personal Max' ,
63+ ) && (
64+ < >
65+ { ' and have a personal best of ' }
66+ < span
67+ style = { {
68+ backgroundColor : '#850084' ,
69+ color : 'white' ,
70+ fontWeight : 600 ,
71+ borderRadius : '6px' ,
72+ padding : '2px 4px' ,
73+ } }
74+ >
75+ { roundedHours }
76+ </ span > { ' ' }
77+ { roundedHours === 1 ? 'hour' : 'hours' } in a week
78+ </ >
79+ ) ;
6480
65- return `Bravo! You have earned ${ totalBadges } ${
66- totalBadges === 1 ? 'badge' : 'badges'
67- } ${ personalMaxText } ! `;
81+ return (
82+ < div data-testid = "total_badges" >
83+ < div style = { { fontWeight : 'bold' } } > { 'Bravo! ' } </ div >
84+ { 'You earned ' }
85+ < span
86+ style = { {
87+ backgroundColor : '#2ed02b' ,
88+ borderRadius : '6px' ,
89+ padding : '2px 4px' ,
90+ } }
91+ >
92+ { totalBadges }
93+ </ span > { ' ' }
94+ { totalBadges === 1 ? 'badge' : 'badges total' }
95+ { personalMaxText }
96+ { '!' }
97+ </ div >
98+ ) ;
6899 } ;
69100
70101 useEffect ( ( ) => {
@@ -84,7 +115,11 @@ function Badge(props) {
84115 < >
85116 < div style = { { minWidth : '100%' , paddingRight : '0' } } >
86117 < Row
87- className = { `${ darkMode ? 'badge-box-shadow-dark bg-space-cadet' : 'bagde-box-shadow' } ` }
118+ className = { `${
119+ darkMode
120+ ? `${ styles [ 'badge-box-shadow-dark' ] } bg-space-cadet`
121+ : `${ styles [ 'bagde-box-shadow' ] } `
122+ } `}
88123 style = { { minWidth : '100%' , marginLeft : '2px' } }
89124 >
90125 < Col className = "px-0 mr-0" >
@@ -114,10 +149,10 @@ function Badge(props) {
114149 < CardText
115150 style = { {
116151 fontWeight : 'bold' ,
117- fontSize : 18 ,
152+ // fontSize: 18,
118153 color : darkMode ? '#007BFF' : '#285739' ,
119154 } }
120- className = " responsive-font-size"
155+ className = { ` ${ styles [ ' responsive-font-size' ] } ` }
121156 >
122157 { generateBadgeText (
123158 totalBadge ,
@@ -137,11 +172,11 @@ function Badge(props) {
137172 target = "CountInfo"
138173 style = { { backgroundColor : '#666' , color : '#fff' } }
139174 >
140- < p className = " badge_info_icon_text" >
175+ < p className = { styles . badge_info_icon_text } >
141176 This is the total number of badges you have earned. (Way to go Champion!) It increases if
142177 you earn the same badge multiple times too!
143178 </ p >
144- < p className = " badge_info_icon_text" >
179+ < p className = { styles . badge_info_icon_text } >
145180 There are many things in life to be proud of. Some are even worth bragging about. If your
146181 number here is large, it definitely falls into the latter category.
147182 </ p >
@@ -152,7 +187,7 @@ function Badge(props) {
152187 target = "BadgeInfo"
153188 style = { { backgroundColor : '#666' , color : '#fff' } }
154189 >
155- < p className = " badge_info_icon_text" >
190+ < p className = { styles . badge_info_icon_text } >
156191 There are several types of badges you can earn for hitting different milestones click this
157192 icon to learn more about the different types of badges.
158193 </ p >
@@ -166,38 +201,38 @@ function Badge(props) {
166201 Badge Types and Assignment
167202 </ ModalHeader >
168203 < ModalBody className = { darkMode ? 'bg-yinmn-blue' : '' } >
169- < p className = " badge_info_icon_text" >
204+ < p className = { styles . badge_info_icon_text } >
170205 No Infringement Streak: Not recieving any infringement for a certain number of months.{ ' ' }
171206 </ p >
172- < p className = " badge_info_icon_text" >
207+ < p className = { styles . badge_info_icon_text } >
173208 Hours in Category: As you submit hours to a project of a certain category such as
174209 'Food', 'Energy', etc you can earn badges for hitting certain levels
175210 of hours worked in each category.
176211 </ p >
177- < p className = " badge_info_icon_text" >
212+ < p className = { styles . badge_info_icon_text } >
178213 Hour Multiple: If you earn a multiple of your weekly committed hours you can earn a
179214 corresponding badge for that!
180215 </ p >
181- < p className = " badge_info_icon_text" >
216+ < p className = { styles . badge_info_icon_text } >
182217 Personal Max: This badge will be earned after your first week with the count(little red
183218 number) being the amount of hours you put in that week and updated everytime you beat
184219 it.
185220 </ p >
186- < p className = " badge_info_icon_text" >
221+ < p className = { styles . badge_info_icon_text } >
187222 Most Hours This Week: This badge will be earned if you put in the most HRs of the entire
188223 organization in a certain week.
189224 </ p >
190- < p className = " badge_info_icon_text" >
225+ < p className = { styles . badge_info_icon_text } >
191226 X Hours for X Week Streak: This badge will be earned if you put in X Number of Hours for
192227 X Weeks in a row. In the case of the one week badges the count will increase on the
193228 corresponding highest hour value badge each week. For other badges 2 weeks, 3 weeks etc.
194229 Once you earn a higher hour badge for that streak it will replace the ones below it.
195230 </ p >
196- < p className = " badge_info_icon_text" >
231+ < p className = { styles . badge_info_icon_text } >
197232 Lead a team of X+: For Managers they can earn badges for the size of the team that they
198233 lead whether it is a 5, 10, 20..etc person team.
199234 </ p >
200- < p className = " badge_info_icon_text" >
235+ < p className = { styles . badge_info_icon_text } >
201236 Auto Assignment of the previous types of Badges happens at the end of each week
202237 (Saturday Midnight PST) as your time is processed, so make sure that your time has been
203238 inputted properly by that time in order to get credit.
0 commit comments