@campxdev/react-blueprint 0.1.54 → 0.1.56
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,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campxdev/react-blueprint",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.56",
|
|
4
4
|
"main": "./export.ts",
|
|
5
5
|
"private": false,
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@campxdev/campx-web-utils": "
|
|
7
|
+
"@campxdev/campx-web-utils": "0.1.5",
|
|
8
8
|
"@emotion/react": "^11.11.4",
|
|
9
9
|
"@emotion/styled": "^11.11.5",
|
|
10
10
|
"@mui/icons-material": "^5.15.20",
|
|
@@ -34,12 +34,15 @@ export const AppHeader = ({
|
|
|
34
34
|
<StyledHeader collapsed={collapsed} className="appHeader">
|
|
35
35
|
<Typography variant={"subtitle2"}>{clientName}</Typography>
|
|
36
36
|
<Stack alignItems={"center"} gap={"12px"} flexDirection={"row"}>
|
|
37
|
-
<StyledIconButton
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
<StyledIconButton>
|
|
38
|
+
<a
|
|
39
|
+
href={"https://campx.atlassian.net/servicedesk/customer/portal/2"}
|
|
40
|
+
target="_blank"
|
|
41
|
+
rel="noreferrer"
|
|
42
|
+
style={{ textDecoration: "none" }}
|
|
43
|
+
>
|
|
44
|
+
<HelpIcon size={20} />
|
|
45
|
+
</a>
|
|
43
46
|
</StyledIconButton>
|
|
44
47
|
<UserBox
|
|
45
48
|
fullName={userFullName}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Avatar, Box, Stack, Typography, useTheme } from "@mui/material";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
+
import logout from "../../../../utils/logout";
|
|
3
4
|
import DialogButton from "../../../Navigation/DialogButton/DialogButton";
|
|
4
5
|
import { DropdownMenu } from "../../../Navigation/DropDownMenu/DropDownMenu";
|
|
5
6
|
import { DropdownMenuItem } from "../../../Navigation/DropDownMenu/DropdownMenuItem";
|
|
@@ -88,7 +89,7 @@ export default function UserBox({
|
|
|
88
89
|
</Stack>
|
|
89
90
|
</Stack>
|
|
90
91
|
}
|
|
91
|
-
onClick={() =>
|
|
92
|
+
onClick={() => console.log("Action 1 clicked")}
|
|
92
93
|
/>,
|
|
93
94
|
showActiveDevices && (
|
|
94
95
|
<DropdownMenuItem
|
|
@@ -136,7 +137,7 @@ export default function UserBox({
|
|
|
136
137
|
/>
|
|
137
138
|
</Stack>
|
|
138
139
|
}
|
|
139
|
-
onClick={
|
|
140
|
+
onClick={logout}
|
|
140
141
|
/>,
|
|
141
142
|
]}
|
|
142
143
|
/>
|
|
@@ -57,7 +57,12 @@ export const Sidebar = ({
|
|
|
57
57
|
match={match}
|
|
58
58
|
className="listItem"
|
|
59
59
|
>
|
|
60
|
-
<StyledLinkButton
|
|
60
|
+
<StyledLinkButton
|
|
61
|
+
to={path}
|
|
62
|
+
onClick={() => {
|
|
63
|
+
setCollapsed(false);
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
61
66
|
<StyledListItemButton collapsed={collapsed}>
|
|
62
67
|
<StyledListItemIcon collapsed={collapsed}>
|
|
63
68
|
{Icon ? Icon : <Icons.HomeIcon />}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// import axios, {
|
|
2
|
+
// axiosErrorToast,
|
|
3
|
+
// } from "@campxdev/campx-web-utils/src/config/axios";
|
|
4
|
+
import { axios } from "@campxdev/campx-web-utils";
|
|
5
|
+
import Cookies from "js-cookie";
|
|
6
|
+
|
|
7
|
+
export default function logout() {
|
|
8
|
+
axios({
|
|
9
|
+
method: "POST",
|
|
10
|
+
baseURL: process.env.REACT_APP_API_HOST,
|
|
11
|
+
url: "/auth-server/auth/logout",
|
|
12
|
+
})
|
|
13
|
+
.then((res) => {
|
|
14
|
+
Cookies.remove("campx_tenant");
|
|
15
|
+
Cookies.remove("campx_session_key");
|
|
16
|
+
Cookies.remove("campx_institution");
|
|
17
|
+
window.location.href = "/";
|
|
18
|
+
})
|
|
19
|
+
.catch((err) => {
|
|
20
|
+
// toast("Unable To Logout.");
|
|
21
|
+
});
|
|
22
|
+
}
|