When no order is specified, the order by indicator(triangle) in column header should be Cleared

This commit is contained in:
Haocen Xu
2019-09-14 12:23:26 -04:00
parent 2fe923678e
commit ab99213d8c
3 changed files with 126 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ import { shortUrlType } from './reducers/shortUrlsList';
import { shortUrlsListParamsType } from './reducers/shortUrlsListParams';
import './ShortUrlsList.scss';
const SORTABLE_FIELDS = {
export const SORTABLE_FIELDS = {
dateCreated: 'Created at',
shortCode: 'Short URL',
longUrl: 'Long URL',
@@ -50,6 +50,10 @@ const ShortUrlsList = (ShortUrlsRow) => class ShortUrlsList extends React.Compon
return null;
}
if (!this.state.orderDir) {
return null;
}
return (
<FontAwesomeIcon
icon={this.state.orderDir === 'ASC' ? caretUpIcon : caretDownIcon}