From 375af259a2721a70055f3cfd9d0782b9a41fcc5c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 20 Mar 2024 18:21:03 +0100 Subject: [PATCH] [Glitch] Change back button to always appear in advanced web UI Port be52633ee4ce4a14b48f82156cf64c0a3eb9835b to glitch-soc Signed-off-by: Claire --- .../glitch/components/column_header.jsx | 23 ++++++++----------- .../glitch/features/follow_requests/index.jsx | 2 +- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/app/javascript/flavours/glitch/components/column_header.jsx b/app/javascript/flavours/glitch/components/column_header.jsx index c2524b6dd9..0177812480 100644 --- a/app/javascript/flavours/glitch/components/column_header.jsx +++ b/app/javascript/flavours/glitch/components/column_header.jsx @@ -13,7 +13,7 @@ import ChevronRightIcon from '@/material-icons/400-24px/chevron_right.svg?react' import CloseIcon from '@/material-icons/400-24px/close.svg?react'; import SettingsIcon from '@/material-icons/400-24px/settings.svg?react'; import { Icon } from 'flavours/glitch/components/icon'; -import { ButtonInTabsBar, useColumnsContext } from 'flavours/glitch/features/ui/util/columns_context'; +import { ButtonInTabsBar } from 'flavours/glitch/features/ui/util/columns_context'; import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; import { useAppHistory } from './router'; @@ -26,10 +26,9 @@ const messages = defineMessages({ back: { id: 'column_back_button.label', defaultMessage: 'Back' }, }); -const BackButton = ({ pinned, show, onlyIcon }) => { +const BackButton = ({ onlyIcon }) => { const history = useAppHistory(); const intl = useIntl(); - const { multiColumn } = useColumnsContext(); const handleBackClick = useCallback(() => { if (history.location?.state?.fromMastodon) { @@ -39,10 +38,6 @@ const BackButton = ({ pinned, show, onlyIcon }) => { } }, [history]); - const showButton = history && !pinned && ((multiColumn && history.location?.state?.fromMastodon) || show); - - if (!showButton) return null; - return ( ; } - backButton = ; + if (history && !pinned && ((multiColumn && history.location?.state?.fromMastodon) || showBackButton)) { + backButton = ; + } const collapsedContent = [ extraContent, @@ -199,16 +194,16 @@ class ColumnHeader extends PureComponent {

{hasTitle && ( <> - {showBackButton && backButton} + {backButton} )} - {!hasTitle && showBackButton && backButton} + {!hasTitle && backButton}
{extraButton} diff --git a/app/javascript/flavours/glitch/features/follow_requests/index.jsx b/app/javascript/flavours/glitch/features/follow_requests/index.jsx index 7d651f2ca6..a8f40a31d0 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/index.jsx +++ b/app/javascript/flavours/glitch/features/follow_requests/index.jsx @@ -68,7 +68,7 @@ class FollowRequests extends ImmutablePureComponent { ); return ( - +