-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(web): Single theme entry point & ensure Mantine singletons (#…
…5624) * refactor(web): Single theming entry point and pin @types/react to ensure mantine singleton * refactor(theme): remove redundant color scheme code * refactor(routes): rename layout components for clarity * refactor(auth): simplify conditional rendering in pages
- Loading branch information
Showing
21 changed files
with
548 additions
and
836 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 was deleted.
Oops, something went wrong.
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,81 @@ | ||
import { useState } from 'react'; | ||
import * as Sentry from '@sentry/react'; | ||
import { Outlet } from 'react-router-dom'; | ||
import styled from '@emotion/styled'; | ||
|
||
import { HeaderNav } from './HeaderNav'; | ||
import { SideNav } from './SideNav'; | ||
import { IntercomProvider } from 'react-use-intercom'; | ||
import { INTERCOM_APP_ID } from '../../../config/index'; | ||
import { EnsureOnboardingComplete } from '../components/EnsureOnboardingComplete'; | ||
import { SpotLight } from '../../utils/Spotlight'; | ||
import { SpotLightProvider } from '../../providers/SpotlightProvider'; | ||
import { useFeatureFlag } from '@novu/shared-web'; | ||
import { FeatureFlagsKeysEnum } from '@novu/shared'; | ||
import { HeaderNav as HeaderNavNew } from './v2/HeaderNav'; | ||
import { MainNav } from '../../nav/MainNav'; | ||
import { FreeTrialBanner } from './FreeTrialBanner'; | ||
|
||
const AppShell = styled.div` | ||
display: flex; | ||
width: 100vw; | ||
height: 100vh; | ||
min-width: 1024px; | ||
`; | ||
|
||
const ContentShell = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
flex: 1 1 0%; | ||
overflow: hidden; // for appropriate scroll | ||
`; | ||
|
||
export function PrivatePageLayout() { | ||
const [isIntercomOpened, setIsIntercomOpened] = useState(false); | ||
|
||
const isInformationArchitectureEnabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_INFORMATION_ARCHITECTURE_ENABLED); | ||
|
||
return ( | ||
<EnsureOnboardingComplete> | ||
<SpotLightProvider> | ||
<IntercomProvider | ||
appId={INTERCOM_APP_ID} | ||
onShow={() => setIsIntercomOpened(true)} | ||
onHide={() => setIsIntercomOpened(false)} | ||
> | ||
<Sentry.ErrorBoundary | ||
fallback={({ error, resetError, eventId }) => ( | ||
<> | ||
Sorry, but something went wrong. <br /> | ||
Our team has been notified and we are investigating. | ||
<br /> | ||
<code> | ||
<small style={{ color: 'lightGrey' }}> | ||
Event Id: {eventId}. | ||
<br /> | ||
{error.toString()} | ||
</small> | ||
</code> | ||
</> | ||
)} | ||
> | ||
<SpotLight> | ||
<AppShell> | ||
{isInformationArchitectureEnabled ? <MainNav /> : <SideNav />} | ||
<ContentShell> | ||
<FreeTrialBanner /> | ||
{isInformationArchitectureEnabled ? ( | ||
<HeaderNavNew /> | ||
) : ( | ||
<HeaderNav isIntercomOpened={isIntercomOpened} /> | ||
)} | ||
<Outlet /> | ||
</ContentShell> | ||
</AppShell> | ||
</SpotLight> | ||
</Sentry.ErrorBoundary> | ||
</IntercomProvider> | ||
</SpotLightProvider> | ||
</EnsureOnboardingComplete> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...nents/layout/EnsureOnboardingComplete.tsx → ...t/components/EnsureOnboardingComplete.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
File renamed without changes.
Oops, something went wrong.