Skip to content

Commit

Permalink
UIU-3096 - cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Terala-Priyanka committed Apr 3, 2024
1 parent dad6a59 commit 7fbb3f2
Showing 1 changed file with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage, useIntl } from 'react-intl';
// import { Link } from 'react-router-dom';
import { get, orderBy } from 'lodash';
// import { get } from 'lodash';

import {
Accordion,
Expand All @@ -13,7 +13,7 @@ import {
SearchField,
} from '@folio/stripes/components';
// import { ViewMetaData } from '@folio/stripes/smart-components';
import { READING_ROOM_ACCESS, SORT_DIRECTIONS } from '../../../constants';
import { READING_ROOM_ACCESS } from '../../../constants';
// import css from './ReadingRoom.css';

const mockedRRAData = [
Expand Down Expand Up @@ -50,8 +50,6 @@ const mockedRRAData = [
const ReadingRoomAccess = (props) => {
const intl = useIntl();
const [filteredRRA, setFilteredRRA] = useState(mockedRRAData);
const [sortedColumn, setSortedColumn] = useState('access');
const [sortOrder, setSortOrder] = useState(SORT_DIRECTIONS.asc.name);

const {
accordionId,
Expand Down Expand Up @@ -118,17 +116,6 @@ const ReadingRoomAccess = (props) => {
// )
id: rra => <FormattedUTCDate value={rra.updatedDate} />
};
const onHeaderClick = (e, { name: columnName }) => {
if (sortedColumn !== columnName) {
setSortedColumn(columnName);
setSortOrder(SORT_DIRECTIONS.desc.name);
} else {
const newSortOrder = (sortOrder === SORT_DIRECTIONS.desc.name)
? SORT_DIRECTIONS.asc.name
: SORT_DIRECTIONS.desc.name;
setSortOrder(newSortOrder);
}
};

return (
<Accordion
Expand All @@ -154,9 +141,6 @@ const ReadingRoomAccess = (props) => {
columnMapping={columnMapping}
visibleColumns={visibleColumns}
formatter={formatter}
sortedColumn={sortedColumn}
onHeaderClick={onHeaderClick}
sortDirection={SORT_DIRECTIONS[sortOrder].fullName}
/>
</Accordion>
);
Expand Down

0 comments on commit 7fbb3f2

Please sign in to comment.