Skip to content

Commit 3fb608a

Browse files
committed
Fix custom table cells incorrectly aligning vertically rather than horizontally.
1 parent 4b0526a commit 3fb608a

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

react-native/components/createOfflineTableComponent/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,14 @@ export const createOfflineTableComponent = <
201201
switch (column?.alignment) {
202202
case 'middle':
203203
(customHeaderInput[key] as TextStyle).textAlign = 'center';
204-
(customCellInput[key] as ViewStyle).justifyContent = 'center';
204+
(customCellInput[key] as ViewStyle).alignItems = 'center';
205205
(oddRowCellInput[key] as TextStyle).textAlign = 'center';
206206
(evenRowCellInput[key] as TextStyle).textAlign = 'center'
207207
break
208208

209209
case 'right':
210210
(customHeaderInput[key] as TextStyle).textAlign = 'right';
211-
(customCellInput[key] as ViewStyle).justifyContent = 'flex-end';
211+
(customCellInput[key] as ViewStyle).alignItems = 'flex-end';
212212
(oddRowCellInput[key] as TextStyle).textAlign = 'right';
213213
(evenRowCellInput[key] as TextStyle).textAlign = 'right'
214214
break

react-native/components/createOfflineTableComponent/unit.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ test('renders as expected', () => {
282282
paddingLeft: 56,
283283
paddingRight: 28,
284284
paddingVertical: 3,
285-
justifyContent: 'flex-end'
285+
alignItems: 'flex-end'
286286
}}
287287
>
288288
<Text>Example Null</Text>
@@ -321,7 +321,7 @@ test('renders as expected', () => {
321321
paddingLeft: 28,
322322
paddingRight: 56,
323323
paddingVertical: 3,
324-
justifyContent: 'center'
324+
alignItems: 'center'
325325
}}
326326
>
327327
<Text>Example False</Text>
@@ -386,7 +386,7 @@ test('renders as expected', () => {
386386
paddingLeft: 28,
387387
paddingRight: 56,
388388
paddingVertical: 3,
389-
justifyContent: 'center'
389+
alignItems: 'center'
390390
}}
391391
>
392392
<Text>Example True</Text>
@@ -455,7 +455,7 @@ test('renders as expected', () => {
455455
paddingLeft: 28,
456456
paddingRight: 56,
457457
paddingVertical: 3,
458-
justifyContent: 'center'
458+
alignItems: 'center'
459459
}}
460460
>
461461
<Text>Example Null</Text>
@@ -524,7 +524,7 @@ test('renders as expected', () => {
524524
paddingLeft: 28,
525525
paddingRight: 56,
526526
paddingVertical: 3,
527-
justifyContent: 'center'
527+
alignItems: 'center'
528528
}}
529529
>
530530
<Text>Example True</Text>
@@ -689,7 +689,7 @@ test('renders as expected with only one string column', () => {
689689
flexGrow: 44,
690690
paddingHorizontal: 56,
691691
paddingVertical: 3,
692-
justifyContent: 'flex-end'
692+
alignItems: 'flex-end'
693693
}}
694694
>
695695
<Text>Example Null</Text>
@@ -2090,7 +2090,7 @@ test('renders as expected when filtering by a string column', () => {
20902090
flexGrow: 11,
20912091
paddingHorizontal: 28,
20922092
paddingVertical: 3,
2093-
justifyContent: 'flex-end'
2093+
alignItems: 'flex-end'
20942094
}}
20952095
>
20962096
<Text>Example Column C Value A</Text>
@@ -2420,7 +2420,7 @@ test('renders as expected when filtering by a numeric column', () => {
24202420
flexGrow: 11,
24212421
paddingHorizontal: 28,
24222422
paddingVertical: 3,
2423-
justifyContent: 'center'
2423+
alignItems: 'center'
24242424
}}
24252425
>
24262426
<Text>Example Column C Value D</Text>
@@ -16578,7 +16578,7 @@ test('renders as expected with a row press callback', () => {
1657816578
paddingLeft: 56,
1657916579
paddingRight: 28,
1658016580
paddingVertical: 3,
16581-
justifyContent: 'flex-end'
16581+
alignItems: 'flex-end'
1658216582
}}
1658316583
>
1658416584
<Text>Example Null</Text>
@@ -16617,7 +16617,7 @@ test('renders as expected with a row press callback', () => {
1661716617
paddingLeft: 28,
1661816618
paddingRight: 56,
1661916619
paddingVertical: 3,
16620-
justifyContent: 'center'
16620+
alignItems: 'center'
1662116621
}}
1662216622
>
1662316623
<Text>Example False</Text>
@@ -16684,7 +16684,7 @@ test('renders as expected with a row press callback', () => {
1668416684
paddingLeft: 28,
1668516685
paddingRight: 56,
1668616686
paddingVertical: 3,
16687-
justifyContent: 'center'
16687+
alignItems: 'center'
1668816688
}}
1668916689
>
1669016690
<Text>Example True</Text>
@@ -16755,7 +16755,7 @@ test('renders as expected with a row press callback', () => {
1675516755
paddingLeft: 28,
1675616756
paddingRight: 56,
1675716757
paddingVertical: 3,
16758-
justifyContent: 'center'
16758+
alignItems: 'center'
1675916759
}}
1676016760
>
1676116761
<Text>Example Null</Text>
@@ -16826,7 +16826,7 @@ test('renders as expected with a row press callback', () => {
1682616826
paddingLeft: 28,
1682716827
paddingRight: 56,
1682816828
paddingVertical: 3,
16829-
justifyContent: 'center'
16829+
alignItems: 'center'
1683016830
}}
1683116831
>
1683216832
<Text>Example True</Text>

0 commit comments

Comments
 (0)