@ssplib/react-components 0.0.246 → 0.0.248

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 },
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export default function TabNavBar({ links, title, img, pos, next, el, menuItems, color, route, paddingBottom, logoutMsg, ...props }: {
2
+ export default function TabNavBar({ links, title, img, pos, next, el, menuItems, color, route, paddingBottom, logoutMsg, logoutFunc, ...props }: {
3
3
  links: {
4
4
  name: string;
5
5
  path: string;
@@ -13,5 +13,6 @@ export default function TabNavBar({ links, title, img, pos, next, el, menuItems,
13
13
  next?: boolean;
14
14
  el?: JSX.Element;
15
15
  logoutMsg?: string;
16
+ logoutFunc?: () => void;
16
17
  pos?: 'fixed' | 'inherit';
17
18
  }): JSX.Element;
@@ -54,7 +54,7 @@ function verificarRota(route, path) {
54
54
  return route.startsWith(path);
55
55
  }
56
56
  function TabNavBar(_a) {
57
- var { links, title, img, pos = 'fixed', next = true, el, menuItems, color = 'blue', route = '/teste/89', paddingBottom = 0, logoutMsg = 'Sair' } = _a, props = __rest(_a, ["links", "title", "img", "pos", "next", "el", "menuItems", "color", "route", "paddingBottom", "logoutMsg"]);
57
+ var { links, title, img, pos = 'fixed', next = true, el, menuItems, color = 'blue', route = '/teste/89', paddingBottom = 0, logoutMsg = 'Sair', logoutFunc } = _a, props = __rest(_a, ["links", "title", "img", "pos", "next", "el", "menuItems", "color", "route", "paddingBottom", "logoutMsg", "logoutFunc"]);
58
58
  let router = undefined;
59
59
  if (next)
60
60
  router = (0, router_1.useRouter)();
@@ -145,6 +145,8 @@ function TabNavBar(_a) {
145
145
  menuItems,
146
146
  react_1.default.createElement(material_1.MenuItem, { onClick: (e) => {
147
147
  setAvatarAnchor(null);
148
+ if (!!logoutFunc)
149
+ logoutFunc();
148
150
  logout();
149
151
  } },
150
152
  react_1.default.createElement(material_1.Stack, { direction: 'row', spacing: 1 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.246",
3
+ "version": "0.0.248",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",