Skip to content

Commit

Permalink
style: format row using acqRowFormatter
Browse files Browse the repository at this point in the history
  • Loading branch information
alisher-epam committed Nov 9, 2023
1 parent 632cc04 commit 2ec2735
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 0 additions & 3 deletions lib/Donors/Donors.css

This file was deleted.

8 changes: 7 additions & 1 deletion lib/Donors/DonorsList.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import PropTypes from 'prop-types';
import { useMemo } from 'react';
import { useCallback, useMemo } from 'react';

import { MultiColumnList } from '@folio/stripes/components';
import { useStripes } from '@folio/stripes/core';

import { acqRowFormatter } from '../utils';
import {
alignRowProps,
defaultColumnMapping,
Expand All @@ -25,12 +26,17 @@ export const DonorsList = ({
return formatterProp || getDonorsListFormatter({ canViewOrganizations });
}, [canViewOrganizations, formatterProp]);

const anchoredRowFormatter = useCallback((rowProps) => {
return acqRowFormatter(rowProps);
}, []);

return (
<MultiColumnList
id={id}
columnMapping={columnMapping}
contentData={contentData}
formatter={formatter}
rowFormatter={anchoredRowFormatter}
rowProps={alignRowProps}
visibleColumns={visibleColumns}
columnWidths={columnWidths}
Expand Down
3 changes: 0 additions & 3 deletions lib/Donors/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import {
TextLink,
} from '@folio/stripes/components';

import css from './Donors.css';

const getDonorUrl = (orgId) => {
if (orgId) {
return `/organizations/view/${orgId}`;
Expand All @@ -26,7 +24,6 @@ export const getDonorsFormatter = ({ canViewOrganizations, fields, intl }) => ({
aria-label={intl.formatMessage({ id: 'stripes-acq-components.donors.button.unassign' })}
buttonStyle="fieldControl"
type="button"
buttonClass={css.donorUnassignButton}
onClick={(e) => {
e.preventDefault();
fields.remove(donor._index);
Expand Down

0 comments on commit 2ec2735

Please sign in to comment.