@etsoo/materialui 1.4.70 → 1.4.71

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.
@@ -30,9 +30,11 @@ function CommonPage(props) {
30
30
  }
31
31
  // Labels
32
32
  const labels = Labels_1.Labels.CommonPage;
33
+ const theme = (0, material_1.useTheme)();
34
+ const distance = react_1.default.useMemo(() => MUGlobal_1.MUGlobal.updateWithTheme(fabPadding, theme.spacing), [fabPadding, theme.spacing]);
33
35
  // Update
34
36
  const updateRef = react_1.default.useRef(false);
35
- const update = onUpdateAll
37
+ const update = react_1.default.useMemo(() => onUpdateAll
36
38
  ? onUpdateAll
37
39
  : onUpdate
38
40
  ? async (authorized) => {
@@ -48,9 +50,7 @@ function CommonPage(props) {
48
50
  updateRef.current = true;
49
51
  }
50
52
  }
51
- : undefined;
52
- const theme = (0, material_1.useTheme)();
53
- const distance = react_1.default.useMemo(() => MUGlobal_1.MUGlobal.updateWithTheme(fabPadding, theme.spacing), [fabPadding, theme.spacing]);
53
+ : undefined, [onUpdateAll, onUpdate, onRefresh]);
54
54
  react_1.default.useEffect(() => {
55
55
  if (updateRef.current && update) {
56
56
  update(true, []);
@@ -24,9 +24,11 @@ export function CommonPage(props) {
24
24
  }
25
25
  // Labels
26
26
  const labels = Labels.CommonPage;
27
+ const theme = useTheme();
28
+ const distance = React.useMemo(() => MUGlobal.updateWithTheme(fabPadding, theme.spacing), [fabPadding, theme.spacing]);
27
29
  // Update
28
30
  const updateRef = React.useRef(false);
29
- const update = onUpdateAll
31
+ const update = React.useMemo(() => onUpdateAll
30
32
  ? onUpdateAll
31
33
  : onUpdate
32
34
  ? async (authorized) => {
@@ -42,9 +44,7 @@ export function CommonPage(props) {
42
44
  updateRef.current = true;
43
45
  }
44
46
  }
45
- : undefined;
46
- const theme = useTheme();
47
- const distance = React.useMemo(() => MUGlobal.updateWithTheme(fabPadding, theme.spacing), [fabPadding, theme.spacing]);
47
+ : undefined, [onUpdateAll, onUpdate, onRefresh]);
48
48
  React.useEffect(() => {
49
49
  if (updateRef.current && update) {
50
50
  update(true, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.4.70",
3
+ "version": "1.4.71",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -127,32 +127,36 @@ export function CommonPage(props: CommonPageProps) {
127
127
  // Labels
128
128
  const labels = Labels.CommonPage;
129
129
 
130
- // Update
131
- const updateRef = React.useRef(false);
132
- const update = onUpdateAll
133
- ? onUpdateAll
134
- : onUpdate
135
- ? async (authorized?: boolean) => {
136
- if (authorized == null || authorized) {
137
- await onUpdate();
138
- updateRef.current = true;
139
- }
140
- }
141
- : onRefresh
142
- ? async (authorized?: boolean) => {
143
- if (authorized) {
144
- await onRefresh();
145
- updateRef.current = true;
146
- }
147
- }
148
- : undefined;
149
-
150
130
  const theme = useTheme();
151
131
  const distance = React.useMemo(
152
132
  () => MUGlobal.updateWithTheme(fabPadding, theme.spacing),
153
133
  [fabPadding, theme.spacing]
154
134
  );
155
135
 
136
+ // Update
137
+ const updateRef = React.useRef(false);
138
+ const update = React.useMemo(
139
+ () =>
140
+ onUpdateAll
141
+ ? onUpdateAll
142
+ : onUpdate
143
+ ? async (authorized?: boolean) => {
144
+ if (authorized == null || authorized) {
145
+ await onUpdate();
146
+ updateRef.current = true;
147
+ }
148
+ }
149
+ : onRefresh
150
+ ? async (authorized?: boolean) => {
151
+ if (authorized) {
152
+ await onRefresh();
153
+ updateRef.current = true;
154
+ }
155
+ }
156
+ : undefined,
157
+ [onUpdateAll, onUpdate, onRefresh]
158
+ );
159
+
156
160
  React.useEffect(() => {
157
161
  if (updateRef.current && update) {
158
162
  update(true, []);