Skip to content

Commit e8feb3b

Browse files
committed
Fix alert-box responsiveness on mobile devices
1 parent 8435f4c commit e8feb3b

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

components/ui/alert-box.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,26 +167,32 @@ export const AlertBox = memo(function AlertBox({
167167
className
168168
)}
169169
>
170-
<div className="flex items-start gap-3">
170+
<div className="flex flex-wrap items-start gap-3">
171171
{/* Alert icon */}
172-
<div className="mt-0.5" aria-hidden="true">
172+
<div className="mt-0.5 shrink-0" aria-hidden="true">
173173
<Icon className={`h-5 w-5 ${styles.icon}`} />
174174
</div>
175+
175176
{/* Alert content */}
176177
<motion.div
177-
className="flex-1"
178+
className="flex-1 min-w-0"
178179
initial={{ opacity: 0 }}
179180
animate={{ opacity: 1 }}
180181
transition={{ delay: 0.1, duration: 0.2 }}
181182
>
182-
{/* Alert title */}
183183
{(title || defaultTitle) && (
184-
<h5 className={`mb-1 font-semibold ${styles.title}`}>{title || defaultTitle}</h5>
184+
<h5 className={`mb-1 font-semibold text-sm md:text-base ${styles.title}`}>
185+
{title || defaultTitle}
186+
</h5>
185187
)}
186-
{/* Main alert text */}
187-
<div className={`prose-sm ${styles.text}`}>{children}</div>
188+
<div
189+
className={`prose-sm md:prose-base break-words overflow-x-auto max-w-full ${styles.text}`}
190+
>
191+
{children}
192+
</div>
188193
</motion.div>
189194
</div>
195+
190196
</motion.div>
191197
);
192198
});

0 commit comments

Comments
 (0)