Come back local timeline menu in navigation
This commit is contained in:
parent
398985f8a2
commit
0273a61fb2
6 changed files with 32 additions and 17 deletions
|
@ -21,6 +21,7 @@ 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
|
||||
|
@ -54,7 +55,7 @@ const ColumnSettings = () => {
|
|||
);
|
||||
};
|
||||
|
||||
const Firehose = ({ feedType, multiColumn }) => {
|
||||
const Firehose = ({ feedType, defaultColumn, multiColumn }) => {
|
||||
const dispatch = useAppDispatch();
|
||||
const intl = useIntl();
|
||||
const { signedIn } = useIdentity();
|
||||
|
@ -156,12 +157,31 @@ const Firehose = ({ feedType, 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='globe'
|
||||
icon={headerIcon}
|
||||
active={hasUnread}
|
||||
title={intl.formatMessage(messages.title)}
|
||||
title={intl.formatMessage(headerTitle)}
|
||||
onPin={handlePin}
|
||||
onClick={handleHeaderClick}
|
||||
multiColumn={multiColumn}
|
||||
|
@ -170,19 +190,7 @@ const Firehose = ({ feedType, multiColumn }) => {
|
|||
</ColumnHeader>
|
||||
|
||||
<div className='scrollable scrollable--flex'>
|
||||
<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>
|
||||
{sectionHeadline}
|
||||
|
||||
<StatusListContainer
|
||||
prepend={prependBanner}
|
||||
|
@ -204,6 +212,7 @@ const Firehose = ({ feedType, multiColumn }) => {
|
|||
}
|
||||
|
||||
Firehose.propTypes = {
|
||||
defaultColumn: PropTypes.bool,
|
||||
multiColumn: PropTypes.bool,
|
||||
feedType: PropTypes.string,
|
||||
};
|
||||
|
|
|
@ -20,6 +20,7 @@ const messages = defineMessages({
|
|||
home: { id: 'tabs_bar.home', defaultMessage: 'Home' },
|
||||
notifications: { id: 'tabs_bar.notifications', defaultMessage: 'Notifications' },
|
||||
explore: { id: 'explore.title', defaultMessage: 'Explore' },
|
||||
local: { id: 'column.local', defaultMessage: 'Local' },
|
||||
firehose: { id: 'column.firehose', defaultMessage: 'Live feeds' },
|
||||
direct: { id: 'navigation_bar.direct', defaultMessage: 'Private mentions' },
|
||||
favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' },
|
||||
|
@ -43,7 +44,7 @@ class NavigationPanel extends Component {
|
|||
};
|
||||
|
||||
isFirehoseActive = (match, location) => {
|
||||
return match || location.pathname.startsWith('/public');
|
||||
return (match || location.pathname.startsWith('/public')) && !location.pathname.endsWith('/fixed');
|
||||
};
|
||||
|
||||
render () {
|
||||
|
@ -67,6 +68,7 @@ class NavigationPanel extends Component {
|
|||
<>
|
||||
<ColumnLink transparent to='/notifications' icon={<NotificationsCounterIcon className='column-link__icon' />} text={intl.formatMessage(messages.notifications)} />
|
||||
<ColumnLink transparent to='/home' icon='home' text={intl.formatMessage(messages.home)} />
|
||||
<ColumnLink transparent to='/public/local/fixed' icon='users' text={intl.formatMessage(messages.local)} />
|
||||
</>
|
||||
)}
|
||||
|
||||
|
|
|
@ -197,6 +197,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={['/conversations', '/timelines/direct']} component={DirectTimeline} content={children} />
|
||||
<WrappedRoute path='/tags/:id' component={HashtagTimeline} content={children} />
|
||||
<WrappedRoute path='/lists/:id' component={ListTimeline} content={children} />
|
||||
|
|
|
@ -120,6 +120,7 @@
|
|||
"column.follow_requests": "Follow requests",
|
||||
"column.home": "Home",
|
||||
"column.lists": "Lists",
|
||||
"column.local": "Local",
|
||||
"column.mutes": "Muted users",
|
||||
"column.notifications": "Notifications",
|
||||
"column.pins": "Pinned posts",
|
||||
|
|
|
@ -113,6 +113,7 @@
|
|||
"column.follow_requests": "フォローリクエスト",
|
||||
"column.home": "ホーム",
|
||||
"column.lists": "リスト",
|
||||
"column.local": "ローカル",
|
||||
"column.mutes": "ミュートしたユーザー",
|
||||
"column.notifications": "通知",
|
||||
"column.pins": "固定された投稿",
|
||||
|
|
|
@ -12,6 +12,7 @@ Rails.application.routes.draw do
|
|||
/home
|
||||
/public
|
||||
/public/local
|
||||
/public/local/fixed
|
||||
/public/remote
|
||||
/conversations
|
||||
/lists/(*any)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue