From 705b4a29bc5a055dd8e46d1c7729019660ff020b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 12 Oct 2023 23:43:52 +0200 Subject: [PATCH] Improve UI, open compose modals in separate window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/actions/compose.ts | 8 ++++++-- src/components/scroll-top-button.tsx | 2 +- src/components/status-content.tsx | 8 ++++---- src/features/ui/components/compose-button.tsx | 2 +- .../modals/compose-event-modal/compose-event-modal.tsx | 2 +- src/features/ui/util/global-hotkeys.tsx | 2 +- src/locales/en.json | 2 +- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/actions/compose.ts b/src/actions/compose.ts index 00a52d017..94e7d30c0 100644 --- a/src/actions/compose.ts +++ b/src/actions/compose.ts @@ -150,7 +150,9 @@ interface ComposeReplyAction { const replyCompose = (status: Status) => (dispatch: AppDispatch, getState: () => RootState) => { - if (!isUserTouching()) return window.open(`/compose?in_reply_to=${status.id}`, '_blank'); + if (!isUserTouching()) { + return window.open(`/compose?in_reply_to=${status.id}`, 'targetWindow', 'height=500,width=700'); + } const state = getState(); const instance = state.instance; const { explicitAddressing } = getFeatures(instance); @@ -187,7 +189,9 @@ interface ComposeQuoteAction { const quoteCompose = (status: Status) => (dispatch: AppDispatch, getState: () => RootState) => { - if (!isUserTouching()) return window.open(`/compose?quote=${status.id}`, '_blank'); + if (!isUserTouching()) { + return window.open(`/compose?quote=${status.id}`, 'targetWindow', 'height=500,width=700'); + } const state = getState(); const instance = state.instance; const { explicitAddressing } = getFeatures(instance); diff --git a/src/components/scroll-top-button.tsx b/src/components/scroll-top-button.tsx index 58d356c2a..224921725 100644 --- a/src/components/scroll-top-button.tsx +++ b/src/components/scroll-top-button.tsx @@ -86,7 +86,7 @@ const ScrollTopButton: React.FC = ({ } return ( -
+