From 7d4fe8d29edd5c77db7b0e1712ad8c53e6b6c15a Mon Sep 17 00:00:00 2001 From: pac-guerreiro <> Date: Tue, 21 Mar 2023 16:31:43 +0000 Subject: [PATCH 1/3] fix: data table title numberOfLines not working as expected --- src/components/DataTable/DataTableHeader.tsx | 1 - src/components/__tests__/__snapshots__/DataTable.test.tsx.snap | 1 - 2 files changed, 2 deletions(-) diff --git a/src/components/DataTable/DataTableHeader.tsx b/src/components/DataTable/DataTableHeader.tsx index e1e2419e36..f59651bca8 100644 --- a/src/components/DataTable/DataTableHeader.tsx +++ b/src/components/DataTable/DataTableHeader.tsx @@ -78,7 +78,6 @@ DataTableHeader.displayName = 'DataTable.Header'; const styles = StyleSheet.create({ header: { flexDirection: 'row', - height: 48, paddingHorizontal: 16, borderBottomWidth: StyleSheet.hairlineWidth * 2, }, diff --git a/src/components/__tests__/__snapshots__/DataTable.test.tsx.snap b/src/components/__tests__/__snapshots__/DataTable.test.tsx.snap index 1cec04437d..ea65a6bea9 100644 --- a/src/components/__tests__/__snapshots__/DataTable.test.tsx.snap +++ b/src/components/__tests__/__snapshots__/DataTable.test.tsx.snap @@ -67,7 +67,6 @@ exports[`renders data table header 1`] = ` Object { "borderBottomWidth": 1, "flexDirection": "row", - "height": 48, "paddingHorizontal": 16, }, Object { From 84f07405d1a024cec847e3e71514bffcf88002cf Mon Sep 17 00:00:00 2001 From: pac-guerreiro <> Date: Tue, 21 Mar 2023 16:33:02 +0000 Subject: [PATCH 2/3] chore: add two line title to data table in example app --- example/src/Examples/DataTableExample.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/example/src/Examples/DataTableExample.tsx b/example/src/Examples/DataTableExample.tsx index fe0fe8a0c4..7f7326680e 100644 --- a/example/src/Examples/DataTableExample.tsx +++ b/example/src/Examples/DataTableExample.tsx @@ -83,7 +83,9 @@ const DataTableExample = () => { > Dessert - Calories + + Calories per piece + Fat (g) From 58b573ca1eb5446c6b96279c2e4660c08317b7de Mon Sep 17 00:00:00 2001 From: pac-guerreiro <> Date: Tue, 21 Mar 2023 16:36:45 +0000 Subject: [PATCH 3/3] refactor: sorting logic for data table in example app --- example/src/Examples/DataTableExample.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/src/Examples/DataTableExample.tsx b/example/src/Examples/DataTableExample.tsx index 7f7326680e..69858746c2 100644 --- a/example/src/Examples/DataTableExample.tsx +++ b/example/src/Examples/DataTableExample.tsx @@ -60,9 +60,9 @@ const DataTableExample = () => { const sortedItems = items .slice() .sort((item1, item2) => - (sortAscending ? item1.name < item2.name : item2.name < item1.name) - ? 1 - : -1 + sortAscending + ? item1.name.localeCompare(item2.name) + : item2.name.localeCompare(item1.name) ); const from = page * itemsPerPage; const to = Math.min((page + 1) * itemsPerPage, items.length);