From 8c3cc45e60c372ba672b5e643481a03f3a1356b6 Mon Sep 17 00:00:00 2001 From: martintomas Date: Wed, 6 Dec 2023 09:52:00 +0100 Subject: [PATCH] fix: Remove Bank reference from ASCOR dropdown --- app/javascript/components/tpi/AscorDropdown.js | 12 ++++++------ app/views/tpi/ascor/index.html.erb | 2 +- app/views/tpi/ascor/show.html.erb | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/javascript/components/tpi/AscorDropdown.js b/app/javascript/components/tpi/AscorDropdown.js index 98559bc04..344ab0521 100644 --- a/app/javascript/components/tpi/AscorDropdown.js +++ b/app/javascript/components/tpi/AscorDropdown.js @@ -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); @@ -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 = () => ( setSearchValue(e.target.value)} - placeholder="Type or select bank" + placeholder="Type or select country" /> ); @@ -172,7 +172,7 @@ const AscorSelector = ({ banks, selectedOption }) => { }; AscorSelector.propTypes = { - banks: PropTypes.array.isRequired, + countries: PropTypes.array.isRequired, selectedOption: PropTypes.string.isRequired }; diff --git a/app/views/tpi/ascor/index.html.erb b/app/views/tpi/ascor/index.html.erb index 781543ec4..8fe75487e 100644 --- a/app/views/tpi/ascor/index.html.erb +++ b/app/views/tpi/ascor/index.html.erb @@ -7,7 +7,7 @@
- <%= react_component("AscorDropdown", { banks: @countries_json, selectedOption: 'All countries' }) %> + <%= react_component("AscorDropdown", { countries: @countries_json, selectedOption: 'All countries' }) %>