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({
|
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
|
||||||
|
@ -54,7 +55,7 @@ const ColumnSettings = () => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const Firehose = ({ feedType, multiColumn }) => {
|
const Firehose = ({ feedType, defaultColumn, multiColumn }) => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const { signedIn } = useIdentity();
|
const { signedIn } = useIdentity();
|
||||||
|
@ -156,20 +157,10 @@ const Firehose = ({ feedType, multiColumn }) => {
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
const headerIcon = defaultColumn ? 'users' : 'globe';
|
||||||
<Column bindToDocument={!multiColumn} ref={columnRef} label={intl.formatMessage(messages.title)}>
|
const headerTitle = defaultColumn ? messages.titleDefault : messages.title;
|
||||||
<ColumnHeader
|
|
||||||
icon='globe'
|
|
||||||
active={hasUnread}
|
|
||||||
title={intl.formatMessage(messages.title)}
|
|
||||||
onPin={handlePin}
|
|
||||||
onClick={handleHeaderClick}
|
|
||||||
multiColumn={multiColumn}
|
|
||||||
>
|
|
||||||
<ColumnSettings />
|
|
||||||
</ColumnHeader>
|
|
||||||
|
|
||||||
<div className='scrollable scrollable--flex'>
|
const sectionHeadline = defaultColumn || (
|
||||||
<div className='account__section-headline'>
|
<div className='account__section-headline'>
|
||||||
<NavLink exact to='/public/local'>
|
<NavLink exact to='/public/local'>
|
||||||
<FormattedMessage tagName='div' id='firehose.local' defaultMessage='This server' />
|
<FormattedMessage tagName='div' id='firehose.local' defaultMessage='This server' />
|
||||||
|
@ -183,6 +174,23 @@ const Firehose = ({ feedType, multiColumn }) => {
|
||||||
<FormattedMessage tagName='div' id='firehose.all' defaultMessage='All' />
|
<FormattedMessage tagName='div' id='firehose.all' defaultMessage='All' />
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Column bindToDocument={!multiColumn} ref={columnRef} label={intl.formatMessage(messages.title)}>
|
||||||
|
<ColumnHeader
|
||||||
|
icon={headerIcon}
|
||||||
|
active={hasUnread}
|
||||||
|
title={intl.formatMessage(headerTitle)}
|
||||||
|
onPin={handlePin}
|
||||||
|
onClick={handleHeaderClick}
|
||||||
|
multiColumn={multiColumn}
|
||||||
|
>
|
||||||
|
<ColumnSettings />
|
||||||
|
</ColumnHeader>
|
||||||
|
|
||||||
|
<div className='scrollable scrollable--flex'>
|
||||||
|
{sectionHeadline}
|
||||||
|
|
||||||
<StatusListContainer
|
<StatusListContainer
|
||||||
prepend={prependBanner}
|
prepend={prependBanner}
|
||||||
|
@ -204,6 +212,7 @@ const Firehose = ({ feedType, multiColumn }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
Firehose.propTypes = {
|
Firehose.propTypes = {
|
||||||
|
defaultColumn: PropTypes.bool,
|
||||||
multiColumn: PropTypes.bool,
|
multiColumn: PropTypes.bool,
|
||||||
feedType: PropTypes.string,
|
feedType: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,6 +20,7 @@ const messages = defineMessages({
|
||||||
home: { id: 'tabs_bar.home', defaultMessage: 'Home' },
|
home: { id: 'tabs_bar.home', defaultMessage: 'Home' },
|
||||||
notifications: { id: 'tabs_bar.notifications', defaultMessage: 'Notifications' },
|
notifications: { id: 'tabs_bar.notifications', defaultMessage: 'Notifications' },
|
||||||
explore: { id: 'explore.title', defaultMessage: 'Explore' },
|
explore: { id: 'explore.title', defaultMessage: 'Explore' },
|
||||||
|
local: { id: 'column.local', defaultMessage: 'Local' },
|
||||||
firehose: { id: 'column.firehose', defaultMessage: 'Live feeds' },
|
firehose: { id: 'column.firehose', defaultMessage: 'Live feeds' },
|
||||||
direct: { id: 'navigation_bar.direct', defaultMessage: 'Private mentions' },
|
direct: { id: 'navigation_bar.direct', defaultMessage: 'Private mentions' },
|
||||||
favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' },
|
favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' },
|
||||||
|
@ -43,7 +44,7 @@ class NavigationPanel extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
isFirehoseActive = (match, location) => {
|
isFirehoseActive = (match, location) => {
|
||||||
return match || location.pathname.startsWith('/public');
|
return (match || location.pathname.startsWith('/public')) && !location.pathname.endsWith('/fixed');
|
||||||
};
|
};
|
||||||
|
|
||||||
render () {
|
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='/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='/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' 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={['/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} />
|
||||||
|
|
|
@ -120,6 +120,7 @@
|
||||||
"column.follow_requests": "Follow requests",
|
"column.follow_requests": "Follow requests",
|
||||||
"column.home": "Home",
|
"column.home": "Home",
|
||||||
"column.lists": "Lists",
|
"column.lists": "Lists",
|
||||||
|
"column.local": "Local",
|
||||||
"column.mutes": "Muted users",
|
"column.mutes": "Muted users",
|
||||||
"column.notifications": "Notifications",
|
"column.notifications": "Notifications",
|
||||||
"column.pins": "Pinned posts",
|
"column.pins": "Pinned posts",
|
||||||
|
|
|
@ -113,6 +113,7 @@
|
||||||
"column.follow_requests": "フォローリクエスト",
|
"column.follow_requests": "フォローリクエスト",
|
||||||
"column.home": "ホーム",
|
"column.home": "ホーム",
|
||||||
"column.lists": "リスト",
|
"column.lists": "リスト",
|
||||||
|
"column.local": "ローカル",
|
||||||
"column.mutes": "ミュートしたユーザー",
|
"column.mutes": "ミュートしたユーザー",
|
||||||
"column.notifications": "通知",
|
"column.notifications": "通知",
|
||||||
"column.pins": "固定された投稿",
|
"column.pins": "固定された投稿",
|
||||||
|
|
|
@ -12,6 +12,7 @@ Rails.application.routes.draw do
|
||||||
/home
|
/home
|
||||||
/public
|
/public
|
||||||
/public/local
|
/public/local
|
||||||
|
/public/local/fixed
|
||||||
/public/remote
|
/public/remote
|
||||||
/conversations
|
/conversations
|
||||||
/lists/(*any)
|
/lists/(*any)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue