Skip to content

Commit b4d2bcb

Browse files
author
Amrit Borah
committed
fix: review 3Bcomments
1 parent 7ab7b14 commit b4d2bcb

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

src/Shared/Components/Table/TableContent.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ const TableContent = <
214214
(state: boolean) =>
215215
({ detail: { activeRowData } }) => {
216216
if ((activeRowData as RowType<RowData>).expandableRows) {
217-
setExpandState({
218-
...expandState,
217+
setExpandState((prev) => ({
218+
...prev,
219219
[activeRowData.id]: state,
220-
})
220+
}))
221221
}
222222
}
223223

@@ -297,16 +297,16 @@ const TableContent = <
297297
return Object.values(bulkSelectionState)
298298
}
299299

300+
const showIconOrExpandActionGutter = isBulkSelectionConfigured || !!rowStartIconConfig || isAnyRowExpandable
301+
300302
const renderRows = () => {
301303
if (loading && !visibleColumns.length) {
302304
return SHIMMER_DUMMY_ARRAY.map((shimmerRowLabel) => (
303305
<div
304306
key={shimmerRowLabel}
305307
className={`px-20 flex left py-12 dc__gap-16 ${showSeparatorBetweenRows ? 'border__secondary--bottom' : ''}`}
306308
>
307-
{isBulkSelectionConfigured || rowStartIconConfig || isAnyRowExpandable ? (
308-
<div className="shimmer w-20" />
309-
) : null}
309+
{showIconOrExpandActionGutter ? <div className="shimmer w-20" /> : null}
310310
{SHIMMER_DUMMY_ARRAY.map((shimmerCellLabel) => (
311311
<div key={shimmerCellLabel} className="shimmer w-200" />
312312
))}
@@ -323,7 +323,7 @@ const TableContent = <
323323
gridTemplateColumns,
324324
}}
325325
>
326-
{isBulkSelectionConfigured || rowStartIconConfig || isAnyRowExpandable ? (
326+
{showIconOrExpandActionGutter ? (
327327
<div className="py-12 flex" aria-label="Loading...">
328328
<div className="shimmer h-16 w-20" />
329329
</div>
@@ -526,9 +526,7 @@ const TableContent = <
526526
>
527527
{loading && !visibleColumns.length ? (
528528
<div className="flexbox py-12 dc__gap-16">
529-
{isBulkSelectionConfigured || rowStartIconConfig || isAnyRowExpandable ? (
530-
<div className="shimmer w-20" />
531-
) : null}
529+
{showIconOrExpandActionGutter ? <div className="shimmer w-20" /> : null}
532530
{SHIMMER_DUMMY_ARRAY.map((label) => (
533531
<div key={label} className="shimmer w-200" />
534532
))}

src/Shared/Components/Table/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
&.expand-row-btn::before,
4545
&.row-start-icon::before,
46-
&.expanded-tree-libe::before {
46+
&.expanded-tree-line::before {
4747
left: -24px;
4848
width: 24px;
4949
}

0 commit comments

Comments
 (0)