X-Git-Url: https://awoo.directory/mastodon.git/blobdiff_plain/1e5532e693d9533ee37f553aeb191e284178fa52..18b451c0e6cf6a927a22084f94b423982de0ee8b:/app/javascript/mastodon/features/getting_started/index.js diff --git a/app/javascript/mastodon/features/getting_started/index.js b/app/javascript/mastodon/features/getting_started/index.js index cb3efb57b..67ec7665b 100644 --- a/app/javascript/mastodon/features/getting_started/index.js +++ b/app/javascript/mastodon/features/getting_started/index.js @@ -7,12 +7,13 @@ import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { me, invitesEnabled, version, profile_directory, repository, source_url } from '../../initial_state'; +import { me, profile_directory, showTrends } from '../../initial_state'; import { fetchFollowRequests } from 'mastodon/actions/accounts'; import { List as ImmutableList } from 'immutable'; -import { Link } from 'react-router-dom'; import NavigationBar from '../compose/components/navigation_bar'; import Icon from 'mastodon/components/icon'; +import LinkFooter from 'mastodon/features/ui/components/link_footer'; +import TrendsContainer from './containers/trends_container'; const messages = defineMessages({ home_timeline: { id: 'tabs_bar.home', defaultMessage: 'Home' }, @@ -55,10 +56,16 @@ const badgeDisplay = (number, limit) => { } }; +const NAVIGATION_PANEL_BREAKPOINT = 600 + (285 * 2) + (10 * 2); + export default @connect(mapStateToProps, mapDispatchToProps) @injectIntl class GettingStarted extends ImmutablePureComponent { + static contextTypes = { + router: PropTypes.object.isRequired, + }; + static propTypes = { intl: PropTypes.object.isRequired, myAccount: ImmutablePropTypes.map.isRequired, @@ -70,11 +77,14 @@ class GettingStarted extends ImmutablePureComponent { }; componentDidMount () { - const { myAccount, fetchFollowRequests } = this.props; + const { fetchFollowRequests, multiColumn } = this.props; - if (myAccount.get('locked')) { - fetchFollowRequests(); + if (!multiColumn && window.innerWidth >= NAVIGATION_PANEL_BREAKPOINT) { + this.context.router.history.replace('/timelines/home'); + return; } + + fetchFollowRequests(); } render () { @@ -95,7 +105,7 @@ class GettingStarted extends ImmutablePureComponent { if (profile_directory) { navItems.push( - + ); height += 48; @@ -108,7 +118,7 @@ class GettingStarted extends ImmutablePureComponent { height += 34; } else if (profile_directory) { navItems.push( - + ); height += 48; @@ -122,8 +132,8 @@ class GettingStarted extends ImmutablePureComponent { height += 48*3; - if (myAccount.get('locked')) { - navItems.push(); + if (myAccount.get('locked') || unreadFollowRequests > 0) { + navItems.push(); height += 48; } @@ -137,7 +147,7 @@ class GettingStarted extends ImmutablePureComponent { } return ( - + {multiColumn && @@ -155,28 +165,10 @@ class GettingStarted extends ImmutablePureComponent { {!multiColumn && } - - - {invitesEnabled && · } - {multiColumn && · } - · - · - · - · - · - · - - - - - {repository} (v{version}) }} - /> - - + + + {multiColumn && showTrends && } ); }
- {repository} (v{version}) }} - /> -