@ -1,24 +1,45 @@
import PropTypes from 'prop-types' ;
import React from 'react' ;
import { FormattedMessage } from 'react-intl ';
import { Link, NavLink } from 'react-router-dom ';
import Icon from 'mastodon/components/icon ';
import PropTypes from 'prop-types ';
import { defineMessages, injectIntl } from 'react-intl ';
import { Link } from 'react-router-dom ';
import Logo from 'mastodon/components/logo' ;
import TrendsContainer from 'mastodon/features/getting_started/containers/trends_container' ;
import { showTrends , timelinePreview } from 'mastodon/initial_state' ;
import FollowRequests NavLink from './follow_requests_nav _link';
import FollowRequests ColumnLink from './follow_requests_column _link';
import ListPanel from './list_panel' ;
import NotificationsCounterIcon from './notifications_counter_icon' ;
import SignInBanner from './sign_in_banner' ;
import ColumnLink from 'mastodon/features/ui/components/column_link' ;
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 : 'tabs_bar.local_timeline' , defaultMessage : 'Local' } ,
federated : { id : 'tabs_bar.federated_timeline' , defaultMessage : 'Federated' } ,
direct : { id : 'navigation_bar.direct' , defaultMessage : 'Direct messages' } ,
favourites : { id : 'navigation_bar.favourites' , defaultMessage : 'Favourites' } ,
bookmarks : { id : 'navigation_bar.bookmarks' , defaultMessage : 'Bookmarks' } ,
lists : { id : 'navigation_bar.lists' , defaultMessage : 'Lists' } ,
preferences : { id : 'navigation_bar.preferences' , defaultMessage : 'Preferences' } ,
followsAndFollowers : { id : 'navigation_bar.follows_and_followers' , defaultMessage : 'Follows and followers' } ,
about : { id : 'navigation_bar.about' , defaultMessage : 'About' } ,
} ) ;
export default class NavigationPanel extends React . Component {
export default @ injectIntl
class NavigationPanel extends React . Component {
static contextTypes = {
router : PropTypes . object . isRequired ,
identity : PropTypes . object . isRequired ,
} ;
static propTypes = {
intl : PropTypes . object . isRequired ,
} ;
render ( ) {
const { intl } = this . props ;
const { signedIn } = this . context . identity ;
return (
@ -30,17 +51,17 @@ export default class NavigationPanel extends React.Component {
{ signedIn && (
< React . Fragment >
< NavLink className = 'column-link column-link--transparent' to = '/home' data - preview - title - id = 'column.home' data - preview - icon = 'home' > < Icon className = 'column-link__icon' id = 'home' fixedWidth / > < FormattedMessage id = 'tabs_bar.home' defaultMessage = 'Home' / > < / N a v L i n k >
< NavLink className = 'column-link column-link--transparent' to = '/notifications' data - preview - title - id = 'column.notifications' data - preview - icon = 'bell' > < NotificationsCounterIcon className = 'column-link__icon' / > < FormattedMessage id = 'tabs_bar.notifications' defaultMessage = 'Notifications' / > < / N a v L i n k >
< FollowRequests Nav Link / >
< ColumnLink transparent to = '/home' icon = 'home' text = { intl . formatMessage ( messages . home ) } / >
< ColumnLink transparent to = '/notifications' icon = { < NotificationsCounterIcon className = 'column-link__icon' / > } text = { intl . formatMessage ( messages . notifications ) } / >
< FollowRequests Column Link / >
< / R e a c t . F r a g m e n t >
) }
< NavLink className = 'column-link column-link--transparent' to = '/explore' data - preview - title - id = 'explore.title' data - preview - icon = 'hashtag' > < Icon className = 'column-link__icon' id = 'hashtag' fixedWidth / > < FormattedMessage id = 'explore.title' defaultMessage = 'Explore' / > < / N a v L i n k >
< ColumnLink transparent to = '/explore' icon = 'hashtag' text = { intl . formatMessage ( messages . explore ) } / >
{ signedIn || timelinePreview && (
< >
< NavLink className = 'column-link column-link--transparent' to = '/public/local' data - preview - title - id = 'column.community' data - preview - icon = 'users' > < Icon className = 'column-link__icon' id = 'users' fixedWidth / > < FormattedMessage id = 'tabs_bar.local_timeline' defaultMessage = 'Local' / > < / N a v L i n k >
< NavLink className = 'column-link column-link--transparent' exact to = '/public' data - preview - title - id = 'column.public' data - preview - icon = 'globe' > < Icon className = 'column-link__icon' id = 'globe' fixedWidth / > < FormattedMessage id = 'tabs_bar.federated_timeline' defaultMessage = 'Federated' / > < / N a v L i n k >
< ColumnLink transparent to = '/public/local' icon = 'users' text = { intl . formatMessage ( messages . local ) } / >
< ColumnLink transparent exact to = '/public' icon = 'globe' text = { intl . formatMessage ( messages . federated ) } / >
< / >
) }
@ -53,23 +74,23 @@ export default class NavigationPanel extends React.Component {
{ signedIn && (
< React . Fragment >
< NavLink className = 'column-link column-link--transparent' to = '/conversations' > < Icon className = 'column-link__icon' id = 'at' fixedWidth / > < FormattedMessage id = 'navigation_bar.direct' defaultMessage = 'Direct messages' / > < / N a v L i n k >
< NavLink className = 'column-link column-link--transparent' to = '/favourites' > < Icon className = 'column-link__icon' id = 'star' fixedWidth / > < FormattedMessage id = 'navigation_bar.favourites' defaultMessage = 'Favourites' / > < / N a v L i n k >
< NavLink className = 'column-link column-link--transparent' to = '/bookmarks' > < Icon className = 'column-link__icon' id = 'bookmark' fixedWidth / > < FormattedMessage id = 'navigation_bar.bookmarks' defaultMessage = 'Bookmarks' / > < / N a v L i n k >
< NavLink className = 'column-link column-link--transparent' to = '/lists' > < Icon className = 'column-link__icon' id = 'list-ul' fixedWidth / > < FormattedMessage id = 'navigation_bar.lists' defaultMessage = 'Lists' / > < / N a v L i n k >
< ColumnLink transparent to = '/conversations' icon = 'at' text = { intl . formatMessage ( messages . direct ) } / >
< ColumnLink transparent to = '/favourites' icon = 'star' text = { intl . formatMessage ( messages . favourites ) } / >
< ColumnLink transparent to = '/bookmarks' icon = 'bookmark' text = { intl . formatMessage ( messages . bookmarks ) } / >
< ColumnLink transparent to = '/lists' icon = 'list-ul' text = { intl . formatMessage ( messages . lists ) } / >
< ListPanel / >
< hr / >
< a className = 'column-link column-link--transparent' href = '/settings/preferences' > < Icon className = 'column-link__icon' id = 'cog' fixedWidth / > < FormattedMessage id = 'navigation_bar.preferences' defaultMessage = 'Preferences' / > < / a >
< a className = 'column-link column-link--transparent' href = '/relationships' > < Icon className = 'column-link__icon' id = 'users' fixedWidth / > < FormattedMessage id = 'navigation_bar.follows_and_followers' defaultMessage = 'Follows and followers' / > < / a >
< ColumnLink transparent href = '/settings/preferences' icon = 'cog' text = { intl . formatMessage ( messages . preferences ) } / >
< ColumnLink transparent href = '/relationships' icon = 'users' text = { intl . formatMessage ( messages . followsAndFollowers ) } / >
< / R e a c t . F r a g m e n t >
) }
< div className = 'navigation-panel__legal' >
< hr / >
< NavLink className = 'column-link column-link--transparent' to = '/about' > < Icon className = 'column-link__icon' id = 'ellipsis-h' fixedWidth / > < FormattedMessage id = 'navigation_bar.about' defaultMessage = 'About' / > < / N a v L i n k >
< ColumnLink transparent to = '/about' icon = 'ellipsis-h' text = { intl . formatMessage ( messages . about ) } / >
< / d i v >
{ showTrends && (