@ssplib/react-components 0.0.246 → 0.0.247
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export default function NavBar({ links, title, img, pos, next, el, menuItems, paddingBottom, logoutMsg, ...props }: {
|
|
2
|
+
export default function NavBar({ links, title, img, pos, next, el, menuItems, paddingBottom, logoutMsg, logoutFunc, ...props }: {
|
|
3
3
|
links: {
|
|
4
4
|
name: string;
|
|
5
5
|
path: string;
|
|
@@ -11,5 +11,6 @@ export default function NavBar({ links, title, img, pos, next, el, menuItems, pa
|
|
|
11
11
|
next?: boolean;
|
|
12
12
|
el?: JSX.Element;
|
|
13
13
|
logoutMsg?: string;
|
|
14
|
+
logoutFunc?: () => void;
|
|
14
15
|
pos?: 'fixed' | 'inherit';
|
|
15
16
|
}): JSX.Element;
|
|
@@ -49,7 +49,7 @@ const router_1 = require("next/router");
|
|
|
49
49
|
const react_1 = __importStar(require("react"));
|
|
50
50
|
const auth_1 = require("../../context/auth");
|
|
51
51
|
function NavBar(_a) {
|
|
52
|
-
var { links, title, img, pos = 'fixed', next = true, el, menuItems, paddingBottom = 0, logoutMsg = 'Sair' } = _a, props = __rest(_a, ["links", "title", "img", "pos", "next", "el", "menuItems", "paddingBottom", "logoutMsg"]);
|
|
52
|
+
var { links, title, img, pos = 'fixed', next = true, el, menuItems, paddingBottom = 0, logoutMsg = 'Sair', logoutFunc } = _a, props = __rest(_a, ["links", "title", "img", "pos", "next", "el", "menuItems", "paddingBottom", "logoutMsg", "logoutFunc"]);
|
|
53
53
|
let router = undefined;
|
|
54
54
|
if (next)
|
|
55
55
|
router = (0, router_1.useRouter)();
|
|
@@ -137,6 +137,8 @@ function NavBar(_a) {
|
|
|
137
137
|
menuItems,
|
|
138
138
|
react_1.default.createElement(material_1.MenuItem, { onClick: (e) => {
|
|
139
139
|
setAvatarAnchor(null);
|
|
140
|
+
if (!!logoutFunc)
|
|
141
|
+
logoutFunc();
|
|
140
142
|
logout();
|
|
141
143
|
} },
|
|
142
144
|
react_1.default.createElement(material_1.Stack, { direction: 'row', spacing: 1 },
|