Skip to content

Commit

Permalink
fix(ui): improve column layout stability with vertical list sorting s…
Browse files Browse the repository at this point in the history
…trategy
  • Loading branch information
s0up4200 committed Nov 7, 2024
1 parent 08af31f commit 82c5c4a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/components/AddServicesMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ export function AddServicesMenu({
text: "Settings",
link: url ? `${url}/settings/main` : null,
};
case "maintainerr":
return {
prefix: "Found in ",
text: "Settings",
link: url ? `${url}/settings/main` : null,
};
default:
return {
prefix: "",
Expand Down
8 changes: 4 additions & 4 deletions src/components/services/ServiceGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
arrayMove,
SortableContext,
sortableKeyboardCoordinates,
rectSortingStrategy,
verticalListSortingStrategy,
useSortable,
} from "@dnd-kit/sortable";

Expand Down Expand Up @@ -63,7 +63,7 @@ const DraggableServiceCard = ({
: undefined;

return (
<div ref={setNodeRef} style={style} className="mb-6 break-inside-avoid">
<div ref={setNodeRef} style={style} className="mb-4 break-inside-avoid">
<ServiceCard
service={service}
onRemove={onRemove}
Expand Down Expand Up @@ -206,10 +206,10 @@ export const ServiceGrid = ({
>
<SortableContext
items={items.map((item) => item.instanceId)}
strategy={rectSortingStrategy}
strategy={verticalListSortingStrategy}
>
<div
className="columns-1 md:columns-2 lg:columns-3 xl:columns-4 gap-6"
className="columns-1 sm:columns-2 lg:columns-3 2xl:columns-4 gap-4"
style={{ columnFill: "balance" }}
>
{items.map((service) => (
Expand Down
2 changes: 2 additions & 0 deletions src/components/ui/StatusIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ interface StatusIndicatorProps {
const WARNING_HEADERS = [
"Queue warnings",
"Indexers unavailable due to failures",
"Autobrr is running but reports unhealthy IRC connections",
"Autobrr is running but stats check failed",
];

export const StatusIndicator: React.FC<StatusIndicatorProps> = ({
Expand Down

0 comments on commit 82c5c4a

Please sign in to comment.