Skip to content

Commit 96d3b99

Browse files
#162 : Notifications - Remove the completed challenges section from the popup
1 parent 9c0f3da commit 96d3b99

File tree

4 files changed

+7
-58
lines changed

4 files changed

+7
-58
lines changed

dist/dev/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/prod/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/NotificationsPopup/NotificationList.js

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export default class NotificationList extends React.Component {
4848
constructor (props) {
4949
super(props)
5050
this.state = {
51-
completedSection: [],
5251
nonCompletedSection: [],
5352
unreadCount: 0
5453
}
@@ -65,8 +64,7 @@ export default class NotificationList extends React.Component {
6564

6665
render () {
6766
const { onClose, onSettings, notifications, onDismiss, unReadNotifications,
68-
markNotificationAsRead, markAllNotificationAsRead,
69-
dismissChallengeNotifications, auth } = this.props
67+
markNotificationAsRead, markAllNotificationAsRead, auth } = this.props
7068

7169
return (
7270
<>
@@ -126,7 +124,7 @@ export default class NotificationList extends React.Component {
126124
</div>
127125
</div>
128126
<div className={styles['noti-body']}>
129-
<Fragment key='nonComplete'>
127+
<Fragment>
130128
{
131129
this.challenges(_.uniq((notifications || [])).filter(t => !eventTypes.PROJECT.COMPLETED.includes(t.eventType))).map((challenge, challengeIdx) =>
132130
(
@@ -146,23 +144,6 @@ export default class NotificationList extends React.Component {
146144
))
147145
}
148146
</Fragment>
149-
<div className={styles['completed-header']}>Completed Challenges</div>
150-
<Fragment key='completed'>
151-
{
152-
this.challenges(_.uniq((notifications || [])).filter(t => eventTypes.PROJECT.COMPLETED.includes(t.eventType))).map((challenge, challengeIdx) =>
153-
(
154-
<div key={`noti-completed-${challengeIdx}`} className={cn([styles['challenge-title'], styles['completed-challenge']])}>
155-
<span>{challenge.challengeTitle}</span>
156-
<div className={styles['dismiss-challenge']} onClick={c => {
157-
const challegeId = challenge && challenge.items && challenge.items.length && challenge.items[0].sourceId
158-
if (challegeId) {
159-
dismissChallengeNotifications(challegeId, auth.tokenV3)
160-
}
161-
}}>&times;</div>
162-
</div>
163-
))
164-
}
165-
</Fragment>
166147
</div>
167148
<div className={styles['view-all-notifications']}>
168149
<a href='/notifications'>View all Notifications</a>
@@ -211,6 +192,5 @@ NotificationList.propTypes = {
211192
onClose: PropTypes.func,
212193
unReadNotifications: PropTypes.bool,
213194
markNotificationAsRead: PropTypes.func.isRequired,
214-
markAllNotificationAsRead: PropTypes.func.isRequired,
215-
dismissChallengeNotifications: PropTypes.func.isRequired
195+
markAllNotificationAsRead: PropTypes.func.isRequired
216196
}

src/components/NotificationsPopup/styles.module.scss

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -175,38 +175,7 @@
175175
padding-left: 20px;
176176
margin-top: -2px;
177177
padding: 5px 20px;
178-
}
179-
.completed-challenge {
180-
display: flex;
181-
justify-content: space-between;
182-
background-color: $gray-04;
183-
font-size: 14px;
184-
@include Roboto-Bold;
185-
font-weight: 500;
186-
line-height: 22px;
187-
padding: 5px 20px;
188-
margin-top: 5px;
189-
.dismiss-challenge {
190-
cursor:pointer;
191-
color: #aaaaaa;
192-
@include Roboto-Regular;
193-
font-size: 20px;
194-
margin: auto 0px;
195-
}
196-
}
197-
.completed-header {
198-
background-color: $gray-06;
199-
text-transform: uppercase;
200-
color: $gray-90;
201-
font-size: 14px;
202-
@include Roboto-Bold;
203-
line-height: 22px;
204-
padding-top: 15px;
205-
padding-bottom: 13px;
206-
padding-left: 20px;
207-
page-break-after: auto;
208-
}
209-
178+
}
210179
.greybar-section {
211180
&:last-child {
212181
.items {

0 commit comments

Comments
 (0)