1
- import 'react-toggle/style.css'
2
- import { Suspense , lazy } from 'react'
3
- import { Route , Routes } from 'react-router-dom'
4
1
import { ApolloProvider } from '@apollo/client'
5
- import { IntercomProvider } from 'react-use-intercom '
6
- import { Grommet , ThemeType } from 'grommet '
2
+ import { mergeDeep } from '@apollo/client/utilities '
3
+ import { GrowthBook , GrowthBookProvider } from '@growthbook/growthbook-react '
7
4
import {
8
5
BreadcrumbsProvider ,
9
6
GlobalStyle ,
10
- honorableThemeDark ,
11
- honorableThemeLight ,
12
- styledThemeDark ,
13
- styledThemeLight ,
14
7
useThemeColorMode ,
15
8
} from '@pluralsh/design-system'
16
9
import { MarkdocContextProvider } from '@pluralsh/design-system/dist/markdoc'
10
+ import { Grommet , ThemeType } from 'grommet'
17
11
import {
18
12
CssBaseline ,
19
13
ThemeProvider as HonorableThemeProvider ,
20
14
mergeTheme ,
21
15
} from 'honorable'
16
+ import mpRecipe from 'honorable-recipe-mp'
17
+ import { Suspense , lazy } from 'react'
18
+ import { Route , Routes } from 'react-router-dom'
19
+ import 'react-toggle/style.css'
20
+ import { IntercomProvider } from 'react-use-intercom'
22
21
import styled , {
23
22
StyleSheetManager ,
24
23
ThemeProvider as StyledThemeProvider ,
25
24
} from 'styled-components'
26
- import { mergeDeep } from '@apollo/client/utilities'
27
- import mpRecipe from 'honorable-recipe-mp'
28
- import { GrowthBook , GrowthBookProvider } from '@growthbook/growthbook-react'
29
25
30
26
import { shouldForwardProp } from './utils/shouldForwardProp'
31
27
32
28
import { PluralErrorBoundary } from './components/utils/PluralErrorBoundary'
33
29
34
- import { client } from './helpers/client'
35
- import { INTERCOM_APP_ID } from './constants'
36
- import { DEFAULT_THEME } from './theme'
37
- import { HistoryRouter , browserHistory } from './router'
38
- import { growthbook } from './helpers/growthbook'
30
+ import {
31
+ polyfilledHonorableThemeDark ,
32
+ polyfilledHonorableThemeLight ,
33
+ polyfilledStyledThemeDark ,
34
+ polyfilledStyledThemeLight ,
35
+ } from './styles'
39
36
import { OverlayContextProvider } from './components/layout/Overlay'
40
- import NavContextProvider from './contexts/NavigationContext'
41
37
import { CursorPositionProvider } from './components/utils/CursorPosition'
38
+ import { INTERCOM_APP_ID } from './constants'
39
+ import NavContextProvider from './contexts/NavigationContext'
40
+ import { client } from './helpers/client'
41
+ import { growthbook } from './helpers/growthbook'
42
+ import { HistoryRouter , browserHistory } from './router'
43
+ import { DEFAULT_THEME } from './theme'
42
44
43
45
const Plural = lazy ( ( ) => import ( './components/Plural' ) )
44
46
const Invite = lazy ( ( ) => import ( './components/Invite' ) )
@@ -105,7 +107,9 @@ function App() {
105
107
const colorMode = useThemeColorMode ( )
106
108
107
109
const honorableTheme = mergeTheme (
108
- colorMode === 'light' ? honorableThemeLight : honorableThemeDark ,
110
+ colorMode === 'light'
111
+ ? polyfilledHonorableThemeLight
112
+ : polyfilledHonorableThemeDark ,
109
113
{
110
114
global : [
111
115
// This provides the mp spacing props to honorable
@@ -114,7 +118,10 @@ function App() {
114
118
] ,
115
119
}
116
120
)
117
- const styledTheme = colorMode === 'light' ? styledThemeLight : styledThemeDark
121
+ const styledTheme =
122
+ colorMode === 'light'
123
+ ? polyfilledStyledThemeLight
124
+ : polyfilledStyledThemeDark
118
125
const mergedStyledTheme = mergeDeep ( DEFAULT_THEME , styledTheme )
119
126
120
127
const routes = (
@@ -182,6 +189,7 @@ function App() {
182
189
< IntercomProvider appId = { INTERCOM_APP_ID } >
183
190
< StyleSheetManager shouldForwardProp = { shouldForwardProp } >
184
191
< HonorableThemeProvider theme = { honorableTheme } >
192
+ { /* @ts -ignore - this will be fixed when we bump DS */ }
185
193
< StyledThemeProvider theme = { mergedStyledTheme } >
186
194
< GrowthBookProvider
187
195
growthbook = { growthbook as any as GrowthBook }
0 commit comments