@carrier-dpx/air-react-library 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode, useEffect } from "react";
|
|
2
2
|
import { Theme, ThemeProvider, createTheme } from "@mui/material/styles";
|
|
3
3
|
import { airDarkThemeOptions, fleetThemeOptions } from "./fleetThemeOptions";
|
|
4
4
|
|
|
@@ -32,6 +32,17 @@ const FleetThemeProvider: React.FC<ThemeProviderProps> = ({
|
|
|
32
32
|
}) => {
|
|
33
33
|
const resolvedTheme = typeof theme === "string" ? ThemeMap[theme] : theme;
|
|
34
34
|
|
|
35
|
+
// Load Nunito Sans font
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
// Check if font is already loaded
|
|
38
|
+
if (!document.querySelector('link[href*="Nunito+Sans"]')) {
|
|
39
|
+
const link = document.createElement('link');
|
|
40
|
+
link.href = 'https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@200;300;400;600;700;800;900&display=swap';
|
|
41
|
+
link.rel = 'stylesheet';
|
|
42
|
+
document.head.appendChild(link);
|
|
43
|
+
}
|
|
44
|
+
}, []);
|
|
45
|
+
|
|
35
46
|
return <ThemeProvider theme={resolvedTheme}>{children}</ThemeProvider>;
|
|
36
47
|
};
|
|
37
48
|
|