@ssplib/react-components 0.0.19 → 0.0.21

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, }: {
2
+ export default function NavBar({ links, title, img, pos, next, el, menuItems, }: {
3
3
  links: {
4
4
  name: string;
5
5
  path: string;
@@ -7,6 +7,7 @@ export default function NavBar({ links, title, img, pos, next, el, }: {
7
7
  title: string;
8
8
  img: string;
9
9
  next?: boolean;
10
+ menuItems: JSX.Element | JSX.Element[];
10
11
  el?: JSX.Element;
11
12
  pos?: 'fixed' | 'inherit';
12
13
  }): JSX.Element;
@@ -37,7 +37,7 @@ const link_1 = __importDefault(require("next/link"));
37
37
  const router_1 = require("next/router");
38
38
  const react_1 = __importStar(require("react"));
39
39
  const auth_1 = require("../../context/auth");
40
- function NavBar({ links, title, img, pos = 'fixed', next = true, el, }) {
40
+ function NavBar({ links, title, img, pos = 'fixed', next = true, el, menuItems, }) {
41
41
  let router = undefined;
42
42
  if (next)
43
43
  router = (0, router_1.useRouter)();
@@ -61,8 +61,6 @@ function NavBar({ links, title, img, pos = 'fixed', next = true, el, }) {
61
61
  pathname: link,
62
62
  });
63
63
  }, [router]);
64
- if (!userLoaded)
65
- return react_1.default.createElement(react_1.default.Fragment, null);
66
64
  return (react_1.default.createElement(react_1.default.Fragment, null,
67
65
  react_1.default.createElement(material_1.Box, { position: pos, sx: { width: '100%', zIndex: 100 } },
68
66
  react_1.default.createElement(material_1.AppBar, { position: 'relative', elevation: 0, sx: { backgroundColor: '#F1F5F9', color: 'black', paddingY: 1, paddingX: { xs: 1, md: 4 } } },
@@ -106,40 +104,7 @@ function NavBar({ links, title, img, pos = 'fixed', next = true, el, }) {
106
104
  react_1.default.createElement(material_1.Box, { sx: { display: 'flex', alignItems: 'center' } },
107
105
  react_1.default.createElement(material_1.Avatar, { sx: { width: 30, height: 30 }, src: user.image }),
108
106
  react_1.default.createElement(material_1.Menu, { open: avatarMenu, onClose: (e) => setAvatarAnchor(null), anchorEl: avatarAnchor, disableScrollLock: true, transformOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'bottom' }, sx: { '.MuiMenu-paper': { borderRadius: 4 } } },
109
- react_1.default.createElement(material_1.Box, { sx: { paddingTop: 2 } },
110
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', fontFamily: 'Inter', fontSize: 14, paddingLeft: 2 }, "Minha conta"),
111
- react_1.default.createElement(material_1.Box, { sx: { borderBottom: 1, borderColor: '#c9d1d1', marginX: 2 } })),
112
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
113
- react_1.default.createElement(link_1.default, { href: 'https://contas.staging.acesso.gov.br/alteracao_cadastro' },
114
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
115
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Dados pessoais")))),
116
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
117
- react_1.default.createElement(link_1.default, { href: 'https://contas.staging.acesso.gov.br/seguranca' },
118
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
119
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Seguran\u00E7a da Conta")))),
120
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
121
- react_1.default.createElement(link_1.default, { href: 'https://contas.staging.acesso.gov.br/privacidade' },
122
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
123
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Privacidade")))),
124
- react_1.default.createElement(material_1.Box, null,
125
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', fontFamily: 'Inter', fontSize: 14, paddingLeft: 2 }, "Servi\u00E7os"),
126
- react_1.default.createElement(material_1.Box, { sx: { borderBottom: 1, borderColor: '#c9d1d1', marginX: 2 } })),
127
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
128
- react_1.default.createElement(link_1.default, { href: 'https://servicos.staging.acesso.gov.br/carteira' },
129
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
130
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Carteira de Documentos")))),
131
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
132
- react_1.default.createElement(link_1.default, { href: 'https://servicos.staging.acesso.gov.br/certidoes' },
133
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
134
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Baixar certid\u00F5es")))),
135
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
136
- react_1.default.createElement(link_1.default, { href: 'https://servicos.staging.acesso.gov.br/notificacoes' },
137
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
138
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Notifica\u00E7\u00F5es")))),
139
- react_1.default.createElement(material_1.Box, { sx: { '& a': { textDecoration: 'none' } } },
140
- react_1.default.createElement(link_1.default, { href: 'https://www.gov.br/governodigital/pt-br/conta-gov-br/perguntas-frequentes' },
141
- react_1.default.createElement(material_1.MenuItem, { sx: { paddingY: 2 } },
142
- react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize', color: '#3B82F6' }, "Perguntas frequentes")))),
107
+ menuItems,
143
108
  react_1.default.createElement(material_1.MenuItem, { onClick: (e) => {
144
109
  setAvatarAnchor(null);
145
110
  logout();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",
@@ -32,8 +32,7 @@
32
32
  "@types/react": "^18.0.37",
33
33
  "prop-types": "15.8.1",
34
34
  "react-dom": "18.2.0",
35
- "@types/node": "18.16.1",
36
- "@mui/types": "^7.2.4"
35
+ "@types/node": "18.16.1"
37
36
  },
38
37
  "repository": {
39
38
  "type": "git",