@omniumretail/component-library 1.2.57 → 1.2.58

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.
@@ -24,4 +24,5 @@ export interface HeaderProps {
24
24
  handleMarkAllAsRead?: () => void;
25
25
  notifications?: BellNotification[];
26
26
  shouldConfirmNavigation?: boolean;
27
+ companyName?: string;
27
28
  }
@@ -3,5 +3,5 @@ import { HeaderProps } from './Header.types';
3
3
  * Header component to display navigation bar with dropdown menus and action button.
4
4
  * @param {HeaderProps} props - Properties passed to the component.
5
5
  */
6
- export declare const Header: ({ menuList, actionButton, logout, homeUrl, profileUrl, onLeavingPage, userName, pageTitle, onFilterChange, notifications, onNotificationClick, handleMarkAllAsRead, shouldConfirmNavigation }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const Header: ({ menuList, actionButton, logout, homeUrl, profileUrl, onLeavingPage, userName, pageTitle, onFilterChange, notifications, onNotificationClick, handleMarkAllAsRead, shouldConfirmNavigation, companyName, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
7
7
  export default Header;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/component-library",
3
- "version": "1.2.57",
3
+ "version": "1.2.58",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
Binary file
@@ -27,4 +27,5 @@ export interface HeaderProps {
27
27
  handleMarkAllAsRead?: () => void;
28
28
  notifications?: BellNotification[];
29
29
  shouldConfirmNavigation?: boolean;
30
+ companyName?: string;
30
31
  }
@@ -1,6 +1,7 @@
1
1
  import { useRef, useState } from 'react';
2
2
  import { DownOutlined, UpOutlined, BarsOutlined, CloseOutlined } from '@ant-design/icons';
3
3
  import omniumIcon from '../../assets/images/omnium-retail-logo.png';
4
+ import a2ai from '../../assets/images/A2AI-logo.png';
4
5
  import omniumWhiteIcon from '../../assets/images/omnium-retail-logo-white.png';
5
6
  import styles from './styles.module.scss';
6
7
  import classNames from 'classnames';
@@ -8,6 +9,19 @@ import { HeaderProps, MenuItem } from './Header.types';
8
9
  import { getMenuTopList, getMenuBottomList } from './Header.data';
9
10
  import { BellNotifications } from '../BellNotifications';
10
11
 
12
+ const logoMap: Record<string, { normal: string; white: string; alt: string }> = {
13
+ omnium: {
14
+ normal: omniumIcon,
15
+ white: omniumWhiteIcon,
16
+ alt: 'Omnium Retail Logo'
17
+ },
18
+ a2ai: {
19
+ normal: a2ai,
20
+ white: a2ai,
21
+ alt: 'XPTO Logo'
22
+ }
23
+ };
24
+
11
25
  /**
12
26
  * Header component to display navigation bar with dropdown menus and action button.
13
27
  * @param {HeaderProps} props - Properties passed to the component.
@@ -25,7 +39,8 @@ export const Header = ({
25
39
  notifications,
26
40
  onNotificationClick,
27
41
  handleMarkAllAsRead,
28
- shouldConfirmNavigation
42
+ shouldConfirmNavigation,
43
+ companyName = 'omnium',
29
44
  }: HeaderProps) => {
30
45
 
31
46
  const [isMenuOpen, setIsMenuOpen] = useState(false);
@@ -97,6 +112,13 @@ export const Header = ({
97
112
  setActiveDropdown(activeDropdown === index ? null : index);
98
113
  };
99
114
 
115
+ const getCompanyLogos = (company: string) => {
116
+ const companyKey = company.toLowerCase();
117
+ return logoMap[companyKey] || logoMap['omnium']; // Fallback para omnium se não encontrar
118
+ };
119
+
120
+ const companyLogos = getCompanyLogos(companyName);
121
+
100
122
  /**
101
123
  * Render the menu items, including dropdown menus.
102
124
  * @param {MenuItem[]} menuList - The list of menu items to render.
@@ -165,7 +187,7 @@ export const Header = ({
165
187
  {
166
188
  pageTitle
167
189
  ? <p className={styles.title}>{pageTitle}</p>
168
- : <img src={omniumIcon} alt="Omnium Retail Blue Logo" />
190
+ : <img src={companyLogos.normal} alt={companyLogos.alt} />
169
191
  }
170
192
  </div>
171
193
 
@@ -176,7 +198,7 @@ export const Header = ({
176
198
  <div className={classNames(styles.menu, { [styles.active]: isMenuOpen })}>
177
199
  <div className={styles.head}>
178
200
  <p className={styles.logoWrapper}>
179
- <img src={omniumWhiteIcon} alt="Omnium Retail White Logo" />
201
+ <img src={companyLogos.white} alt={companyLogos.alt} />
180
202
  </p>
181
203
  <CloseOutlined color={'#FFFFFF'} className={styles.toggleMenuClose} onClick={onToggleMenu} />
182
204
  </div>