@wecodesolutions/shared-react-components-ts 0.6.0 → 0.7.1

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.
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ declare type NavItem = {
3
+ label: string;
4
+ submenu?: NavItem[];
5
+ visible: boolean;
6
+ };
7
+ declare type NavigationBarProps = {
8
+ navItems: NavItem[];
9
+ };
10
+ declare const NavigationBar: React.FC<NavigationBarProps>;
11
+ export default NavigationBar;
package/dist/index.d.ts CHANGED
@@ -5,4 +5,5 @@ export * from './components/buttons/SignInWithGoogle/SignInWithGoogle';
5
5
  export * from './components/formContainer/FormContainer';
6
6
  export * from './components/icons/AllCustomIcons';
7
7
  export * from './components/inputField/InputField';
8
+ export * from './components/navBar/NavBar';
8
9
  export * from './components/validationMessage/ValidationMessage';
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.6.0",
2
+ "version": "0.7.1",
3
3
  "name": "@wecodesolutions/shared-react-components-ts",
4
4
  "publishConfig": {
5
5
  "access": "public"
@@ -0,0 +1,43 @@
1
+ // NavigationBar.tsx
2
+ import React from 'react';
3
+
4
+ type NavItem = {
5
+ label: string;
6
+ submenu?: NavItem[];
7
+ visible: boolean;
8
+ };
9
+
10
+ type NavigationBarProps = {
11
+ navItems: NavItem[];
12
+ };
13
+
14
+ export const NavigationBar: React.FC<NavigationBarProps> = ({ navItems }) => {
15
+ return (
16
+ <nav style={{ display: 'flex', justifyContent: 'space-between', padding: '10px', backgroundColor: '#001f3f', color: '#fff' }}>
17
+ {navItems.map((item, index) =>
18
+ item.visible && (
19
+ <div key={index} style={{ margin: '0 15px', position: 'relative' }}>
20
+ <span>{item.label}</span>
21
+ {item.submenu && (
22
+ <div
23
+ style={{
24
+ position: 'absolute',
25
+ top: '100%',
26
+ left: '0',
27
+ backgroundColor: '#003366',
28
+ padding: '10px',
29
+ borderRadius: '5px',
30
+ zIndex: 1,
31
+ }}
32
+ >
33
+ {item.submenu.map((subItem, subIndex) =>
34
+ subItem.visible && <div key={subIndex} style={{ padding: '5px 0' }}>{subItem.label}</div>
35
+ )}
36
+ </div>
37
+ )}
38
+ </div>
39
+ )
40
+ )}
41
+ </nav>
42
+ );
43
+ };
package/src/index.tsx CHANGED
@@ -5,4 +5,5 @@ export * from './components/buttons/SignInWithGoogle/SignInWithGoogle';
5
5
  export * from './components/formContainer/FormContainer';
6
6
  export * from './components/icons/AllCustomIcons';
7
7
  export * from './components/inputField/InputField';
8
+ export * from './components/navBar/NavBar';
8
9
  export * from './components/validationMessage/ValidationMessage';