@ssplib/react-components 0.0.247 → 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 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.247",
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>",