@openmrs/esm-patient-common-lib 7.0.2-pre.3880 → 7.0.2-pre.3894

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-patient-common-lib",
3
- "version": "7.0.2-pre.3880",
3
+ "version": "7.0.2-pre.3894",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Library for common patient chart components",
6
6
  "browser": "dist/openmrs-esm-patient-common-lib.js",
@@ -38,5 +38,5 @@
38
38
  "react": "18.x",
39
39
  "single-spa": "6.x"
40
40
  },
41
- "gitHead": "40fb469551666396a93ef79f0447e910f8e729c2"
41
+ "gitHead": "b731bd92ec41809dd54b423c57b01cd801f3a962"
42
42
  }
@@ -6,13 +6,12 @@ import { useWorkspaces } from '../workspaces';
6
6
  import styles from './siderail-nav-button.scss';
7
7
 
8
8
  interface TagsProps {
9
- isTablet: boolean;
10
9
  getIcon: (props: object) => JSX.Element;
11
10
  formOpenInTheBackground: boolean;
12
11
  tagContent?: string | React.ReactNode;
13
12
  }
14
13
 
15
- function Tags({ isTablet, getIcon, formOpenInTheBackground, tagContent }: TagsProps) {
14
+ function Tags({ getIcon, formOpenInTheBackground, tagContent }: TagsProps) {
16
15
  return (
17
16
  <>
18
17
  {getIcon({ size: 16 })}
@@ -51,7 +50,7 @@ export const SiderailNavButton: React.FC<SiderailNavButtonProps> = ({
51
50
  const isWorkspaceActive = workspaceWindowState !== 'hidden' && workspaceIndex === 0;
52
51
  const formOpenInTheBackground = workspaceIndex > 0 || (workspaceIndex === 0 && workspaceWindowState === 'hidden');
53
52
 
54
- if (layout === 'tablet') {
53
+ if (layout === 'tablet' || layout === 'phone') {
55
54
  return (
56
55
  <Button
57
56
  className={classNames(styles.container, { [styles.active]: isWorkspaceActive })}
@@ -62,7 +61,7 @@ export const SiderailNavButton: React.FC<SiderailNavButtonProps> = ({
62
61
  tabIndex={0}
63
62
  >
64
63
  <span className={styles.elementContainer}>
65
- <Tags isTablet formOpenInTheBackground={formOpenInTheBackground} getIcon={getIcon} tagContent={tagContent} />
64
+ <Tags formOpenInTheBackground={formOpenInTheBackground} getIcon={getIcon} tagContent={tagContent} />
66
65
  </span>
67
66
  <span>{label}</span>
68
67
  </Button>
@@ -83,12 +82,7 @@ export const SiderailNavButton: React.FC<SiderailNavButtonProps> = ({
83
82
  size="md"
84
83
  >
85
84
  <div className={styles.elementContainer}>
86
- <Tags
87
- isTablet={false}
88
- formOpenInTheBackground={formOpenInTheBackground}
89
- getIcon={getIcon}
90
- tagContent={tagContent}
91
- />
85
+ <Tags formOpenInTheBackground={formOpenInTheBackground} getIcon={getIcon} tagContent={tagContent} />
92
86
  </div>
93
87
  </IconButton>
94
88
  );