@ssplib/react-components 0.0.173 → 0.0.174
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/components/navbar/NavBar.js +14 -1
- package/package.json +1 -1
|
@@ -78,6 +78,19 @@ function NavBar(_a) {
|
|
|
78
78
|
setLoading(false);
|
|
79
79
|
}
|
|
80
80
|
}, [router]);
|
|
81
|
+
function changeRoute(e, path) {
|
|
82
|
+
setLoading(true);
|
|
83
|
+
if (router) {
|
|
84
|
+
router
|
|
85
|
+
.push({
|
|
86
|
+
pathname: path,
|
|
87
|
+
})
|
|
88
|
+
.finally(() => setLoading(false));
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
setLoading(false);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
81
94
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
82
95
|
react_1.default.createElement(material_1.Box, { position: pos, sx: { width: '100%', zIndex: 100 } },
|
|
83
96
|
react_1.default.createElement(material_1.AppBar, { position: 'relative', elevation: 0, sx: { backgroundColor: '#F1F5F9', color: 'black', paddingY: 1, paddingX: { xs: 1, md: 4 } } },
|
|
@@ -107,7 +120,7 @@ function NavBar(_a) {
|
|
|
107
120
|
},
|
|
108
121
|
},
|
|
109
122
|
} },
|
|
110
|
-
react_1.default.createElement(
|
|
123
|
+
react_1.default.createElement(material_1.Button, { onClick: (e) => changeRoute(e, x.path), sx: { textTransform: 'capitalize' } }, x.name))))),
|
|
111
124
|
react_1.default.createElement(material_1.Stack, { direction: 'row', spacing: 2 },
|
|
112
125
|
react_1.default.createElement(material_1.Box, null, el),
|
|
113
126
|
user ? (react_1.default.createElement(material_1.Stack, { direction: 'row', spacing: 1, sx: {
|