-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: new colors adjustments and fix form styles [NU-1646]
- Loading branch information
1 parent
d8f8a13
commit a05f7d4
Showing
2 changed files
with
22 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,36 @@ | ||
import { Theme, ThemeProvider } from "@mui/material"; | ||
import { deepmerge } from "@mui/utils"; | ||
import { LocalizationProvider } from "@mui/x-date-pickers"; | ||
import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment"; | ||
import { configure } from "mobx"; | ||
import * as React from "react"; | ||
import { PropsWithChildren } from "react"; | ||
import { Options } from "../config"; | ||
import { StoreProvider } from "../store/storeProvider"; | ||
import { theme } from "./theme"; | ||
|
||
configure({ | ||
enforceActions: "observed", | ||
}); | ||
|
||
export const RootProviders = ({ children }: PropsWithChildren<unknown>) => ( | ||
<StoreProvider options={Options}> | ||
<LocalizationProvider dateAdapter={AdapterMoment}>{children}</LocalizationProvider> | ||
<ThemeProvider | ||
theme={(outerTheme: Theme) => { | ||
if (!Object.keys(outerTheme).length) { | ||
return theme; | ||
} | ||
|
||
// Let's set aside the parent form style since we won't be using the same form style throughout the entire app. | ||
const { | ||
components: { MuiFormControl, MuiFormHelperText, MuiFormLabel }, | ||
...filteredOuterTheme | ||
} = outerTheme; | ||
|
||
return deepmerge(theme, filteredOuterTheme); | ||
}} | ||
> | ||
<LocalizationProvider dateAdapter={AdapterMoment}>{children}</LocalizationProvider> | ||
</ThemeProvider> | ||
</StoreProvider> | ||
); |