From 2212f43b5c90a62fd38e0a67470c0e4b741e75b4 Mon Sep 17 00:00:00 2001 From: Nicholas Zuber Date: Tue, 27 Nov 2018 15:22:30 -0500 Subject: [PATCH] Hide page count if no notifications --- src/pages/Notifications/Scene.js | 278 ++++++++++++++++--------------- 1 file changed, 140 insertions(+), 138 deletions(-) diff --git a/src/pages/Notifications/Scene.js b/src/pages/Notifications/Scene.js index cc53d3e..6a72135 100644 --- a/src/pages/Notifications/Scene.js +++ b/src/pages/Notifications/Scene.js @@ -1119,155 +1119,157 @@ export default function Scene ({ 🎉 You're all set here for the moment

) : ( - - - {notifications.map(n => ( - - -
- {getPRIssueIcon(n.type, n.reasons)} -
-
- { - window.open(n.url); - onStageThread(n.id, n.repository) - }}> - - {n.name} - - - {getRelativeTime(n.updated_at)} - {n.isAuthor && ( - +
+ + {notifications.map(n => ( + + +
+ {getPRIssueIcon(n.type, n.reasons)} +
+
+ { + window.open(n.url); + onStageThread(n.id, n.repository) + }}> + + {n.name} + + + {getRelativeTime(n.updated_at)} + {n.isAuthor && ( + + )} + + + - )} - - - - {getMessageFromReasons(n.reasons, n.type)} - - - - - {activeStatus === Status.QUEUED && n.badges.map(badge => { - switch (badge) { - case Badges.HOT: - // lots of `reasons` within short time frame - return ( - - ); - case Badges.OLD: - // old - return ( - - ); - case Badges.COMMENTS: - // lots of `reasons` - return ( - - ); - default: - return null; - } - })} - - - - window.open(n.repositoryUrl)} - style={{cursor: 'pointer', userSelect: 'none'}}> - {n.repository} - - - - +{n.score} - - {activeStatus === Status.QUEUED ? ( + {getMessageFromReasons(n.reasons, n.type)} + + + + + {activeStatus === Status.QUEUED && n.badges.map(badge => { + switch (badge) { + case Badges.HOT: + // lots of `reasons` within short time frame + return ( + + ); + case Badges.OLD: + // old + return ( + + ); + case Badges.COMMENTS: + // lots of `reasons` + return ( + + ); + default: + return null; + } + })} + + + + window.open(n.repositoryUrl)} + style={{cursor: 'pointer', userSelect: 'none'}}> + {n.repository} + + - onStageThread(n.id, n.repository)) : undefined} - /> - - ) : ( - - onRestoreThread(n.id)) : undefined} - /> - - )} - {activeStatus === Status.CLOSED ? ( - -   + +{n.score} + {activeStatus === Status.QUEUED ? ( + + onStageThread(n.id, n.repository)) : undefined} + /> + ) : ( - - onMarkAsRead(n.id, n.repository)) : undefined} - /> - - )} - -
- ))} - -
+ + onRestoreThread(n.id)) : undefined} + /> + + )} + {activeStatus === Status.CLOSED ? ( + +   + + ) : ( + + onMarkAsRead(n.id, n.repository)) : undefined} + /> + + )} + + + ))} + + + {!loading && Page {page} out of {lastPage}} + )} - {!loading && Page {page} out of {lastPage}}