Skip to content

Commit 5d655c1

Browse files
authored
(fix) Fix devtools trigger button popover (#1272)
* (fix) Fix devtools trigger button popover This PR fixes several issues with the devtools button popover. Previously, the popover was incorrectly positioned at the top left of the screen and the popover container pushed content below the navbar down by 1rem. This PR addresses these issues by: - Adding a `wrapperClasses` prop to the IconButton component to apply custom styles to the popover container - Positioning and aligning the popover container to the top left of the devtools trigger button - Adding a box shadow to the popover container to match the help menu button's box shadow for visual consistency - Adjusting the right margin of the devtools trigger button to align with the help menu button Additional changes: - Adjusted the right margin of the help menu button's popover to align with the devtools trigger button's popover * Update packages/apps/esm-devtools-app/src/devtools/devtools-popup.styles.scss
1 parent 9603107 commit 5d655c1

File tree

5 files changed

+41
-20
lines changed

5 files changed

+41
-20
lines changed

packages/apps/esm-devtools-app/src/devtools/devtools-popup.styles.scss

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@import '~@openmrs/esm-styleguide/src/vars';
1+
@use '@carbon/layout';
2+
@use '@openmrs/esm-styleguide/src/vars' as *;
23

34
.popup {
45
position: fixed;
@@ -19,20 +20,20 @@
1920

2021
.tabList {
2122
position: fixed;
22-
height: 4rem;
23+
height: layout.$spacing-10;
2324
width: 100%;
2425
z-index: 1000;
2526
background-color: black;
2627
}
2728

2829
.tabPanels {
29-
padding: 1.5rem;
30+
padding: layout.$spacing-06;
3031
}
3132

3233
.farRight {
3334
position: absolute;
34-
right: 24px;
35-
top: 16px;
35+
right: layout.$spacing-04;
36+
top: layout.$spacing-04;
3637
display: flex;
3738
z-index: 1000;
3839
}

packages/apps/esm-devtools-app/src/devtools/devtools.component.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { type AppProps } from 'single-spa';
55
import { getCoreTranslation } from '@openmrs/esm-framework';
66
import { importMapOverridden } from './import-map.component';
77
import DevToolsPopup from './devtools-popup.component';
8-
import styles from './devtools.styles.css';
8+
import styles from './devtools.styles.scss';
99

1010
const showDevTools = () => window.spaEnv === 'development' || Boolean(localStorage.getItem('openmrs:devtools'));
1111

@@ -23,13 +23,18 @@ function DevTools(props: AppProps) {
2323
return (
2424
<>
2525
<IconButton
26+
align="left"
2627
className={classNames(styles.devtoolsTriggerButton, {
2728
[styles.overridden]: isOverridden,
2829
})}
30+
direction="left"
2931
kind="ghost"
3032
label={getCoreTranslation('toggleDevTools')}
3133
onClick={toggleDevTools}
3234
size="md"
35+
tooltipAlignment="left"
36+
tooltipPosition="top"
37+
wrapperClasses={styles.popover}
3338
>
3439
{'{\u00B7\u00B7\u00B7}'}
3540
</IconButton>

packages/apps/esm-devtools-app/src/devtools/devtools.styles.css

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@use '@carbon/colors';
2+
@use '@carbon/layout';
3+
4+
.devtoolsTriggerButton {
5+
z-index: 7900;
6+
background: colors.$white;
7+
box-shadow:
8+
0 1px 3px rgba(0, 0, 0, 0.1),
9+
0 1px 2px -1px rgba(0, 0, 0, 0.1);
10+
border-radius: layout.$spacing-02;
11+
color: colors.$gray-100;
12+
13+
&:hover {
14+
color: colors.$blue-60 !important;
15+
}
16+
}
17+
18+
.overridden {
19+
background-color: colors.$red-30;
20+
color: colors.$white;
21+
}
22+
23+
.popover {
24+
z-index: 7900;
25+
bottom: layout.$spacing-11;
26+
right: layout.$spacing-02;
27+
position: fixed;
28+
}

packages/apps/esm-help-menu-app/src/help-menu/help.styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
z-index: 7900;
3030
bottom: layout.$spacing-07;
3131
position: fixed;
32-
right: 3.25rem;
32+
right: 3rem;
3333
}

0 commit comments

Comments
 (0)