Skip to content

Commit

Permalink
Merge pull request #851 from addegbenga/fix/847-bulk-action-ui-mismatch
Browse files Browse the repository at this point in the history
Fix/847 Bulk actions bar style doesn't match design
  • Loading branch information
mlabouardy authored Jun 14, 2023
2 parents 8eec5ba + 8e31880 commit cf6b483
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useRouter } from 'next/router';
import formatNumber from '../../../utils/formatNumber';
import Button from '../../button/Button';
import { InventoryStats } from '../hooks/useInventory/types/useInventoryTypes';

Expand All @@ -14,22 +13,18 @@ type InventoryTableBulkActionsProps = {

function InventoryTableBulkActions({
bulkItems,
inventoryStats,
openBulkModal,
query,
hideResourceFromCustomView,
hideResourcesLoading
}: InventoryTableBulkActionsProps) {
const router = useRouter();
const resourceText = bulkItems.length > 1 ? 'resources' : 'resource';
return (
<>
{bulkItems && bulkItems.length > 0 && (
<div className="border-purplin-650 sticky bottom-0 flex w-full items-center justify-between bg-white py-4 px-6 text-sm font-medium shadow-[0px_-2px_4px_rgba(0,0,0,0.05)]">
<p className="text-black-900">
{bulkItems.length} {bulkItems.length > 1 ? 'resources' : 'resource'}{' '}
{inventoryStats &&
!query &&
`out of ${formatNumber(inventoryStats.resources)}`}{' '}
{bulkItems.length} {resourceText} {''}
selected
</p>
<div className="flex gap-4">
Expand All @@ -38,12 +33,8 @@ function InventoryTableBulkActions({
style="primary"
onClick={() => openBulkModal(bulkItems)}
>
Manage tags
<span className="ml-1 flex items-center justify-center rounded-lg bg-white/10 py-1 px-2 text-xs">
{formatNumber(bulkItems.length)}
</span>
Tag {resourceText}
</Button>

{router.query.view && (
<Button
size="sm"
Expand All @@ -52,9 +43,6 @@ function InventoryTableBulkActions({
loading={hideResourcesLoading}
>
Hide from view
<span className="ml-1 flex items-center justify-center rounded-lg bg-primary/10 py-1 px-2 text-xs">
{formatNumber(bulkItems.length)}
</span>
</Button>
)}
</div>
Expand Down
4 changes: 2 additions & 2 deletions dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cf6b483

Please sign in to comment.