Skip to content

Commit

Permalink
feat: Schools FSU msg prop and new default value (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyEPhipps authored Aug 31, 2023
1 parent 11a0a5c commit 6c564ff
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,28 @@ const schoolToString = school => `${school.name}, ${school.post_code}`;
* @returns {JSX.Element}
* @constructor
*/
const SimpleSchoolLookup = ({ onSelect, ...rest }) => (
const SimpleSchoolLookup = ({ onSelect, noResultsMessage, ...rest }) => (
<Lookup
name="school_lookup"
label="Enter the name or postcode of your organisation"
placeholder="Enter name or postcode..."
buttonText="Find school"
dropdownInstruction="Please select an organisation from the list below"
noResultsMessage="Sorry, could not find anything matching your search"
noResultsMessage={noResultsMessage}
lookupHandler={schoolFetcher}
mapOptionToString={schoolToString}
onSelect={onSelect}
{...rest}
/>
);

SimpleSchoolLookup.defaultProps = {
noResultsMessage: 'Sorry, we could not find anything matching your search; please use the manual entry option.'
};

SimpleSchoolLookup.propTypes = {
onSelect: PropTypes.func.isRequired
onSelect: PropTypes.func.isRequired,
noResultsMessage: PropTypes.string
};

export default SimpleSchoolLookup;

0 comments on commit 6c564ff

Please sign in to comment.