l-min-components 1.0.556 → 1.0.557
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
|
@@ -2,12 +2,13 @@ import React, { useContext, useLayoutEffect } from "react";
|
|
|
2
2
|
import { Container } from "./style";
|
|
3
3
|
import ErrorImage from "./errorPage.png";
|
|
4
4
|
import ButtonComponent from "../button";
|
|
5
|
-
import { useNavigate } from "react-router-dom";
|
|
5
|
+
import { useNavigate, useRouteError } from "react-router-dom";
|
|
6
6
|
|
|
7
7
|
const Index = () => {
|
|
8
8
|
// const data = useContext(OutletContext);
|
|
9
9
|
const navigate = useNavigate()
|
|
10
|
-
|
|
10
|
+
const error = useRouteError();
|
|
11
|
+
console.log(error, 'errorStat');
|
|
11
12
|
// useLayoutEffect(() => {
|
|
12
13
|
// data.setRightLayout(false);
|
|
13
14
|
// data.setLeftLayout(false)
|
|
@@ -15,29 +16,53 @@ const Index = () => {
|
|
|
15
16
|
|
|
16
17
|
return(
|
|
17
18
|
<Container>
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
{error?.status === 404 ?<>
|
|
20
|
+
<div className="right">
|
|
21
|
+
<h3>Opss...</h3>
|
|
22
|
+
<h2>Page not found</h2>
|
|
23
|
+
<p>Seems we can't find the page your looking for. Let's get you back home.</p>
|
|
24
|
+
<ButtonComponent
|
|
25
|
+
text="Go Back"
|
|
26
|
+
styles={{
|
|
27
|
+
width: "144px",
|
|
28
|
+
height: "50px",
|
|
29
|
+
background: "#FEBF10",
|
|
30
|
+
fontWeight: 700,
|
|
31
|
+
fontSize: "16px",
|
|
32
|
+
lineHeight: "22px",
|
|
33
|
+
marginTop: "20px",
|
|
34
|
+
boxShadow: "0px 10px 20px 0px rgba(254, 191, 16, 0.25)"
|
|
35
|
+
}}
|
|
36
|
+
onClick={() => navigate(-1)}
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
<div className="left">
|
|
41
|
+
<img src={ErrorImage} alt="" />
|
|
42
|
+
</div>
|
|
43
|
+
</>
|
|
44
|
+
:
|
|
45
|
+
<>
|
|
46
|
+
<div className="right">
|
|
47
|
+
<h3>Opss...</h3>
|
|
48
|
+
<p>There was an error</p>
|
|
49
|
+
<ButtonComponent
|
|
50
|
+
text="Go Back"
|
|
51
|
+
styles={{
|
|
52
|
+
width: "144px",
|
|
53
|
+
height: "50px",
|
|
54
|
+
background: "#FEBF10",
|
|
55
|
+
fontWeight: 700,
|
|
56
|
+
fontSize: "16px",
|
|
57
|
+
lineHeight: "22px",
|
|
58
|
+
marginTop: "20px",
|
|
59
|
+
boxShadow: "0px 10px 20px 0px rgba(254, 191, 16, 0.25)"
|
|
60
|
+
}}
|
|
61
|
+
onClick={() => navigate(-1)}
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
</>}
|
|
65
|
+
|
|
41
66
|
|
|
42
67
|
</Container>
|
|
43
68
|
|