Skip to content

Commit

Permalink
feat: input location suggestion view style & search options
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillermo Angeles committed Jan 16, 2024
1 parent 7ad6ae1 commit f5fc59b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/Input/InputLocation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ const InputLocation = (props: InputLocationPrimaryProps | InputLocationSecondary
value={searchText}
onChange={onLocationChange}
onSelect={handleSelect}
searchOptions={{
types: ['address']
searchOptions={props.searchOptions ? props.searchOptions : {
types: ['address'],
}}
>
{({ getInputProps, suggestions, getSuggestionItemProps }) => (
Expand Down Expand Up @@ -127,6 +127,7 @@ const InputLocation = (props: InputLocationPrimaryProps | InputLocationSecondary
{...getSuggestionItemProps(suggestion)}
role={"cell"+index}
selected={pointerPosition === index}
style={props.suggestionViewStyle}
>
<Text type='p2' style={{textOverflow: 'ellipsis'}}>{suggestion.description}</Text>
</SuggestionView>
Expand All @@ -142,6 +143,10 @@ const InputLocation = (props: InputLocationPrimaryProps | InputLocationSecondary
export default InputLocation;
export interface InputLocationPrimaryProps extends InputPrimaryProps {
design?: 'primary',
searchOptions?: {
types: string []
},
suggestionViewStyle: React.CSSProperties,
onLocationChange?: (result: {
address: string,
geocoder: google.maps.GeocoderResult,
Expand All @@ -150,6 +155,10 @@ export interface InputLocationPrimaryProps extends InputPrimaryProps {
}
export interface InputLocationSecondaryProps extends InputSecondaryProps {
design?: 'secondary',
searchOptions?: {
types: string []
},
suggestionViewStyle: React.CSSProperties,
onLocationChange?: (result: {
address: string,
geocoder: google.maps.GeocoderResult,
Expand Down

0 comments on commit f5fc59b

Please sign in to comment.