فهرست منبع

Keep the import sources readable when the settings page is narrow (#657)

* Keep the import sources readable when the settings page is narrow

* Break a single long word inside an import button
Bernt Christian Egeland 5 روز پیش
والد
کامیت
7d21805a5d
1فایلهای تغییر یافته به همراه9 افزوده شده و 3 حذف شده
  1. 9 3
      src/app/(authenticated)/settings/data/data-settings.tsx

+ 9 - 3
src/app/(authenticated)/settings/data/data-settings.tsx

@@ -1285,15 +1285,21 @@ function ImportSourceRow({
   children: React.ReactNode
   children: React.ReactNode
 }) {
 }) {
   return (
   return (
-    <li id={id} className="flex flex-col gap-3 px-5 py-4 sm:flex-row sm:items-center">
+    // Wraps by the room the row really has, not the window: the settings menu
+    // takes a column of its own, so a long set of buttons drops below the text
+    // instead of squeezing it to a word a line.
+    <li id={id} className="flex flex-wrap items-center gap-3 px-5 py-4">
       <div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground">
       <div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground">
         <Icon className="h-5 w-5" />
         <Icon className="h-5 w-5" />
       </div>
       </div>
-      <div className="min-w-0 flex-1">
+      <div className="min-w-0 flex-1 basis-64">
         <div className="flex items-center text-sm font-medium">{title}</div>
         <div className="flex items-center text-sm font-medium">{title}</div>
         <p className="text-xs text-muted-foreground">{description}</p>
         <p className="text-xs text-muted-foreground">{description}</p>
       </div>
       </div>
-      <div className="flex flex-wrap gap-2 sm:justify-end">{children}</div>
+      {/* A label longer than the row breaks inside its button, not out of the card. */}
+      <div className="flex max-w-full flex-wrap gap-2 [&>*]:h-auto [&>*]:min-h-8 [&>*]:max-w-full [&>*]:whitespace-normal [&>*]:[overflow-wrap:anywhere]">
+        {children}
+      </div>
     </li>
     </li>
   )
   )
 }
 }