Skip to content

Commit

Permalink
enhance(grapher): make entity selector title specific to the entity type
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Sep 26, 2023
1 parent ee51cc1 commit 979fc60
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export interface EntitySelectorModalManager {
canChangeEntity: boolean
isSelectingData?: boolean
tabBounds?: Bounds
entityType?: string
entityTypePlural?: string
}

interface SearchableEntity {
Expand Down Expand Up @@ -169,11 +171,16 @@ export class EntitySelectorModal extends React.Component<{
}

render(): JSX.Element {
const { selectionArray, searchResults, searchInput } = this
const { selectionArray, searchResults, searchInput, isMulti, manager } =
this

const title = isMulti
? `Add/remove ${manager.entityTypePlural || "countries or regions"}`
: `Choose ${manager.entityType || "country or region"}`

return (
<Modal
title="Choose data to show"
title={title}
onDismiss={this.onDismiss}
bounds={this.modalBounds}
isHeightFixed={true}
Expand Down

0 comments on commit 979fc60

Please sign in to comment.