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.",
"hideRequestBanner": "Hide Message Request Banner",
"openMessageRequestInbox": "View Message Requests",
"noMessageRequestsPending": "No pending message requests",
"openMessageRequestInboxDescription": "View your Message Request inbox"
}

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

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

Loading…
Cancel
Save