@tap-payments/os-micro-frontend-shared 0.0.201 → 0.0.205

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.
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { memo, useEffect, useRef, useState, useMemo } from 'react';
3
3
  import { Box } from '@mui/material';
4
4
  import { useTranslation } from 'react-i18next';
5
- import { useNavigate, useLocation } from 'react-router';
5
+ import { useLocation } from 'react-router';
6
6
  import { StyledIconForDropDown, StyledMenuTitle, StyledOption, StyledSelect, StyledSelectComponent } from '../index.js';
7
7
  import { APP_CODES, blackHeadingDownArrow, blueHeadingDropdownArrow } from '../../constants/index.js';
8
8
  import { getNameText } from '../../utils/index.js';
@@ -17,7 +17,6 @@ function AppServices({ appInfo, userApp, onChangeAppServiceCode, onClickServiceI
17
17
  const [selectedOption, setSelectedOption] = useState('');
18
18
  const servicesRef = useRef(null);
19
19
  const [openDropdown, setOpenDropdown] = React.useState(false);
20
- const navigate = useNavigate();
21
20
  const pathname = useLocation();
22
21
  const { i18n } = useTranslation();
23
22
  const services = useMemo(() => {
@@ -50,12 +49,11 @@ function AppServices({ appInfo, userApp, onChangeAppServiceCode, onClickServiceI
50
49
  useEffect(() => {
51
50
  setIsDropdown(Number(appInfo === null || appInfo === void 0 ? void 0 : appInfo.dimensions.width) < initServicesWidth + 10);
52
51
  }, [appInfo === null || appInfo === void 0 ? void 0 : appInfo.dimensions.width]);
53
- const renderValue = (selected) => _jsx(StyledSelectComponent, { children: selected });
54
52
  const navigateToService = (serviceCode) => {
55
- navigate(`${appInfo.appCode.toLowerCase()}/${serviceCode.toLowerCase()}`);
56
53
  onChangeAppServiceCode === null || onChangeAppServiceCode === void 0 ? void 0 : onChangeAppServiceCode(serviceCode);
57
54
  setOpenDropdown(false);
58
55
  };
56
+ const renderValue = (selected) => _jsx(StyledSelectComponent, { children: selected });
59
57
  return (_jsxs(Wrapper, Object.assign({ maximized: appInfo.isMaximized }, { children: [services.length && !isDropdown && (_jsx(Box, Object.assign({ ref: servicesRef, display: "flex", gap: "8px", flexDirection: "row", sx: { userSelect: 'none' } }, { children: services.map((service, idx) => (_jsx(ServiceItem, { appInfo: appInfo, onClickServiceItem: onClickServiceItem, navigateToMenuItem: navigateToService, name: getNameText(service.name, i18n.language) || '', code: service.code }, `service-item-${service.code}-${idx}`))) }))), services.length && isDropdown && (_jsx(StyledSelect, Object.assign({ open: openDropdown, onClick: handleOpenDropdown, displayEmpty: true, inputProps: { 'aria-label': 'Without label' }, MenuProps: {
60
58
  anchorOrigin: {
61
59
  vertical: 40,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.0.201",
4
+ "version": "0.0.205",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
7
7
  "module": "build/index.js",