Always render dialogs in left pane
This commit is contained in:
parent
f3e207d0b0
commit
25f271e61c
3 changed files with 19 additions and 31 deletions
|
@ -244,6 +244,20 @@ export const LeftPane: React.FC<PropsType> = ({
|
||||||
const { ctrlKey, shiftKey, altKey, metaKey, key } = event;
|
const { ctrlKey, shiftKey, altKey, metaKey, key } = event;
|
||||||
const commandOrCtrl = OS.isMacOS() ? metaKey : ctrlKey;
|
const commandOrCtrl = OS.isMacOS() ? metaKey : ctrlKey;
|
||||||
|
|
||||||
|
if (event.key === 'Escape') {
|
||||||
|
const backAction = helper.getBackAction({
|
||||||
|
showInbox,
|
||||||
|
startComposing,
|
||||||
|
showChooseGroupMembers,
|
||||||
|
});
|
||||||
|
if (backAction) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
backAction();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
commandOrCtrl &&
|
commandOrCtrl &&
|
||||||
!shiftKey &&
|
!shiftKey &&
|
||||||
|
@ -314,6 +328,8 @@ export const LeftPane: React.FC<PropsType> = ({
|
||||||
openConversationInternal,
|
openConversationInternal,
|
||||||
selectedConversationId,
|
selectedConversationId,
|
||||||
selectedMessageId,
|
selectedMessageId,
|
||||||
|
showChooseGroupMembers,
|
||||||
|
showInbox,
|
||||||
startComposing,
|
startComposing,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -371,23 +387,7 @@ export const LeftPane: React.FC<PropsType> = ({
|
||||||
// [0]: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/645900a0e296ca7053dbf6cd9e12cc85849de2d5/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events
|
// [0]: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/645900a0e296ca7053dbf6cd9e12cc85849de2d5/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events
|
||||||
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
||||||
return (
|
return (
|
||||||
<div
|
<div className="module-left-pane">
|
||||||
className="module-left-pane"
|
|
||||||
onKeyDown={event => {
|
|
||||||
if (event.key === 'Escape') {
|
|
||||||
const backAction = helper.getBackAction({
|
|
||||||
showInbox,
|
|
||||||
startComposing,
|
|
||||||
showChooseGroupMembers,
|
|
||||||
});
|
|
||||||
if (backAction) {
|
|
||||||
event.preventDefault();
|
|
||||||
event.stopPropagation();
|
|
||||||
backAction();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* eslint-enable jsx-a11y/no-static-element-interactions */}
|
{/* eslint-enable jsx-a11y/no-static-element-interactions */}
|
||||||
<div className="module-left-pane__header">
|
<div className="module-left-pane__header">
|
||||||
{helper.getHeaderContents({
|
{helper.getHeaderContents({
|
||||||
|
@ -399,12 +399,8 @@ export const LeftPane: React.FC<PropsType> = ({
|
||||||
</div>
|
</div>
|
||||||
{renderExpiredBuildDialog()}
|
{renderExpiredBuildDialog()}
|
||||||
{renderRelinkDialog()}
|
{renderRelinkDialog()}
|
||||||
{helper.shouldRenderNetworkStatusAndUpdateDialog() && (
|
{renderNetworkStatus()}
|
||||||
<>
|
{renderUpdateDialog()}
|
||||||
{renderNetworkStatus()}
|
|
||||||
{renderUpdateDialog()}
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
{preRowsNode && <React.Fragment key={0}>{preRowsNode}</React.Fragment>}
|
{preRowsNode && <React.Fragment key={0}>{preRowsNode}</React.Fragment>}
|
||||||
<Measure bounds>
|
<Measure bounds>
|
||||||
{({ contentRect, measureRef }: MeasuredComponentProps) => (
|
{({ contentRect, measureRef }: MeasuredComponentProps) => (
|
||||||
|
|
|
@ -40,10 +40,6 @@ export abstract class LeftPaneHelper<T> {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldRenderNetworkStatusAndUpdateDialog(): boolean {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getPreRowsNode(
|
getPreRowsNode(
|
||||||
_: Readonly<{
|
_: Readonly<{
|
||||||
clearGroupCreationError: () => void;
|
clearGroupCreationError: () => void;
|
||||||
|
|
|
@ -38,10 +38,6 @@ export class LeftPaneInboxHelper extends LeftPaneHelper<LeftPaneInboxPropsType>
|
||||||
this.pinnedConversations = pinnedConversations;
|
this.pinnedConversations = pinnedConversations;
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldRenderNetworkStatusAndUpdateDialog(): boolean {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
getRowCount(): number {
|
getRowCount(): number {
|
||||||
const headerCount = this.hasPinnedAndNonpinned() ? 2 : 0;
|
const headerCount = this.hasPinnedAndNonpinned() ? 2 : 0;
|
||||||
const buttonCount = this.archivedConversations.length ? 1 : 0;
|
const buttonCount = this.archivedConversations.length ? 1 : 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue