diff --git a/app/javascript/flavours/glitch/components/column_header.jsx b/app/javascript/flavours/glitch/components/column_header.jsx index 700a02a0eca0f4..22e73f5211b31c 100644 --- a/app/javascript/flavours/glitch/components/column_header.jsx +++ b/app/javascript/flavours/glitch/components/column_header.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import { PureComponent, useCallback } from 'react'; -import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'; +import { FormattedMessage, injectIntl, defineMessages, useIntl } from 'react-intl'; import classNames from 'classnames'; import { withRouter } from 'react-router-dom'; @@ -23,10 +23,12 @@ const messages = defineMessages({ hide: { id: 'column_header.hide_settings', defaultMessage: 'Hide settings' }, moveLeft: { id: 'column_header.moveLeft_settings', defaultMessage: 'Move column to the left' }, moveRight: { id: 'column_header.moveRight_settings', defaultMessage: 'Move column to the right' }, + back: { id: 'column_back_button.label', defaultMessage: 'Back' }, }); -const BackButton = ({ pinned, show }) => { +const BackButton = ({ pinned, show, onlyIcon }) => { const history = useAppHistory(); + const intl = useIntl(); const { multiColumn } = useColumnsContext(); const handleBackClick = useCallback(() => { @@ -39,12 +41,12 @@ const BackButton = ({ pinned, show }) => { const showButton = history && !pinned && ((multiColumn && history.location?.state?.fromMastodon) || show); - if(!showButton) return null; + if (!showButton) return null; return ( - ); }; @@ -52,6 +54,7 @@ const BackButton = ({ pinned, show }) => { BackButton.propTypes = { pinned: PropTypes.bool, show: PropTypes.bool, + onlyIcon: PropTypes.bool, }; class ColumnHeader extends PureComponent { @@ -146,16 +149,16 @@ class ColumnHeader extends PureComponent { } if (multiColumn && pinned) { - pinButton = ; + pinButton = ; moveButtons = ( -
+
); } else if (multiColumn && this.props.onPin) { - pinButton = ; + pinButton = ; } backButton = ; @@ -165,8 +168,12 @@ class ColumnHeader extends PureComponent { ]; if (multiColumn) { - collapsedContent.push(pinButton); - collapsedContent.push(moveButtons); + collapsedContent.push( +
+ {pinButton} + {moveButtons} +
+ ); } if (this.context.identity.signedIn && (children || (multiColumn && this.props.onPin))) { @@ -191,16 +198,19 @@ class ColumnHeader extends PureComponent {

{hasTitle && ( - + <> + {backButton} + + + )} {!hasTitle && backButton}
- {hasTitle && backButton} {extraButton} {collapseButton}
diff --git a/app/javascript/flavours/glitch/styles/components.scss b/app/javascript/flavours/glitch/styles/components.scss index 488596de510f51..6a639d5bd2e9c5 100644 --- a/app/javascript/flavours/glitch/styles/components.scss +++ b/app/javascript/flavours/glitch/styles/components.scss @@ -4257,7 +4257,7 @@ a.status-card { z-index: 2; outline: 0; - & > button { + &__title { display: flex; align-items: center; gap: 5px; @@ -4279,8 +4279,18 @@ a.status-card { } } - & > .column-header__back-button { + .column-header__back-button + &__title { + padding-inline-start: 0; + } + + .column-header__back-button { + flex: 1; color: $highlight-text-color; + + &.compact { + flex: 0 0 auto; + color: $primary-text-color; + } } &.active { @@ -4294,6 +4304,18 @@ a.status-card { &:active { outline: 0; } + + &__advanced-buttons { + display: flex; + justify-content: space-between; + align-items: center; + padding: 16px; + padding-top: 0; + + &:first-child { + padding-top: 16px; + } + } } .column-header__buttons {