mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
fix: show sub-rows for single-subscription users + fix floating bar position
- Auto-expand ALL users with subscriptions (was only > 1), so users with single subscription also show their sub-row for selection - FloatingActionBar: render via createPortal to document.body to ensure fixed positioning works correctly regardless of parent overflow/transform contexts (was trapped inside scrollable area)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import React, { useState, useEffect, useCallback, useMemo, useRef } from 'react';
|
import React, { useState, useEffect, useCallback, useMemo, useRef } from 'react';
|
||||||
|
import { createPortal } from 'react-dom';
|
||||||
import { useNavigate } from 'react-router';
|
import { useNavigate } from 'react-router';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {
|
import {
|
||||||
@@ -1451,10 +1452,10 @@ export default function AdminBulkActions() {
|
|||||||
);
|
);
|
||||||
setUsers(data.users);
|
setUsers(data.users);
|
||||||
setTotal(data.total);
|
setTotal(data.total);
|
||||||
// Auto-expand all users with multiple subscriptions
|
// Auto-expand all users who have subscriptions
|
||||||
const autoExpand: Record<number, boolean> = {};
|
const autoExpand: Record<number, boolean> = {};
|
||||||
for (const u of data.users) {
|
for (const u of data.users) {
|
||||||
if ((u.subscriptions?.length ?? 0) > 1) {
|
if ((u.subscriptions?.length ?? 0) > 0) {
|
||||||
autoExpand[u.id] = true;
|
autoExpand[u.id] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2181,7 +2182,8 @@ export default function AdminBulkActions() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Floating action bar */}
|
{/* Floating action bar — portal to body for correct fixed positioning */}
|
||||||
|
{createPortal(
|
||||||
<FloatingActionBar
|
<FloatingActionBar
|
||||||
selectedUserCount={selectedUserIds.length}
|
selectedUserCount={selectedUserIds.length}
|
||||||
selectedSubscriptionCount={selectedSubscriptionIds.length}
|
selectedSubscriptionCount={selectedSubscriptionIds.length}
|
||||||
@@ -2189,7 +2191,9 @@ export default function AdminBulkActions() {
|
|||||||
totalVisibleSubscriptionCount={allVisibleSubscriptionIds.length}
|
totalVisibleSubscriptionCount={allVisibleSubscriptionIds.length}
|
||||||
onAction={handleOpenAction}
|
onAction={handleOpenAction}
|
||||||
onToggleAllSubscriptions={toggleAllSubscriptions}
|
onToggleAllSubscriptions={toggleAllSubscriptions}
|
||||||
/>
|
/>,
|
||||||
|
document.body,
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Action modal */}
|
{/* Action modal */}
|
||||||
<ActionModal
|
<ActionModal
|
||||||
|
|||||||
Reference in New Issue
Block a user