From 979fc605f743012c543c594343c7d6f4ee2dac86 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Tue, 26 Sep 2023 16:20:01 +0000 Subject: [PATCH] enhance(grapher): make entity selector title specific to the entity type --- .../grapher/src/modal/EntitySelectorModal.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/modal/EntitySelectorModal.tsx b/packages/@ourworldindata/grapher/src/modal/EntitySelectorModal.tsx index 4f8c5954a32..10ed6eb2a15 100644 --- a/packages/@ourworldindata/grapher/src/modal/EntitySelectorModal.tsx +++ b/packages/@ourworldindata/grapher/src/modal/EntitySelectorModal.tsx @@ -20,6 +20,8 @@ export interface EntitySelectorModalManager { canChangeEntity: boolean isSelectingData?: boolean tabBounds?: Bounds + entityType?: string + entityTypePlural?: string } interface SearchableEntity { @@ -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 (