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,26 +57,41 @@ 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">
<MessageRequestList /> {hasRequests ? (
<SpacerLG /> <>
<MessageRequestList />
<SessionButton <SpacerLG />
buttonColor={SessionButtonColor.Danger} <SessionButton
buttonType={SessionButtonType.BrandOutline} buttonColor={SessionButtonColor.Danger}
text={buttonText} buttonType={SessionButtonType.BrandOutline}
onClick={() => { text={buttonText}
void handleBlockAllRequestsClick(); onClick={() => {
}} 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