Skip to content

Commit 0838b79

Browse files
committed
remove magic numbers
1 parent cead0a2 commit 0838b79

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/components/Table/TableRow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import useTheme from '@hooks/useTheme';
1010
import useThemeStyles from '@hooks/useThemeStyles';
1111
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
1212
import useSkeletonSpan from '@libs/telemetry/useSkeletonSpan';
13+
import variables from '@styles/variables';
1314
import CONST from '@src/CONST';
1415
import {useTableContext} from './TableContext';
1516

@@ -115,10 +116,10 @@ export default function TableRow({
115116
!!isLoading && LoadingComponent ? (
116117
<View style={[styles.flexRow, styles.alignItemsCenter, styles.flex1]}>
117118
<SkeletonViewContentLoader
118-
height={32}
119119
width="100%"
120120
backgroundColor={theme.skeletonLHNIn}
121121
foregroundColor={theme.skeletonLHNOut}
122+
height={variables.tableSkeletonHeight}
122123
>
123124
<LoadingComponent />
124125
</SkeletonViewContentLoader>

src/components/Table/TableSkeleton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import useTheme from '@hooks/useTheme';
66
import useThemeStyles from '@hooks/useThemeStyles';
77
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
88
import useSkeletonSpan from '@libs/telemetry/useSkeletonSpan';
9+
import variables from '@styles/variables';
910

1011
type TableSkeletonProps = {
1112
/** The number of skeleton rows to render */
@@ -44,10 +45,10 @@ export default function TableSkeleton({renderSkeletonItem, reasonAttributes, row
4445
style={[tableSkeletonRowStyles, index !== rowCount - 1 && styles.borderBottom]}
4546
>
4647
<SkeletonViewContentLoader
47-
height={32}
4848
width="100%"
4949
backgroundColor={theme.skeletonLHNIn}
5050
foregroundColor={theme.skeletonLHNOut}
51+
height={variables.tableSkeletonHeight}
5152
>
5253
{renderSkeletonItem()}
5354
</SkeletonViewContentLoader>

src/styles/variables.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export default {
130130
tableRowPaddingHorizontal: 12,
131131
tableGroupRowPaddingVertical: 4,
132132
tableGroupRowHeight: 36,
133+
tableSkeletonHeight: 32,
133134
sectionMenuItemHeight: 52,
134135
sectionMenuItemHeightCompact: 44,
135136
optionsListSectionHeaderHeight: getValueUsingPixelRatio(32, 38),

0 commit comments

Comments
 (0)