Skip to content

Commit

Permalink
fix: Remove Bank reference from ASCOR dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
martintomas committed Dec 6, 2023
1 parent 66290ed commit 8c3cc45
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions app/javascript/components/tpi/AscorDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import chevronIconBlack from 'images/icon_chevron_dark/chevron_down_black-1.svg'
const ESCAPE_KEY = 27;
const ENTER_KEY = 13;

const AscorSelector = ({ banks, selectedOption }) => {
const AscorSelector = ({ countries, selectedOption }) => {
const [searchValue, setSearchValue] = useState('');
const [isOpen, setIsOpen] = useState(false);
const inputEl = useRef(null);
Expand All @@ -32,18 +32,18 @@ const AscorSelector = ({ banks, selectedOption }) => {
return searchResults;
};

const searchResults = useMemo(() => (searchValue ? fuse(banks) : []), [searchValue]);
const searchResults = useMemo(() => (searchValue ? fuse(countries) : []), [searchValue]);

const options = useMemo(() => (searchValue
? searchResults : banks),
[searchValue, banks]);
? searchResults : countries),
[searchValue, countries]);

const input = () => (
<input
ref={inputEl}
className="dropdown-selector__input"
onChange={e => setSearchValue(e.target.value)}
placeholder="Type or select bank"
placeholder="Type or select country"
/>
);

Expand Down Expand Up @@ -172,7 +172,7 @@ const AscorSelector = ({ banks, selectedOption }) => {
};

AscorSelector.propTypes = {
banks: PropTypes.array.isRequired,
countries: PropTypes.array.isRequired,
selectedOption: PropTypes.string.isRequired
};

Expand Down
2 changes: 1 addition & 1 deletion app/views/tpi/ascor/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="right-icon"></div>
<div class="bottom-icon"></div>

<%= react_component("AscorDropdown", { banks: @countries_json, selectedOption: 'All countries' }) %>
<%= react_component("AscorDropdown", { countries: @countries_json, selectedOption: 'All countries' }) %>

<div class="ascor-header container">
<div class="links">
Expand Down
2 changes: 1 addition & 1 deletion app/views/tpi/ascor/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="right-icon"></div>
<div class="bottom-icon"></div>

<%= react_component("AscorDropdown", { banks: @countries_json, selectedOption: @country.name }) %>
<%= react_component("AscorDropdown", { countries: @countries_json, selectedOption: @country.name }) %>

<div class="ascor-header container show-version">
<div class="ascor-header__assessment-dropdown">
Expand Down

0 comments on commit 8c3cc45

Please sign in to comment.