-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create getLiveConfig request * Created LiveConfigAppProvider component * Added Live Configs in apps * Remove automatic Drive App deploy * Created Checkbox component * Created TextField component * Added interactive overlay and label to the Checkbox component * Added description in the live config interface * Added theme handling with Live Configs * Added a no cache URL param in the API request * Added additionalTasks in CaptureAppConfig * Fix conflicts
- Loading branch information
1 parent
b4dc81d
commit be49e75
Showing
70 changed files
with
2,394 additions
and
1,074 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,25 +1,32 @@ | ||
import { Outlet, useNavigate } from 'react-router-dom'; | ||
import { MonkAppStateProvider, MonkProvider, useMonkTheme } from '@monkvision/common'; | ||
import { getEnvOrThrow, MonkProvider } from '@monkvision/common'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { LiveConfigAppProvider } from '@monkvision/common-ui-web'; | ||
import { CaptureAppConfig } from '@monkvision/types'; | ||
import { Page } from '../pages'; | ||
import { AppConfig } from '../config'; | ||
import * as config from '../local-config.json'; | ||
import { AppContainer } from './AppContainer'; | ||
|
||
const localConfig = | ||
process.env['REACT_APP_USE_LOCAL_CONFIG'] === 'true' ? (config as CaptureAppConfig) : undefined; | ||
|
||
export function App() { | ||
const navigate = useNavigate(); | ||
const { i18n } = useTranslation(); | ||
const { rootStyles } = useMonkTheme(); | ||
|
||
return ( | ||
<MonkAppStateProvider | ||
config={AppConfig} | ||
<LiveConfigAppProvider | ||
id={getEnvOrThrow('REACT_APP_LIVE_CONFIG_ID')} | ||
localConfig={localConfig} | ||
onFetchAuthToken={() => navigate(Page.CREATE_INSPECTION)} | ||
onFetchLanguage={(lang) => i18n.changeLanguage(lang)} | ||
lang={i18n.language} | ||
> | ||
<MonkProvider> | ||
<div className='app-container' style={rootStyles}> | ||
<AppContainer> | ||
<Outlet /> | ||
</div> | ||
</AppContainer> | ||
</MonkProvider> | ||
</MonkAppStateProvider> | ||
</LiveConfigAppProvider> | ||
); | ||
} |
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,22 @@ | ||
import { PropsWithChildren } from 'react'; | ||
import { MonkThemeProvider, useMonkAppState, useMonkTheme } from '@monkvision/common'; | ||
|
||
function RootStylesContainer({ children }: PropsWithChildren<unknown>) { | ||
const { rootStyles } = useMonkTheme(); | ||
|
||
return ( | ||
<div className='app-container' style={rootStyles}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
|
||
export function AppContainer({ children }: PropsWithChildren<unknown>) { | ||
const { config } = useMonkAppState(); | ||
|
||
return ( | ||
<MonkThemeProvider palette={config.palette}> | ||
<RootStylesContainer>{children}</RootStylesContainer> | ||
</MonkThemeProvider> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './App'; | ||
export * from './AppRouter'; | ||
export * from './AppContainer'; |
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
Oops, something went wrong.