Skip to content

Commit 04bb32c

Browse files
committed
Improve notifications panel responsiveness and layout
Updated the notifications panel to use fixed positioning and responsive widths for better mobile support. Enhanced layout with flex-wrap, break-words, and whitespace utilities to prevent overflow and improve readability. Adjusted max heights for better viewport usage and added transition to the footer button.
1 parent b458aee commit 04bb32c

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

components/notifications-panel.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function NotificationsPanel() {
8585
/>
8686

8787
{/* Notification Panel */}
88-
<div className="absolute right-0 top-full mt-2 w-96 bg-card border-2 border-border shadow-2xl z-50 rounded-lg overflow-hidden">
88+
<div className="fixed sm:absolute right-2 sm:right-0 top-16 sm:top-full mt-2 w-[calc(100vw-1rem)] sm:w-96 max-w-md bg-card border-2 border-border shadow-2xl z-50 rounded-lg overflow-hidden">
8989
{/* Header */}
9090
<div className="flex items-center justify-between p-4 border-b-2 border-border bg-muted/50">
9191
<div className="flex items-center gap-2">
@@ -103,7 +103,7 @@ export function NotificationsPanel() {
103103
</div>
104104

105105
{/* Content */}
106-
<div className="max-h-[500px] overflow-y-auto">
106+
<div className="max-h-[calc(100vh-12rem)] sm:max-h-[500px] overflow-y-auto">
107107
{upcomingMeetings.length === 0 ? (
108108
<div className="p-8 text-center">
109109
<div className="inline-flex items-center justify-center w-16 h-16 rounded-full bg-muted mb-4">
@@ -124,16 +124,16 @@ export function NotificationsPanel() {
124124
className="p-4 hover:bg-muted/50 transition-colors cursor-pointer"
125125
>
126126
{/* Meeting Title */}
127-
<h4 className="font-semibold text-base mb-3 text-foreground">
127+
<h4 className="font-semibold text-base mb-3 text-foreground break-words">
128128
{meeting.title}
129129
</h4>
130130

131131
{/* Meeting Details */}
132132
<div className="space-y-2">
133-
<div className="flex items-center gap-2 text-sm text-muted-foreground">
133+
<div className="flex items-center gap-2 text-sm text-muted-foreground flex-wrap">
134134
<div className="flex items-center gap-1.5 bg-muted px-2 py-1 rounded">
135-
<Calendar className="h-4 w-4 text-primary" />
136-
<span className="font-medium">
135+
<Calendar className="h-4 w-4 text-primary flex-shrink-0" />
136+
<span className="font-medium whitespace-nowrap">
137137
{new Date(meeting.date).toLocaleDateString('en-US', {
138138
weekday: 'short',
139139
month: 'short',
@@ -142,8 +142,8 @@ export function NotificationsPanel() {
142142
</span>
143143
</div>
144144
<div className="flex items-center gap-1.5 bg-muted px-2 py-1 rounded">
145-
<Clock className="h-4 w-4 text-primary" />
146-
<span className="font-medium">{meeting.time}</span>
145+
<Clock className="h-4 w-4 text-primary flex-shrink-0" />
146+
<span className="font-medium whitespace-nowrap">{meeting.time}</span>
147147
</div>
148148
</div>
149149

@@ -152,14 +152,14 @@ export function NotificationsPanel() {
152152
<div className="flex-1 h-1 bg-primary/20 rounded-full overflow-hidden">
153153
<div className="h-full bg-primary rounded-full animate-pulse" style={{ width: '60%' }} />
154154
</div>
155-
<span className="text-xs font-bold text-primary">
155+
<span className="text-xs font-bold text-primary whitespace-nowrap">
156156
{t.notifications?.startsIn || "Starts in"} {formatTimeUntil(meeting.date, meeting.time)}
157157
</span>
158158
</div>
159159

160160
{/* Duration Badge */}
161161
<div className="flex justify-end">
162-
<span className="text-xs bg-primary/10 text-primary px-2 py-0.5 rounded-full font-medium">
162+
<span className="text-xs bg-primary/10 text-primary px-2 py-0.5 rounded-full font-medium whitespace-nowrap">
163163
{meeting.duration} min
164164
</span>
165165
</div>
@@ -173,7 +173,7 @@ export function NotificationsPanel() {
173173
{/* Footer */}
174174
{upcomingMeetings.length > 0 && (
175175
<div className="p-3 border-t-2 border-border bg-muted/50 text-center">
176-
<button className="text-sm text-primary hover:underline font-medium">
176+
<button className="text-sm text-primary hover:underline font-medium transition-colors">
177177
View All Meetings →
178178
</button>
179179
</div>

0 commit comments

Comments
 (0)