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({ const messages = defineMessages({
title: { id: 'column.firehose', defaultMessage: 'Live feeds' }, title: { id: 'column.firehose', defaultMessage: 'Live feeds' },
titleDefault: { id: 'column.community', defaultMessage: 'Local timeline' },
}); });
// TODO: use a proper React context later on // 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 dispatch = useAppDispatch();
const intl = useIntl(); const intl = useIntl();
const { signedIn } = useIdentity(); 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 ( return (
<Column bindToDocument={!multiColumn} ref={columnRef} label={intl.formatMessage(messages.title)}> <Column bindToDocument={!multiColumn} ref={columnRef} label={intl.formatMessage(messages.title)}>
<ColumnHeader <ColumnHeader
icon={headerIcon} icon='globe'
active={hasUnread} active={hasUnread}
title={intl.formatMessage(headerTitle)} title={intl.formatMessage(messages.title)}
onPin={handlePin} onPin={handlePin}
onClick={handleHeaderClick} onClick={handleHeaderClick}
multiColumn={multiColumn} multiColumn={multiColumn}
@ -190,7 +170,19 @@ const Firehose = ({ feedType, defaultColumn, multiColumn }) => {
</ColumnHeader> </ColumnHeader>
<div className='scrollable scrollable--flex'> <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 <StatusListContainer
prepend={prependBanner} prepend={prependBanner}
@ -212,7 +204,6 @@ const Firehose = ({ feedType, defaultColumn, multiColumn }) => {
} }
Firehose.propTypes = { Firehose.propTypes = {
defaultColumn: PropTypes.bool,
multiColumn: PropTypes.bool, multiColumn: PropTypes.bool,
feedType: PropTypes.string, feedType: PropTypes.string,
}; };

View file

@ -66,6 +66,7 @@ import {
Onboarding, Onboarding,
About, About,
PrivacyPolicy, PrivacyPolicy,
CommunityTimeline,
} from './util/async-components'; } from './util/async-components';
import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers'; 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' exact component={Firehose} componentParams={{ feedType: 'public' }} content={children} />
<WrappedRoute path='/public/local' exact component={Firehose} componentParams={{ feedType: 'community' }} 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/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={['/conversations', '/timelines/direct']} component={DirectTimeline} content={children} />
<WrappedRoute path='/tags/:id' component={HashtagTimeline} content={children} /> <WrappedRoute path='/tags/:id' component={HashtagTimeline} content={children} />
<WrappedRoute path='/lists/:id' component={ListTimeline} content={children} /> <WrappedRoute path='/lists/:id' component={ListTimeline} content={children} />