Add new overview landing page setting (#39074)
This commit is contained in:
1 parent
f6d1795da5
commit
07d099cbf7
15 files changed
+483
-17
No files matched your search
@@ -29,7 +29,7 @@ import { uploadCompose, resetCompose, changeComposeSpoilerness } from '../../act
|
||||
import { clearHeight } from '../../actions/height_cache';
|
||||
import { fetchServer, fetchServerTranslationLanguages } from '../../actions/server';
|
||||
import { expandHomeTimeline } from '../../actions/timelines';
|
||||
import { initialState, me, owner, singleUserMode, trendsEnabled, landingPage, localLiveFeedAccess, disableHoverCards } from '../../initial_state';
|
||||
import { initialState, me, owner, singleUserMode, trendsEnabled, landingPage, localLiveFeedAccess, disableHoverCards, domain } from '../../initial_state';
|
||||
|
||||
import BundleColumnError from './components/bundle_column_error';
|
||||
import { NavigationBar } from './components/navigation_bar';
|
||||
@@ -88,6 +88,7 @@ import {
|
||||
import { ColumnsContextProvider } from './util/columns_context';
|
||||
import { focusColumn, getFocusedItemIndex, focusItemSibling, focusFirstItem } from './util/focusUtils';
|
||||
import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers';
|
||||
import { CustomHomepage } from 'mastodon/features/custom_homepage';
|
||||
|
||||
// Dummy import, to make sure that <Status /> ends up in the application bundle.
|
||||
// Without this it ends up in ~8 very commonly used bundles.
|
||||
@@ -177,13 +178,15 @@ class SwitchingColumnsArea extends PureComponent {
|
||||
rootRedirect = '/explore';
|
||||
} else if (localLiveFeedAccess === 'public' && landingPage === 'local_feed') {
|
||||
rootRedirect = '/public/local';
|
||||
} else if (landingPage === 'overview') {
|
||||
rootRedirect = '/overview';
|
||||
} else {
|
||||
rootRedirect = '/about';
|
||||
}
|
||||
|
||||
return (
|
||||
<ColumnsContextProvider multiColumn={!singleColumn}>
|
||||
<ColumnsArea ref={this.setRef} singleColumn={singleColumn}>
|
||||
<ColumnsArea ref={this.setRef} singleColumn={singleColumn} domain={domain} minimalShell={!signedIn && landingPage === 'overview'}>
|
||||
<WrappedSwitch>
|
||||
<Redirect from='/' to={{pathname: rootRedirect, state: this.props.location.state}} exact />
|
||||
|
||||
@@ -262,6 +265,8 @@ class SwitchingColumnsArea extends PureComponent {
|
||||
<WrappedRoute path='/followed_tags' component={FollowedTags} content={children} />
|
||||
<WrappedRoute path='/mutes' component={Mutes} content={children} />
|
||||
<WrappedRoute path='/lists' component={Lists} content={children} />
|
||||
|
||||
<Route path='/overview' component={CustomHomepage} />
|
||||
<Route component={BundleColumnError} />
|
||||
</WrappedSwitch>
|
||||
</ColumnsArea>
|
||||
@@ -633,13 +638,18 @@ class UI extends PureComponent {
|
||||
cheat: this.handleDonate,
|
||||
};
|
||||
|
||||
const minimalShell = !this.props.identity.signedIn && landingPage === 'overview';
|
||||
|
||||
return (
|
||||
<Hotkeys global handlers={handlers}>
|
||||
<div className={classNames('ui', { 'is-composing': isComposing })} ref={this.setRef}>
|
||||
<SkipLinks
|
||||
multiColumn={layout === 'multi-column'}
|
||||
onFocusGettingStartedColumn={this.handleHotkeyGoToStart}
|
||||
/>
|
||||
{!minimalShell && (
|
||||
<SkipLinks
|
||||
multiColumn={layout === 'multi-column'}
|
||||
onFocusGettingStartedColumn={this.handleHotkeyGoToStart}
|
||||
/>
|
||||
)}
|
||||
|
||||
<SwitchingColumnsArea
|
||||
identity={this.props.identity}
|
||||
location={location}
|
||||
@@ -650,7 +660,7 @@ class UI extends PureComponent {
|
||||
{children}
|
||||
</SwitchingColumnsArea>
|
||||
|
||||
<NavigationBar />
|
||||
{!minimalShell && <NavigationBar />}
|
||||
{layout !== 'mobile' && <PictureInPicture />}
|
||||
<AlertsController />
|
||||
{!disableHoverCards && <HoverCardController />}
|
||||
|
||||
Reference in new issue
Block a user