@gustavo-valsechi/client 1.3.56 → 1.3.58
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.
|
@@ -38,12 +38,17 @@ var import_react = require("react");
|
|
|
38
38
|
var import_styled_components = require("styled-components");
|
|
39
39
|
var import_styles = require("./styles");
|
|
40
40
|
var import_content = require("./content");
|
|
41
|
+
var import_tools = require("@gustavo-valsechi/server/tools");
|
|
41
42
|
var import_registry = __toESM(require("../../contexts/theme/registry"));
|
|
42
43
|
var import_global = __toESM(require("./global.styles"));
|
|
43
44
|
const ThemeContext = (0, import_react.createContext)({});
|
|
44
45
|
const ThemeProviderContainer = (props) => {
|
|
45
46
|
const [theme, setTheme] = (0, import_react.useState)("light");
|
|
46
47
|
const [defaultTheme] = (0, import_react.useState)("light");
|
|
48
|
+
(0, import_react.useEffect)(() => {
|
|
49
|
+
if (!theme) return;
|
|
50
|
+
(async () => await (0, import_tools.setStorage)(process.env.NEXT_PUBLIC_STORAGE_THEME, theme))();
|
|
51
|
+
}, [theme]);
|
|
47
52
|
const SwitcherComponent = () => {
|
|
48
53
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
49
54
|
import_styles.Switcher,
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useContext, useState } from "react";
|
|
3
|
+
import { createContext, useContext, useEffect, useState } from "react";
|
|
4
4
|
import { ThemeProvider } from "styled-components";
|
|
5
5
|
import { Switcher } from "./styles";
|
|
6
6
|
import { Themes } from "./content";
|
|
7
|
+
import { setStorage } from "@gustavo-valsechi/server/tools";
|
|
7
8
|
import StyledComponentsRegistry from "../../contexts/theme/registry";
|
|
8
9
|
import GlobalStyles from "./global.styles";
|
|
9
10
|
const ThemeContext = createContext({});
|
|
10
11
|
const ThemeProviderContainer = (props) => {
|
|
11
12
|
const [theme, setTheme] = useState("light");
|
|
12
13
|
const [defaultTheme] = useState("light");
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (!theme) return;
|
|
16
|
+
(async () => await setStorage(process.env.NEXT_PUBLIC_STORAGE_THEME, theme))();
|
|
17
|
+
}, [theme]);
|
|
13
18
|
const SwitcherComponent = () => {
|
|
14
19
|
return /* @__PURE__ */ jsxs(
|
|
15
20
|
Switcher,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gustavo-valsechi/client",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.58",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@emotion/is-prop-valid": "1.3.0",
|
|
27
|
-
"@gustavo-valsechi/server": "1.0.
|
|
27
|
+
"@gustavo-valsechi/server": "1.0.12",
|
|
28
28
|
"@hookform/resolvers": "5.2.2",
|
|
29
29
|
"apexcharts": "3.51.0",
|
|
30
30
|
"lodash": "4.17.21",
|
|
@@ -63,22 +63,22 @@
|
|
|
63
63
|
"exports": {
|
|
64
64
|
".": {
|
|
65
65
|
"types": "./dist/index.d.ts",
|
|
66
|
-
"import": "./dist/index.
|
|
66
|
+
"import": "./dist/index.js",
|
|
67
67
|
"require": "./dist/index.js"
|
|
68
68
|
},
|
|
69
69
|
"./components": {
|
|
70
70
|
"types": "./dist/components/index.d.ts",
|
|
71
|
-
"import": "./dist/components/index.
|
|
71
|
+
"import": "./dist/components/index.js",
|
|
72
72
|
"require": "./dist/components/index.js"
|
|
73
73
|
},
|
|
74
74
|
"./contexts": {
|
|
75
75
|
"types": "./dist/contexts/index.d.ts",
|
|
76
|
-
"import": "./dist/contexts/index.
|
|
76
|
+
"import": "./dist/contexts/index.js",
|
|
77
77
|
"require": "./dist/contexts/index.js"
|
|
78
78
|
},
|
|
79
79
|
"./interfaces": {
|
|
80
80
|
"types": "./dist/interfaces/index.d.ts",
|
|
81
|
-
"import": "./dist/interfaces/index.
|
|
81
|
+
"import": "./dist/interfaces/index.js",
|
|
82
82
|
"require": "./dist/interfaces/index.js"
|
|
83
83
|
}
|
|
84
84
|
}
|