From 0b38fc4f98a9f78ad7a0d387d48633b83ee03732 Mon Sep 17 00:00:00 2001 From: Harshil Sharma Date: Wed, 23 Jun 2021 13:43:41 +0530 Subject: [PATCH] Fixed sorting icons (#611) --- .../table/__snapshots__/table.test.tsx.snap | 24 +++++++++---------- webapp/src/components/table/table.tsx | 4 ++-- .../viewHeader/viewHeaderSortMenu.tsx | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/webapp/src/components/table/__snapshots__/table.test.tsx.snap b/webapp/src/components/table/__snapshots__/table.test.tsx.snap index 074e7c0aa..06ad21686 100644 --- a/webapp/src/components/table/__snapshots__/table.test.tsx.snap +++ b/webapp/src/components/table/__snapshots__/table.test.tsx.snap @@ -43,7 +43,7 @@ exports[`components/table/Table should match snapshot 1`] = ` > Property 1 @@ -51,7 +51,7 @@ exports[`components/table/Table should match snapshot 1`] = ` points="50,20 50,80" /> @@ -77,7 +77,7 @@ exports[`components/table/Table should match snapshot 1`] = ` > Property 2 @@ -85,7 +85,7 @@ exports[`components/table/Table should match snapshot 1`] = ` points="50,20 50,80" /> @@ -225,7 +225,7 @@ exports[`components/table/Table should match snapshot with GroupBy 1`] = ` > Property 1 @@ -233,7 +233,7 @@ exports[`components/table/Table should match snapshot with GroupBy 1`] = ` points="50,20 50,80" /> @@ -259,7 +259,7 @@ exports[`components/table/Table should match snapshot with GroupBy 1`] = ` > Property 2 @@ -267,7 +267,7 @@ exports[`components/table/Table should match snapshot with GroupBy 1`] = ` points="50,20 50,80" /> @@ -390,7 +390,7 @@ exports[`components/table/Table should match snapshot, read-only 1`] = ` > Property 1 @@ -398,7 +398,7 @@ exports[`components/table/Table should match snapshot, read-only 1`] = ` points="50,20 50,80" /> @@ -420,7 +420,7 @@ exports[`components/table/Table should match snapshot, read-only 1`] = ` > Property 2 @@ -428,7 +428,7 @@ exports[`components/table/Table should match snapshot, read-only 1`] = ` points="50,20 50,80" /> diff --git a/webapp/src/components/table/table.tsx b/webapp/src/components/table/table.tsx index e1c48bc0c..c4265cffd 100644 --- a/webapp/src/components/table/table.tsx +++ b/webapp/src/components/table/table.tsx @@ -215,7 +215,7 @@ const Table = (props: Props) => { const titleSortOption = activeView.sortOptions.find((o) => o.propertyId === Constants.titleColumnId) let titleSorted: 'up' | 'down' | 'none' = 'none' if (titleSortOption) { - titleSorted = titleSortOption.reversed ? 'up' : 'down' + titleSorted = titleSortOption.reversed ? 'down' : 'up' } return ( @@ -253,7 +253,7 @@ const Table = (props: Props) => { let sorted: 'up' | 'down' | 'none' = 'none' const sortOption = activeView.sortOptions.find((o) => o.propertyId === template.id) if (sortOption) { - sorted = sortOption.reversed ? 'up' : 'down' + sorted = sortOption.reversed ? 'down' : 'up' } return ( diff --git a/webapp/src/components/viewHeader/viewHeaderSortMenu.tsx b/webapp/src/components/viewHeader/viewHeaderSortMenu.tsx index f4cbfbbf9..8ab7bb01e 100644 --- a/webapp/src/components/viewHeader/viewHeaderSortMenu.tsx +++ b/webapp/src/components/viewHeader/viewHeaderSortMenu.tsx @@ -66,7 +66,7 @@ const ViewHeaderSortMenu = React.memo((props: Props) => { if (activeView.sortOptions.length > 0) { const sortOption = activeView.sortOptions[0] if (sortOption.propertyId === option.id) { - rightIcon = sortOption.reversed ? : + rightIcon = sortOption.reversed ? : } } return (