forked from mattermost/mattermost
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MM-59299] Investigate further breaking down chunks of components/nod…
…e_modules for initial load (mattermost#27845)
- Loading branch information
1 parent
e104575
commit 7232fee
Showing
19 changed files
with
213 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 7 additions & 5 deletions
12
webapp/channels/src/components/channel_view/channel_view.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
// See LICENSE.txt for license information. | ||
|
||
import React, {lazy} from 'react'; | ||
import type {RouteComponentProps} from 'react-router-dom'; | ||
import {Route} from 'react-router-dom'; | ||
|
||
import type {Theme} from 'mattermost-redux/selectors/entities/preferences'; | ||
|
||
import {makeAsyncComponent} from 'components/async_load'; | ||
import CompassThemeProvider from 'components/compass_theme_provider/compass_theme_provider'; | ||
import LoggedIn from 'components/logged_in'; | ||
|
||
const OnBoardingTaskList = makeAsyncComponent('OnboardingTaskList', lazy(() => import('components/onboarding_tasklist'))); | ||
|
||
type Props = { | ||
component: React.ComponentType<RouteComponentProps<any>>; | ||
path: string | string[]; | ||
theme?: Theme; // the routes that send the theme are the ones that will actually need to show the onboarding tasklist | ||
}; | ||
|
||
export default function LoggedInRoute(props: Props) { | ||
const {component: Component, theme, ...rest} = props; | ||
|
||
return ( | ||
<Route | ||
{...rest} | ||
render={(routeProps) => ( | ||
<LoggedIn {...routeProps}> | ||
{theme && ( | ||
<CompassThemeProvider theme={theme}> | ||
<OnBoardingTaskList/> | ||
</CompassThemeProvider> | ||
)} | ||
<Component {...(routeProps)}/> | ||
</LoggedIn> | ||
)} | ||
/> | ||
); | ||
} |
Oops, something went wrong.