Adding empty state for request list.

This commit is contained in:
warrickct 2022-02-17 18:35:58 +11:00
parent dcd78e85f6
commit 09bcbe6139
3 changed files with 28 additions and 11 deletions

View File

@ -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"
}

View File

@ -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;

View File

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