-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1a569b
commit 361af67
Showing
6 changed files
with
173 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.actions { | ||
display: flex; | ||
|
||
& .unassignAll { | ||
margin-left: var(--gutter); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 29 additions & 7 deletions
36
src/Funds/FundForm/FundLocations/FundLocationsList/FundLocationsList.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/Funds/FundForm/FundLocations/FundLocationsList/FundLocationsListItem.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.itemValue, | ||
.removeBtn { | ||
margin: 0 9px; | ||
} | ||
|
||
.removeIconRoot { | ||
padding: 0 4px; | ||
|
||
& .removeIcon { | ||
fill: #999; | ||
transition: fill .2s ease; | ||
} | ||
|
||
&:hover { | ||
& .removeIcon{ | ||
fill: #555; | ||
} | ||
} | ||
} | ||
|
51 changes: 51 additions & 0 deletions
51
src/Funds/FundForm/FundLocations/FundLocationsList/FundLocationsListItem.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import PropTypes from 'prop-types'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { | ||
Button, | ||
Icon, | ||
} from '@folio/stripes/components'; | ||
|
||
import css from './FundLocationsListItem.css'; | ||
|
||
const formatLocationValue = ({ name, code }) => [name, code && `(${code})`].join(' '); | ||
|
||
export const FundLocationsListItem = ({ | ||
location, | ||
index, | ||
onRemove, | ||
}) => { | ||
return ( | ||
<li className={css.listItem}> | ||
<span className={css.itemValue}>{formatLocationValue(location)}</span> | ||
<FormattedMessage id="ui-finance.fund.information.locations.action.remove"> | ||
{aria => ( | ||
<Button | ||
buttonStyle="fieldControl" | ||
buttonClass={css.removeBtn} | ||
align="end" | ||
type="button" | ||
id={`clickable-remove-location-${index}`} | ||
onClick={() => onRemove(location)} | ||
aria-label={`${aria}: ${location.name}`} | ||
> | ||
<Icon | ||
icon="times-circle" | ||
iconClassName={css.removeIcon} | ||
iconRootClass={css.removeIconRoot} | ||
/> | ||
</Button> | ||
)} | ||
</FormattedMessage> | ||
</li> | ||
); | ||
}; | ||
|
||
FundLocationsListItem.propTypes = { | ||
location: PropTypes.object, | ||
index: PropTypes.number, | ||
fields: PropTypes.object, | ||
showPerms: PropTypes.bool, | ||
permToDelete: PropTypes.string, | ||
changePermissions: PropTypes.func.isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters