Use old local timeline component for /public/local/fixed

This commit is contained in:
KMY 2023-07-07 10:24:35 +09:00
parent 3c1b10adf0
commit f383bb01f5
2 changed files with 18 additions and 26 deletions

View file

@ -21,7 +21,6 @@ import StatusListContainer from '../ui/containers/status_list_container';
const messages = defineMessages({
title: { id: 'column.firehose', defaultMessage: 'Live feeds' },
titleDefault: { id: 'column.community', defaultMessage: 'Local timeline' },
});
// TODO: use a proper React context later on
@ -55,7 +54,7 @@ const ColumnSettings = () => {
);
};
const Firehose = ({ feedType, defaultColumn, multiColumn }) => {
const Firehose = ({ feedType, multiColumn }) => {
const dispatch = useAppDispatch();
const intl = useIntl();
const { signedIn } = useIdentity();
@ -157,31 +156,12 @@ const Firehose = ({ feedType, defaultColumn, multiColumn }) => {
/>
);
const headerIcon = defaultColumn ? 'users' : 'globe';
const headerTitle = defaultColumn ? messages.titleDefault : messages.title;
const sectionHeadline = defaultColumn || (
<div className='account__section-headline'>
<NavLink exact to='/public/local'>
<FormattedMessage tagName='div' id='firehose.local' defaultMessage='This server' />
</NavLink>
<NavLink exact to='/public/remote'>
<FormattedMessage tagName='div' id='firehose.remote' defaultMessage='Other servers' />
</NavLink>
<NavLink exact to='/public'>
<FormattedMessage tagName='div' id='firehose.all' defaultMessage='All' />
</NavLink>
</div>
);
return (
<Column bindToDocument={!multiColumn} ref={columnRef} label={intl.formatMessage(messages.title)}>
<ColumnHeader
icon={headerIcon}
icon='globe'
active={hasUnread}
title={intl.formatMessage(headerTitle)}
title={intl.formatMessage(messages.title)}
onPin={handlePin}
onClick={handleHeaderClick}
multiColumn={multiColumn}
@ -190,7 +170,19 @@ const Firehose = ({ feedType, defaultColumn, multiColumn }) => {
</ColumnHeader>
<div className='scrollable scrollable--flex'>
{sectionHeadline}
<div className='account__section-headline'>
<NavLink exact to='/public/local'>
<FormattedMessage tagName='div' id='firehose.local' defaultMessage='This server' />
</NavLink>
<NavLink exact to='/public/remote'>
<FormattedMessage tagName='div' id='firehose.remote' defaultMessage='Other servers' />
</NavLink>
<NavLink exact to='/public'>
<FormattedMessage tagName='div' id='firehose.all' defaultMessage='All' />
</NavLink>
</div>
<StatusListContainer
prepend={prependBanner}
@ -212,7 +204,6 @@ const Firehose = ({ feedType, defaultColumn, multiColumn }) => {
}
Firehose.propTypes = {
defaultColumn: PropTypes.bool,
multiColumn: PropTypes.bool,
feedType: PropTypes.string,
};

View file

@ -66,6 +66,7 @@ import {
Onboarding,
About,
PrivacyPolicy,
CommunityTimeline,
} from './util/async-components';
import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers';
@ -197,7 +198,7 @@ class SwitchingColumnsArea extends PureComponent {
<WrappedRoute path='/public' exact component={Firehose} componentParams={{ feedType: 'public' }} content={children} />
<WrappedRoute path='/public/local' exact component={Firehose} componentParams={{ feedType: 'community' }} content={children} />
<WrappedRoute path='/public/remote' exact component={Firehose} componentParams={{ feedType: 'public:remote' }} content={children} />
<WrappedRoute path='/public/local/fixed' exact component={Firehose} componentParams={{ feedType: 'community', defaultColumn: true }} content={children} />
<WrappedRoute path='/public/local/fixed' exact component={CommunityTimeline} content={children} />
<WrappedRoute path={['/conversations', '/timelines/direct']} component={DirectTimeline} content={children} />
<WrappedRoute path='/tags/:id' component={HashtagTimeline} content={children} />
<WrappedRoute path='/lists/:id' component={ListTimeline} content={children} />