@addsign/moje-agenda-shared-lib 2.0.32 → 2.0.33

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/dist/main.d.ts CHANGED
@@ -33,6 +33,7 @@ export * from './utils/handleErrors.ts';
33
33
  export * from './utils/hasRightInModule.ts';
34
34
  export * from './utils/hasRole.ts';
35
35
  export * from './types.ts';
36
+ export * from './hooks/useScreenSize.ts';
36
37
  export * from './components/ui/Dialog.tsx';
37
38
  export * from './components/ui/ScrollArea.tsx';
38
39
  export * from './components/ui/input.tsx';
package/dist/main.js CHANGED
@@ -32,6 +32,7 @@ import { handleErrors } from "./utils/handleErrors.js";
32
32
  import { hasRightInModule } from "./utils/hasRightInModule.js";
33
33
  import { hasRole } from "./utils/hasRole.js";
34
34
  import { EApproverRoles, EApproverTypes, EDecisionsTranslations, EEntity, Eagendy, Eassignments, Estavy } from "./types.js";
35
+ import { useScreenSize } from "./hooks/useScreenSize.js";
35
36
  import { D, c, e, i, g, f, b, a, h, d } from "./Dialog-BmQoVu5C.js";
36
37
  import { ScrollArea, ScrollBar } from "./components/ui/ScrollArea.js";
37
38
  import { Input } from "./components/ui/input.js";
@@ -146,6 +147,7 @@ export {
146
147
  hasRole,
147
148
  resetAllDataTablePaging,
148
149
  useFederationContext,
149
- useFormField
150
+ useFormField,
151
+ useScreenSize
150
152
  };
151
153
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,11 +2,9 @@ import { ButtonCN } from "../../main";
2
2
 
3
3
  export default function Neoptimizovano() {
4
4
  return (
5
- <div className="flex flex-col gap-2">
6
- <div>Není optimalizováno pro toto rozlišení</div>
7
- <ButtonCN className="ml-2" onClick={() => history.back()}>
8
- Zpět
9
- </ButtonCN>
5
+ <div className="flex flex-col gap-2 flex-1 items-center justify-center min-h-[50vh] text-center">
6
+ <h1>Není optimalizováno pro toto rozlišení</h1>
7
+ <ButtonCN onClick={() => history.back()}>Zpět</ButtonCN>
10
8
  </div>
11
9
  );
12
10
  }
@@ -0,0 +1,29 @@
1
+ import { useEffect, useState } from "react";
2
+
3
+ export const useScreenSize = () => {
4
+ const [screenSize, setScreenSize] = useState<"xl" | "lg" | "md" | "sm">(
5
+ window.innerWidth > 1280
6
+ ? "xl"
7
+ : window.innerWidth > 1024
8
+ ? "lg"
9
+ : window.innerWidth > 768
10
+ ? "md"
11
+ : "sm"
12
+ );
13
+ useEffect(() => {
14
+ const handleResize = () => {
15
+ setScreenSize(
16
+ window.innerWidth > 1280
17
+ ? "xl"
18
+ : window.innerWidth > 1024
19
+ ? "lg"
20
+ : window.innerWidth > 768
21
+ ? "md"
22
+ : "sm"
23
+ );
24
+ };
25
+ window.addEventListener("resize", handleResize);
26
+ return () => window.removeEventListener("resize", handleResize);
27
+ }, []);
28
+ return screenSize;
29
+ }
package/lib/main.ts CHANGED
@@ -50,6 +50,7 @@ export * from "./utils/hasRightInModule.ts";
50
50
  export * from "./utils/hasRole.ts";
51
51
 
52
52
  export * from "./types.ts";
53
+ export * from "./hooks/useScreenSize.ts";
53
54
 
54
55
 
55
56
  //**SHADCN */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@addsign/moje-agenda-shared-lib",
3
3
  "private": false,
4
- "version": "2.0.32",
4
+ "version": "2.0.33",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",