Status: hide column header and back button

This commit is contained in:
Alex Gleason 2021-09-12 19:36:18 -05:00
parent a3f162a2ea
commit 41f2c6afd6
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 17 additions and 8 deletions

View File

@ -36,7 +36,7 @@ import {
import { initMuteModal } from '../../actions/mutes'; import { initMuteModal } from '../../actions/mutes';
import { initReport } from '../../actions/reports'; import { initReport } from '../../actions/reports';
import { makeGetStatus } from '../../selectors'; import { makeGetStatus } from '../../selectors';
import ColumnHeader from '../../components/column_header'; // import ColumnHeader from '../../components/column_header';
import StatusContainer from '../../containers/status_container'; import StatusContainer from '../../containers/status_container';
import { openModal } from '../../actions/modal'; import { openModal } from '../../actions/modal';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
@ -45,7 +45,7 @@ import { createSelector } from 'reselect';
import { HotKeys } from 'react-hotkeys'; import { HotKeys } from 'react-hotkeys';
import { attachFullscreenListener, detachFullscreenListener, isFullscreen } from '../ui/util/fullscreen'; import { attachFullscreenListener, detachFullscreenListener, isFullscreen } from '../ui/util/fullscreen';
import { textForScreenReader, defaultMediaVisibility } from '../../components/status'; import { textForScreenReader, defaultMediaVisibility } from '../../components/status';
import Icon from 'soapbox/components/icon'; // import Icon from 'soapbox/components/icon';
import { getSettings } from 'soapbox/actions/settings'; import { getSettings } from 'soapbox/actions/settings';
import { getSoapboxConfig } from 'soapbox/actions/soapbox'; import { getSoapboxConfig } from 'soapbox/actions/soapbox';
import { deactivateUserModal, deleteUserModal, deleteStatusModal, toggleStatusSensitivityModal } from 'soapbox/actions/moderation'; import { deactivateUserModal, deleteUserModal, deleteStatusModal, toggleStatusSensitivityModal } from 'soapbox/actions/moderation';
@ -535,7 +535,7 @@ class Status extends ImmutablePureComponent {
render() { render() {
let ancestors, descendants; let ancestors, descendants;
const { status, ancestorsIds, descendantsIds, intl, domain, me } = this.props; const { status, ancestorsIds, descendantsIds, intl, domain } = this.props;
if (status === null) { if (status === null) {
return ( return (
@ -568,8 +568,12 @@ class Status extends ImmutablePureComponent {
}; };
return ( return (
<Column label={intl.formatMessage(messages.detailedStatus)}> <Column label={intl.formatMessage(messages.detailedStatus)} showBackBtn={false}>
{ me && {/*
Eye icon to show/hide all CWs in a thread.
I'm not convinced of the value of this. It needs a better design at the very least.
*/}
{/* me &&
<ColumnHeader <ColumnHeader
extraButton={( extraButton={(
<button <button
@ -586,7 +590,7 @@ class Status extends ImmutablePureComponent {
</button> </button>
)} )}
/> />
} */}
<div ref={this.setRef}> <div ref={this.setRef}>
{ancestors} {ancestors}

View File

@ -12,18 +12,23 @@ export default class Column extends React.PureComponent {
children: PropTypes.node, children: PropTypes.node,
active: PropTypes.bool, active: PropTypes.bool,
backBtnSlim: PropTypes.bool, backBtnSlim: PropTypes.bool,
showBackBtn: PropTypes.bool,
back: PropTypes.string, back: PropTypes.string,
}; };
static defaultProps = {
showBackBtn: true,
}
render() { render() {
const { heading, icon, children, active, backBtnSlim, back } = this.props; const { heading, icon, children, active, backBtnSlim, showBackBtn, back } = this.props;
const columnHeaderId = heading && heading.replace(/ /g, '-'); const columnHeaderId = heading && heading.replace(/ /g, '-');
const backBtn = backBtnSlim ? (<ColumnBackButtonSlim to={back} />) : (<ColumnBackButton to={back} />); const backBtn = backBtnSlim ? (<ColumnBackButtonSlim to={back} />) : (<ColumnBackButton to={back} />);
return ( return (
<div role='region' aria-labelledby={columnHeaderId} className='column'> <div role='region' aria-labelledby={columnHeaderId} className='column'>
{heading && <ColumnHeader icon={icon} active={active} type={heading} columnHeaderId={columnHeaderId} />} {heading && <ColumnHeader icon={icon} active={active} type={heading} columnHeaderId={columnHeaderId} />}
{backBtn} {showBackBtn ? backBtn : null}
{children} {children}
</div> </div>
); );