Skip to content

Commit b0696cc

Browse files
committed
fix: change banner positioning to relative instead of fixed
- Banner now appears above navbar instead of covering it - Removed fixed positioning and body class management - Banner flows naturally in the document layout
1 parent 105ddf9 commit b0696cc

File tree

2 files changed

+1
-38
lines changed

2 files changed

+1
-38
lines changed

src/components/TeamsBanner/index.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ export function TeamsBanner(): React.ReactElement | null {
1212
}
1313
}, []);
1414

15-
useEffect(() => {
16-
// Add or remove body class based on visibility
17-
if (isVisible) {
18-
document.body.classList.add('teams-banner-visible');
19-
} else {
20-
document.body.classList.remove('teams-banner-visible');
21-
}
22-
23-
// Cleanup on unmount
24-
return () => {
25-
document.body.classList.remove('teams-banner-visible');
26-
};
27-
}, [isVisible]);
28-
2915
const handleDismiss = () => {
3016
setIsVisible(false);
3117
localStorage.setItem('teamsBannerDismissed', 'true');

src/components/TeamsBanner/styles.module.css

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
.teamsBanner {
2-
position: fixed;
3-
top: 0;
4-
left: 0;
5-
right: 0;
6-
z-index: 1000; /* Above navbar which typically has z-index: 999 */
2+
position: relative;
73
display: flex;
84
align-items: center;
95
justify-content: center;
@@ -61,16 +57,6 @@
6157
outline-offset: 2px;
6258
}
6359

64-
/* Add padding to body when banner is visible */
65-
:global(body.teams-banner-visible) {
66-
padding-top: 52px; /* Height of the banner */
67-
}
68-
69-
/* Adjust navbar position when banner is visible */
70-
:global(body.teams-banner-visible) :global(.navbar) {
71-
top: 52px !important; /* Push navbar below banner */
72-
}
73-
7460
@media (max-width: 768px) {
7561
.teamsBanner {
7662
padding: 1rem;
@@ -88,13 +74,4 @@
8874
top: 50%;
8975
transform: translateY(-50%);
9076
}
91-
92-
/* Adjust padding for mobile */
93-
:global(body.teams-banner-visible) {
94-
padding-top: 72px; /* Slightly more height on mobile */
95-
}
96-
97-
:global(body.teams-banner-visible) :global(.navbar) {
98-
top: 72px !important;
99-
}
10077
}

0 commit comments

Comments
 (0)