Adding empty state for request list.

pull/2222/head
warrickct 3 years ago
parent dcd78e85f6
commit 09bcbe6139

@ -472,5 +472,6 @@
"respondingToRequestWarning": "Sending a message to this user will automatically accept their message request and reveal your Session ID.", "respondingToRequestWarning": "Sending a message to this user will automatically accept their message request and reveal your Session ID.",
"hideRequestBanner": "Hide Message Request Banner", "hideRequestBanner": "Hide Message Request Banner",
"openMessageRequestInbox": "View Message Requests", "openMessageRequestInbox": "View Message Requests",
"noMessageRequestsPending": "No pending message requests",
"openMessageRequestInboxDescription": "View your Message Request inbox" "openMessageRequestInboxDescription": "View your Message Request inbox"
} }

@ -57,14 +57,16 @@ export const OverlayMessageRequest = () => {
function closeOverlay() { function closeOverlay() {
dispatch(setOverlayMode(undefined)); dispatch(setOverlayMode(undefined));
} }
const hasRequests = useSelector(getConversationRequests).length > 0;
const buttonText = window.i18n('clearAll'); const buttonText = window.i18n('clearAll');
return ( return (
<div className="module-left-pane-overlay"> <div className="module-left-pane-overlay">
{hasRequests ? (
<>
<MessageRequestList /> <MessageRequestList />
<SpacerLG /> <SpacerLG />
<SessionButton <SessionButton
buttonColor={SessionButtonColor.Danger} buttonColor={SessionButtonColor.Danger}
buttonType={SessionButtonType.BrandOutline} buttonType={SessionButtonType.BrandOutline}
@ -73,10 +75,23 @@ export const OverlayMessageRequest = () => {
void handleBlockAllRequestsClick(); void handleBlockAllRequestsClick();
}} }}
/> />
</>
) : (
<>
<SpacerLG />
<MessageRequestListPlaceholder>
{window.i18n('noMessageRequestsPending')}
</MessageRequestListPlaceholder>
</>
)}
</div> </div>
); );
}; };
const MessageRequestListPlaceholder = styled.div`
color: var(--color-text);
`;
const MessageRequestListContainer = styled.div` const MessageRequestListContainer = styled.div`
width: 100%; width: 100%;
overflow-y: auto; overflow-y: auto;

@ -475,4 +475,5 @@ export type LocalizerKeys =
| 'openMessageRequestInbox' | 'openMessageRequestInbox'
| 'openMessageRequestInboxDescription' | 'openMessageRequestInboxDescription'
| 'hideRequestBanner' | 'hideRequestBanner'
| 'noMessageRequestsPending'
| 'reportIssue'; | 'reportIssue';

Loading…
Cancel
Save