diff --git a/src/atomicui/atoms/PoliticalViewDropdown/PoliticalViewDropdown.tsx b/src/atomicui/atoms/PoliticalViewDropdown/PoliticalViewDropdown.tsx index 9167ebb0..a5ed55d1 100644 --- a/src/atomicui/atoms/PoliticalViewDropdown/PoliticalViewDropdown.tsx +++ b/src/atomicui/atoms/PoliticalViewDropdown/PoliticalViewDropdown.tsx @@ -2,36 +2,36 @@ import { FC, useCallback, useEffect, useRef, useState } from "react"; import { Flex, Text } from "@aws-amplify/ui-react"; import { IconArrow } from "@demo/assets/svgs"; -import { SelectOption } from "@demo/types"; +import { appConfig } from "@demo/core/constants"; +import { useMap } from "@demo/hooks"; +import { getFlagEmoji } from "@demo/utils"; import { useTranslation } from "react-i18next"; import "./styles.scss"; +import { Tooltip } from "react-tooltip"; + +const { + MAP_RESOURCES: { MAP_POLITICAL_VIEWS } +} = appConfig; interface PoliticalViewDropdownProps { - defaultOption?: SelectOption | SelectOption[]; - options: SelectOption[]; - onSelect: (option: SelectOption) => void; - showSelected?: boolean; bordered?: boolean; arrowIconColor?: string; - label?: string; width?: string; disabled?: boolean; } const PoliticalViewDropdown: FC = ({ - defaultOption, - options, - onSelect, - showSelected = false, bordered = false, arrowIconColor, - label, width = "100%", disabled = false }) => { const [open, setOpen] = useState(false); const dropdownRef = useRef(null); - const { t } = useTranslation(); + const { i18n, t } = useTranslation(); + const langDir = i18n.dir(); + const isLtr = langDir === "ltr"; + const { mapPoliticalView, setMapPoliticalView } = useMap(); const handleClickOutside = (event: MouseEvent) => { if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) { @@ -48,25 +48,28 @@ const PoliticalViewDropdown: FC = ({ }, []); const handleClick = useCallback( - (option: { value: string; label: string }) => { - onSelect(option); + (option: { alpha2: string; alpha3: string; desc: string }) => { + setMapPoliticalView(option); setOpen(false); }, - [onSelect] + [setMapPoliticalView] ); return (
!disabled && setOpen(!open)} + data-tooltip-id="dropdown-trigger-political-view" + data-tooltip-place="top" + data-tooltip-content={t("political_view_satellite_disclaimer.text")} > -

- {label?.split("-")[0] || - t((defaultOption as SelectOption)?.label.split("-")[0] as string) || - t("dropdown__placeholder.text")} +

+ {!!mapPoliticalView.alpha3 + ? `${mapPoliticalView.alpha3}: ${t(mapPoliticalView.desc)}` + : t(mapPoliticalView.desc)}

= ({ }} />
+ {disabled && } {open && (
    - {options.map(option => ( -
  • handleClick(option)} - > - - - {t(option.label).split("-")[0]} - - - {t(option.label).split("-")[1]} - - -
  • - ))} + {MAP_POLITICAL_VIEWS.map(({ alpha2, alpha3, desc }) => { + return ( +
  • handleClick({ alpha2, alpha3, desc })} + > + + {!!alpha2 && !!alpha3 ? ( + <> + + + {getFlagEmoji(alpha2)} + + + {alpha3} + + + + {t(desc)} + + + ) : ( + + {t(desc)} + + )} + +
  • + ); + })}
)}
diff --git a/src/atomicui/atoms/PoliticalViewDropdown/styles.scss b/src/atomicui/atoms/PoliticalViewDropdown/styles.scss index 33a7e627..9bd5ed4d 100644 --- a/src/atomicui/atoms/PoliticalViewDropdown/styles.scss +++ b/src/atomicui/atoms/PoliticalViewDropdown/styles.scss @@ -33,6 +33,7 @@ font-family: "AmazonEmber-Regular"; font-weight: 400; font-size: 1.08rem; + width: 90%; } } @@ -112,9 +113,5 @@ } } } - - .selected { - background-color: rgba(0, 130, 150, 0.08); - } } } diff --git a/src/atomicui/molecules/MapButtons/MapButtons.test.tsx b/src/atomicui/molecules/MapButtons/MapButtons.test.tsx index f7eb1197..84681499 100644 --- a/src/atomicui/molecules/MapButtons/MapButtons.test.tsx +++ b/src/atomicui/molecules/MapButtons/MapButtons.test.tsx @@ -46,7 +46,12 @@ const mockUseAuthData = { const mockUseMapData = { mapStyle: MapStyleEnum.STANDARD, - setMapStyle: jest.fn() + setMapStyle: jest.fn(), + mapPoliticalView: { + alpha2: "", + alpha3: "", + desc: faker.random.word() + } }; const mockUseGeofenceData = { diff --git a/src/atomicui/molecules/MapButtons/MapButtons.tsx b/src/atomicui/molecules/MapButtons/MapButtons.tsx index fd4a8136..a52694fe 100644 --- a/src/atomicui/molecules/MapButtons/MapButtons.tsx +++ b/src/atomicui/molecules/MapButtons/MapButtons.tsx @@ -5,7 +5,7 @@ import { FC, memo, useCallback, useEffect, useMemo, useRef, useState } from "rea import { Card, Divider, Flex, Placeholder, Text } from "@aws-amplify/ui-react"; import { IconClose, IconDark, IconGeofencePlusSolid, IconLight, IconMapSolid, IconRadar } from "@demo/assets/svgs"; -import { PoliticalViewDropdown, ToggleSwitch } from "@demo/atomicui/atoms"; +import { PoliticalViewDropdown } from "@demo/atomicui/atoms"; import { appConfig } from "@demo/core/constants"; import { useAuth, useGeofence, useMap, useUnauthSimulation } from "@demo/hooks"; import useBottomSheet from "@demo/hooks/useBottomSheet"; @@ -25,12 +25,8 @@ import "./styles.scss"; const { map_styles } = ResponsiveUIEnum; const { - MAP_RESOURCES: { MAP_STYLES, MAP_COLOR_SCHEMES, MAP_POLITICAL_VIEWS } + MAP_RESOURCES: { MAP_STYLES, MAP_COLOR_SCHEMES } } = appConfig; -const mapPoliticalViewOptions = Object.entries(MAP_POLITICAL_VIEWS).map(([key, value]) => ({ - value: key, - label: `${key}-${value}` -})); export interface MapButtonsProps { renderedUpon: string; @@ -66,7 +62,6 @@ const MapButtons: FC = ({ isAuthGeofenceBoxOpen, onSetShowAuthGeofenceBox, isAuthTrackerBoxOpen, - isSettingsModal = false, onSetShowAuthTrackerBox, isUnauthGeofenceBoxOpen, isUnauthTrackerBoxOpen, @@ -77,13 +72,12 @@ const MapButtons: FC = ({ const stylesCardRef = useRef(null); const stylesCardTogglerRef = useRef(null); const { credentials, userProvidedValues } = useAuth(); - const { mapStyle, setMapStyle, mapColorScheme, setMapColorScheme, mapPoliticalView, setMapPoliticalView } = useMap(); + const { mapStyle, setMapStyle, mapColorScheme, setMapColorScheme, setMapPoliticalView } = useMap(); const { isAddingGeofence, setIsAddingGeofence } = useGeofence(); const isAuthenticated = !!credentials?.authenticated; - const { isTablet, isMobile, isDesktop } = useDeviceMediaQuery(); + const { isMobile, isDesktop } = useDeviceMediaQuery(); const { t } = useTranslation(); const { ui } = useBottomSheet(); - const settingsTablet = isTablet && isSettingsModal; const { hideGeofenceTrackerShortcut } = useUnauthSimulation(); const isColorSchemeDisabled = useMemo( @@ -159,7 +153,8 @@ const MapButtons: FC = ({ (id: string, style: MapStyleEnum) => { if (mapStyle !== style) { onShowGridLoader(); - style === MapStyleEnum.SATELLITE && !!mapPoliticalView && setMapPoliticalView(); + style === MapStyleEnum.SATELLITE && + setMapPoliticalView({ alpha2: "", alpha3: "", desc: "no_political_view.text" }); setMapStyle(style); record([ { @@ -169,7 +164,7 @@ const MapButtons: FC = ({ ]); } }, - [mapPoliticalView, mapStyle, onShowGridLoader, renderedUpon, setMapPoliticalView, setMapStyle] + [mapStyle, onShowGridLoader, renderedUpon, setMapPoliticalView, setMapStyle] ); const handleMapColorSchemeChange = useCallback( @@ -193,14 +188,17 @@ const MapButtons: FC = ({ - + {MAP_STYLES.map(({ id, name, image }) => ( = ({ - (isToggle ? setMapPoliticalView("ARG") : setMapPoliticalView())} - label="Political view" - disabled={mapStyle === MapStyleEnum.SATELLITE} - /> - setMapPoliticalView(option.value)} - bordered - showSelected - disabled={!mapPoliticalView || mapStyle === MapStyleEnum.SATELLITE} - /> + @@ -322,11 +307,8 @@ const MapButtons: FC = ({ isLoadingImg, isMobile, mapColorScheme, - mapPoliticalView, mapStyle, onlyMapStyles, - setMapPoliticalView, - settingsTablet, t ] ); diff --git a/src/atomicui/molecules/MapButtons/styles.scss b/src/atomicui/molecules/MapButtons/styles.scss index ee985d85..0f1eac53 100644 --- a/src/atomicui/molecules/MapButtons/styles.scss +++ b/src/atomicui/molecules/MapButtons/styles.scss @@ -89,7 +89,7 @@ } .amplify-card.map-styles-card { - width: 27.85rem; + width: 34.15rem; position: absolute; top: 1.54rem; right: 5.38rem; @@ -128,7 +128,6 @@ gap: 0; .maps-container { - height: 35rem; -webkit-overflow-scrolling: touch; } @@ -157,10 +156,10 @@ .map-image { border-radius: 0.62rem; - min-width: 7.6rem; - max-height: 6.31rem; - width: 100%; - height: 100%; + min-width: 6.54rem; + max-width: 6.54rem; + min-height: 6.15rem; + max-height: 6.15rem; &.only-map { min-width: auto; diff --git a/src/atomicui/organisms/SearchBox/SearchBox.tsx b/src/atomicui/organisms/SearchBox/SearchBox.tsx index d4b09af0..95b1ed19 100644 --- a/src/atomicui/organisms/SearchBox/SearchBox.tsx +++ b/src/atomicui/organisms/SearchBox/SearchBox.tsx @@ -461,16 +461,16 @@ const SearchBox: FC = ({ (e: FormEvent) => { e.preventDefault(); handleSearch(value, true, AnalyticsEventActionsEnum.ENTER_BUTTON); - console.log({ options }); + if (!!options?.length) { - // setTimeout(() => { - // setBottomSheetMinHeight(window.innerHeight * 0.4 - 10); - // setBottomSheetHeight(window.innerHeight * 0.4); - // }, 200); - // searchInputRef?.current?.blur(); + setTimeout(() => { + setBottomSheetMinHeight(window.innerHeight * 0.4 - 10); + setBottomSheetHeight(window.innerHeight * 0.4); + }, 200); + searchInputRef?.current?.blur(); } }, - [handleSearch, options, value] + [handleSearch, options, setBottomSheetHeight, setBottomSheetMinHeight, value] ); return ( diff --git a/src/atomicui/organisms/SettingsModal/SettingsModal.tsx b/src/atomicui/organisms/SettingsModal/SettingsModal.tsx index 7175e3bb..a515e54a 100644 --- a/src/atomicui/organisms/SettingsModal/SettingsModal.tsx +++ b/src/atomicui/organisms/SettingsModal/SettingsModal.tsx @@ -707,7 +707,8 @@ const SettingsModal: FC = ({ open, onClose, resetAppState, m const modalCloseHandler = useCallback(() => { !isMobile && setSettingsOptions(SettingOptionEnum.UNITS); onClose(); - }, [isMobile, setSettingsOptions, onClose]); + !isDesktop && window.location.reload(); + }, [isMobile, setSettingsOptions, onClose, isDesktop]); return ( { } mapStyle={`https://maps.geo.${apiKeyRegion}.amazonaws.com/v2/styles/${mapStyle}/descriptor?key=${apiKey}${ !isColorSchemeDisabled ? `&color-scheme=${mapColorScheme}` : "" - }${!!mapPoliticalView ? `&political-view=${mapPoliticalView}` : ""}`} + }${!!mapPoliticalView?.alpha3 ? `&political-view=${mapPoliticalView.alpha3}` : ""}`} minZoom={2} maxBounds={ (show.unauthGeofenceBox || show.unauthTrackerBox) && show.unauthSimulationBounds diff --git a/src/core/constants/appConfig.ts b/src/core/constants/appConfig.ts index 9761e361..396c9dbd 100644 --- a/src/core/constants/appConfig.ts +++ b/src/core/constants/appConfig.ts @@ -120,22 +120,22 @@ const appConfig = { { id: MapColorSchemeEnum.LIGHT.toLowerCase(), name: MapColorSchemeEnum.LIGHT }, { id: MapColorSchemeEnum.DARK.toLowerCase(), name: MapColorSchemeEnum.DARK } ], - MAP_POLITICAL_VIEWS: { - ARG: "Argentina's view on the Southern Patagonian Ice Field and Tierra Del Fuego, including the Falkland Islands, South Georgia, and South Sandwich Islands", - EGY: "Egypt's view on Bir Tawil", - IND: "India's view on Gilgit-Baltistan", - KEN: "Kenya's view on the Ilemi Triangle", - MAR: "Morocco's view on Western Sahara", - RUS: "Russia's view on Crimea", - SDN: "Sudan's view on the Halaib Triangle", - SRB: "Serbia's view on Kosovo, Vukovar, and Sarengrad Islands", - SUR: "Suriname's view on the Courantyne Headwaters and Lawa Headwaters", - SYR: "Syria's view on the Golan Heights", - TUR: "Turkey's view on Cyprus and Northern Cyprus", - TZA: "Tanzania's view on Lake Malawi", - URY: "Uruguay's view on Rincon de Artigas", - VNM: "Vietnam's view on the Paracel Islands and Spratly Islands" - }, + MAP_POLITICAL_VIEWS: [ + { alpha2: "", alpha3: "", desc: "no_political_view.text" }, + { alpha2: "AR", alpha3: "ARG", desc: "argentina_political_view_desc.text" }, + { alpha2: "EG", alpha3: "EGY", desc: "egypt_political_view_desc.text" }, + { alpha2: "IN", alpha3: "IND", desc: "india_political_view_desc.text" }, + { alpha2: "KE", alpha3: "KEN", desc: "kenya_political_view_desc.text" }, + { alpha2: "MA", alpha3: "MAR", desc: "morocco_political_view_desc.text" }, + { alpha2: "RU", alpha3: "RUS", desc: "russia_political_view_desc.text" }, + { alpha2: "SD", alpha3: "SDN", desc: "sudan_political_view_desc.text" }, + { alpha2: "RS", alpha3: "SRB", desc: "serbia_political_view_desc.text" }, + { alpha2: "SR", alpha3: "SUR", desc: "suriname_political_view_desc.text" }, + { alpha2: "SY", alpha3: "SYR", desc: "syria_political_view_desc.text" }, + { alpha2: "TR", alpha3: "TUR", desc: "turkey_political_view_desc.text" }, + { alpha2: "TZ", alpha3: "TZA", desc: "tanzania_political_view_desc.text" }, + { alpha2: "UY", alpha3: "URY", desc: "uruguay_political_view_desc.text" } + ], GEOFENCE_COLLECTION: "location.aws.com.demo.geofences.GeofenceCollection", DEVICE_ID_WEB: "web_browser_device", TRACKER: "location.aws.com.demo.trackers.Tracker", @@ -298,7 +298,7 @@ const appConfig = { AWS_LOCATION_TRAVEL_AND_HOSPITALITY_URL: "https://aws.amazon.com/location/industry/travel-and-hospitality/", AWS_LOCATION_REAL_ESTATE_URL: "https://aws.amazon.com/location/real-estate/", AWS_LOCATION_RESOURCES_URL: "https://aws.amazon.com/location/resources/", - AWS_LOCATION_CUSTOMERS_URL: "https://aws.amazon.com/location/resources/customers/", + AWS_LOCATION_CUSTOMERS_URL: "https://aws.amazon.com/location/customers/", AWS_LOCATION_PRODUCT_RESOURCES_URL: "https://aws.amazon.com/location/resources/product-resources/", AWS_LOCATION_DEVELOPER_RESOURCES_URL: "https://aws.amazon.com/location/resources/developer-resources/", AMAZON_LOCATION_AUTH_SDK_IOS_URL: "https://github.com/aws-geospatial/amazon-location-mobile-auth-sdk-ios", diff --git a/src/hooks/useMap.ts b/src/hooks/useMap.ts index a40fd056..45811c2b 100644 --- a/src/hooks/useMap.ts +++ b/src/hooks/useMap.ts @@ -49,13 +49,12 @@ const useMap = () => { setMapColorScheme: (mapColorScheme: MapColorSchemeEnum) => { setState({ mapColorScheme }); }, - setMapPoliticalView: (mapPoliticalView?: string) => { + setMapPoliticalView: (mapPoliticalView: { alpha2: string; alpha3: string; desc: string }) => { setState({ mapPoliticalView }); }, resetStore() { setState({ - currentLocationData: undefined, - mapPoliticalView: undefined + currentLocationData: undefined }); setInitial(); } diff --git a/src/locales/ar/ar.json b/src/locales/ar/ar.json index c484bb6f..5613df77 100644 --- a/src/locales/ar/ar.json +++ b/src/locales/ar/ar.json @@ -3814,5 +3814,53 @@ }, "description_demo": { "text": "تطبيق تجريبي يعرض إمكانيات خدمة Amazon Location" + }, + "no_political_view": { + "text": "لا توجد وجهة نظر سياسية" + }, + "argentina_political_view_desc": { + "text": "وجهة نظر الأرجنتين حول حقل الجليد في جنوب باتاغونيا وتيرا ديل فويغو، بما في ذلك جزر فوكلاند وجورجيا الجنوبية وجزر ساندويتش الجنوبية" + }, + "egypt_political_view_desc": { + "text": "نظرة مصر على بير الطويل" + }, + "india_political_view_desc": { + "text": "وجهة نظر الهند حول جيلجيت بالتستان" + }, + "kenya_political_view_desc": { + "text": "نظرة كينيا على مثلث إيليمي" + }, + "morocco_political_view_desc": { + "text": "نظرة المغرب إلى الصحراء الغربية" + }, + "russia_political_view_desc": { + "text": "وجهة نظر روسيا في شبه جزيرة القرم" + }, + "sudan_political_view_desc": { + "text": "رؤية السودان لمثلث حلايب" + }, + "serbia_political_view_desc": { + "text": "وجهة نظر صربيا حول جزر كوسوفو وفوكوفار وسارينجراد" + }, + "suriname_political_view_desc": { + "text": "وجهة نظر سورينام بشأن منابع كورانتين ومنابع لاوا" + }, + "syria_political_view_desc": { + "text": "نظرة سوريا على مرتفعات الجولان" + }, + "turkey_political_view_desc": { + "text": "وجهة نظر تركيا حول قبرص وشمال قبرص" + }, + "tanzania_political_view_desc": { + "text": "منظر تنزانيا لبحيرة ملاوي" + }, + "uruguay_political_view_desc": { + "text": "وجهة نظر أوروغواي بشأن رينكون دي أرتيجاس" + }, + "vietnam_political_view_desc": { + "text": "نظرة فيتنام على جزر باراسيل وجزر سبراتلي" + }, + "political_view_satellite_disclaimer": { + "text": "غير متوفر في عرض القمر الصناعي" } } \ No newline at end of file diff --git a/src/locales/de/de.json b/src/locales/de/de.json index 8b2340d2..c928e501 100644 --- a/src/locales/de/de.json +++ b/src/locales/de/de.json @@ -3814,5 +3814,53 @@ }, "description_demo": { "text": "Demo-App, die die Funktionen von Amazon Location Service präsentiert" + }, + "no_political_view": { + "text": "Keine politische Sichtweise" + }, + "argentina_political_view_desc": { + "text": "Argentiniens Blick auf das südpatagonische Eisfeld und Feuerland, einschließlich der Falklandinseln, Südgeorgien und der Südlichen Sandwichinseln" + }, + "egypt_political_view_desc": { + "text": "Ägyptens Blick auf Bir Tawil" + }, + "india_political_view_desc": { + "text": "Indiens Sicht auf Gilgit-Baltistan" + }, + "kenya_political_view_desc": { + "text": "Kenias Blick auf das Ilemi-Dreieck" + }, + "morocco_political_view_desc": { + "text": "Marokkos Sicht auf die Westsahara" + }, + "russia_political_view_desc": { + "text": "Russlands Sicht auf die Krim" + }, + "sudan_political_view_desc": { + "text": "Der Blick des Sudan auf das Halaib-Dreieck" + }, + "serbia_political_view_desc": { + "text": "Serbiens Sicht auf die Inseln Kosovo, Vukovar und Sarengrad" + }, + "suriname_political_view_desc": { + "text": "Surinames Blick auf die Courantyne Headwaters und Lawa Headwaters" + }, + "syria_political_view_desc": { + "text": "Syriens Blick auf die Golanhöhen" + }, + "turkey_political_view_desc": { + "text": "Die Sicht der Türkei auf Zypern und Nordzypern" + }, + "tanzania_political_view_desc": { + "text": "Tansanias Blick auf den Malawisee" + }, + "uruguay_political_view_desc": { + "text": "Uruguays Blick auf Rincon de Artigas" + }, + "vietnam_political_view_desc": { + "text": "Vietnams Blick auf die Paracel- und Spratly-Inseln" + }, + "political_view_satellite_disclaimer": { + "text": "In der Satellitenansicht nicht verfügbar" } } \ No newline at end of file diff --git a/src/locales/en/en.json b/src/locales/en/en.json index d08a73d4..9dde3276 100644 --- a/src/locales/en/en.json +++ b/src/locales/en/en.json @@ -3814,5 +3814,53 @@ }, "description_demo": { "text": "Demo app showcasing the capabilities of Amazon Location Service" + }, + "no_political_view": { + "text": "No political view" + }, + "argentina_political_view_desc": { + "text": "Argentina's view on the Southern Patagonian Ice Field and Tierra Del Fuego, including the Falkland Islands, South Georgia, and South Sandwich Islands" + }, + "egypt_political_view_desc": { + "text": "Egypt's view on Bir Tawil" + }, + "india_political_view_desc": { + "text": "India's view on Gilgit-Baltistan" + }, + "kenya_political_view_desc": { + "text": "Kenya's view on the Ilemi Triangle" + }, + "morocco_political_view_desc": { + "text": "Morocco's view on Western Sahara" + }, + "russia_political_view_desc": { + "text": "Russia's view on Crimea" + }, + "sudan_political_view_desc": { + "text": "Sudan's view on the Halaib Triangle" + }, + "serbia_political_view_desc": { + "text": "Serbia's view on Kosovo, Vukovar, and Sarengrad Islands" + }, + "suriname_political_view_desc": { + "text": "Suriname's view on the Courantyne Headwaters and Lawa Headwaters" + }, + "syria_political_view_desc": { + "text": "Syria's view on the Golan Heights" + }, + "turkey_political_view_desc": { + "text": "Turkey's view on Cyprus and Northern Cyprus" + }, + "tanzania_political_view_desc": { + "text": "Tanzania's view on Lake Malawi" + }, + "uruguay_political_view_desc": { + "text": "Uruguay's view on Rincon de Artigas" + }, + "vietnam_political_view_desc": { + "text": "Vietnam's view on the Paracel Islands and Spratly Islands" + }, + "political_view_satellite_disclaimer": { + "text": "Not available in Satellite view" } } \ No newline at end of file diff --git a/src/locales/es/es.json b/src/locales/es/es.json index ba1024bd..676aee5e 100644 --- a/src/locales/es/es.json +++ b/src/locales/es/es.json @@ -3814,5 +3814,53 @@ }, "description_demo": { "text": "Aplicación de demostración que muestra las capacidades de Amazon Location Service" + }, + "no_political_view": { + "text": "Sin visión política" + }, + "argentina_political_view_desc": { + "text": "La opinión de Argentina sobre el campo de hielo patagónico sur y Tierra del Fuego, incluidas las Islas Malvinas, Georgias del Sur y Sandwich del Sur" + }, + "egypt_political_view_desc": { + "text": "La opinión de Egipto sobre Bir Tawil" + }, + "india_political_view_desc": { + "text": "La opinión de la India sobre Gilgit-Baltistán" + }, + "kenya_political_view_desc": { + "text": "La visión de Kenia sobre el triángulo de Ilemi" + }, + "morocco_political_view_desc": { + "text": "La opinión de Marruecos sobre el Sáhara Occidental" + }, + "russia_political_view_desc": { + "text": "La opinión de Rusia sobre Crimea" + }, + "sudan_political_view_desc": { + "text": "La opinión de Sudán sobre el triángulo de Halaib" + }, + "serbia_political_view_desc": { + "text": "La opinión de Serbia sobre las islas de Kosovo, Vukovar y Sarengrad" + }, + "suriname_political_view_desc": { + "text": "La opinión de Suriname sobre las cabeceras de Courantyne y Lawa" + }, + "syria_political_view_desc": { + "text": "La visión de Siria sobre los Altos del Golán" + }, + "turkey_political_view_desc": { + "text": "La opinión de Turquía sobre Chipre y el norte de Chipre" + }, + "tanzania_political_view_desc": { + "text": "Vista de Tanzania sobre el lago Malawi" + }, + "uruguay_political_view_desc": { + "text": "La opinión de Uruguay sobre Rincón de Artigas" + }, + "vietnam_political_view_desc": { + "text": "La opinión de Vietnam sobre las islas Paracel y Spratly" + }, + "political_view_satellite_disclaimer": { + "text": "No disponible en vista de satélite" } } \ No newline at end of file diff --git a/src/locales/fr/fr.json b/src/locales/fr/fr.json index 240c81f6..cdec7bbf 100644 --- a/src/locales/fr/fr.json +++ b/src/locales/fr/fr.json @@ -3814,5 +3814,53 @@ }, "description_demo": { "text": "Application de démonstration présentant les fonctionnalités d'Amazon Location Service" + }, + "no_political_view": { + "text": "Aucune opinion politique" + }, + "argentina_political_view_desc": { + "text": "Vue de l'Argentine sur le champ de glace du sud de la Patagonie et la Terre de Feu, y compris les îles Malouines, la Géorgie du Sud et les îles Sandwich du Sud" + }, + "egypt_political_view_desc": { + "text": "Le point de vue de l'Égypte sur Bir Tawil" + }, + "india_political_view_desc": { + "text": "Le point de vue de l'Inde sur le Gilgit-Baltistan" + }, + "kenya_political_view_desc": { + "text": "Le point de vue du Kenya sur le triangle d'Ilemi" + }, + "morocco_political_view_desc": { + "text": "Le point de vue du Maroc sur le Sahara occidental" + }, + "russia_political_view_desc": { + "text": "Le point de vue de la Russie sur la Crimée" + }, + "sudan_political_view_desc": { + "text": "Le point de vue du Soudan sur le triangle de Halaib" + }, + "serbia_political_view_desc": { + "text": "Le point de vue de la Serbie sur les îles du Kosovo, de Vukovar et de Sarengrad" + }, + "suriname_political_view_desc": { + "text": "Le point de vue du Suriname sur les sources de Courantyne et de Lawa" + }, + "syria_political_view_desc": { + "text": "Le point de vue de la Syrie sur le plateau du Golan" + }, + "turkey_political_view_desc": { + "text": "Le point de vue de la Turquie sur Chypre et le nord de Chypre" + }, + "tanzania_political_view_desc": { + "text": "Le point de vue de la Tanzanie sur le lac Malawi" + }, + "uruguay_political_view_desc": { + "text": "Le point de vue de l'Uruguay sur Rincon de Artigas" + }, + "vietnam_political_view_desc": { + "text": "Vue du Vietnam sur les îles Paracel et les îles Spratly" + }, + "political_view_satellite_disclaimer": { + "text": "Non disponible en vue satellite" } } \ No newline at end of file diff --git a/src/locales/he/he.json b/src/locales/he/he.json index a9086499..7c47fa4b 100644 --- a/src/locales/he/he.json +++ b/src/locales/he/he.json @@ -3814,5 +3814,53 @@ }, "description_demo": { "text": "אפליקציית הדגמה המציגה את היכולות של שירות המיקום של אמזון" + }, + "no_political_view": { + "text": "אין דעה פוליטית" + }, + "argentina_political_view_desc": { + "text": "השקפת ארגנטינה על שדה הקרח הפטגוני הדרומי וטיירה דל פואגו, כולל איי פוקלנד, דרום ג'ורג'יה ואיי סנדוויץ הדרומיים" + }, + "egypt_political_view_desc": { + "text": "השקפת מצרים על ביר טוויל" + }, + "india_political_view_desc": { + "text": "השקפת הודו על גילגיט-בלטיסטן" + }, + "kenya_political_view_desc": { + "text": "השקפתו של קניה על משולש אילמי" + }, + "morocco_political_view_desc": { + "text": "השקפת מרוקו על סהרה המערבית" + }, + "russia_political_view_desc": { + "text": "השקפת רוסיה על קרים" + }, + "sudan_political_view_desc": { + "text": "השקפת סודן על משולש הלאיב" + }, + "serbia_political_view_desc": { + "text": "השקפת סרביה על איי קוסובו, ווקובר וסרנגראד" + }, + "suriname_political_view_desc": { + "text": "השקפתו של סורינאם על זרמי קורנטיין וממי לאווה" + }, + "syria_political_view_desc": { + "text": "השקפת סוריה על רמת הגולן" + }, + "turkey_political_view_desc": { + "text": "השקפת טורקיה על קפריסין וצפון קפריסין" + }, + "tanzania_political_view_desc": { + "text": "הנוף של טנזניה על אגם מלאווי" + }, + "uruguay_political_view_desc": { + "text": "השקפת אורוגוואי על רינקון דה ארטיגאס" + }, + "vietnam_political_view_desc": { + "text": "השקפת וייטנאם על איי פאראסל ואיי ספראטלי" + }, + "political_view_satellite_disclaimer": { + "text": "לא זמין בתצוגת לוויין" } } \ No newline at end of file diff --git a/src/locales/hi/hi.json b/src/locales/hi/hi.json index 6994a588..d3efcf45 100644 --- a/src/locales/hi/hi.json +++ b/src/locales/hi/hi.json @@ -3814,5 +3814,53 @@ }, "description_demo": { "text": "Amazon Location Service की क्षमताओं को प्रदर्शित करने वाला डेमो ऐप" + }, + "no_political_view": { + "text": "कोई राजनैतिक दृष्टिकोण नहीं" + }, + "argentina_political_view_desc": { + "text": "दक्षिणी पैटागोनियन आइस फ़ील्ड और टिएरा डेल फ़्यूगो पर अर्जेंटीना का नज़रिया, जिसमें फ़ॉकलैंड द्वीप समूह, दक्षिण जॉर्जिया और दक्षिण सैंडविच द्वीप समूह शामिल हैं" + }, + "egypt_political_view_desc": { + "text": "बीर तवील पर मिस्र का नज़रिया" + }, + "india_political_view_desc": { + "text": "गिलगित-बाल्टिस्तान पर भारत का नज़रिया" + }, + "kenya_political_view_desc": { + "text": "इलेमी ट्रायंगल पर केन्या का नजरिया" + }, + "morocco_political_view_desc": { + "text": "पश्चिमी सहारा पर मोरक्को का नज़रिया" + }, + "russia_political_view_desc": { + "text": "क्रीमिया पर रूस का नजरिया" + }, + "sudan_political_view_desc": { + "text": "हलाइब ट्रायंगल पर सूडान का नज़रिया" + }, + "serbia_political_view_desc": { + "text": "कोसोवो, वुकोवर और सारेन्ग्रैड द्वीप समूह पर सर्बिया का नज़रिया" + }, + "suriname_political_view_desc": { + "text": "कूरंटाइन हेडवाटर्स और लावा हेडवाटर्स पर सूरीनाम का नजरिया" + }, + "syria_political_view_desc": { + "text": "गोलान हाइट्स पर सीरिया का नज़रिया" + }, + "turkey_political_view_desc": { + "text": "साइप्रस और उत्तरी साइप्रस पर तुर्की का नजरिया" + }, + "tanzania_political_view_desc": { + "text": "मलावी झील पर तंजानिया का नज़ारा" + }, + "uruguay_political_view_desc": { + "text": "रिनकॉन डी आर्टिगास पर उरुग्वे का नजरिया" + }, + "vietnam_political_view_desc": { + "text": "पैरासेल द्वीप और स्प्रैटली द्वीप समूह पर वियतनाम का नजरिया" + }, + "political_view_satellite_disclaimer": { + "text": "सैटेलाइट दृश्य में उपलब्ध नहीं" } } \ No newline at end of file diff --git a/src/locales/it/it.json b/src/locales/it/it.json index d5cfab56..0d4e3fb4 100644 --- a/src/locales/it/it.json +++ b/src/locales/it/it.json @@ -3814,5 +3814,53 @@ }, "description_demo": { "text": "App dimostrativa che mostra le funzionalità di Amazon Location Service" + }, + "no_political_view": { + "text": "Nessuna visione politica" + }, + "argentina_political_view_desc": { + "text": "Vista dell'Argentina sul campo di ghiaccio della Patagonia meridionale e sulla Terra del Fuoco, comprese le Isole Falkland, la Georgia del Sud e le Isole Sandwich meridionali" + }, + "egypt_political_view_desc": { + "text": "Il punto di vista dell'Egitto su Bir Tawil" + }, + "india_political_view_desc": { + "text": "Il punto di vista dell'India sul Gilgit-Baltistan" + }, + "kenya_political_view_desc": { + "text": "Vista del Kenya sul Triangolo di Ilemi" + }, + "morocco_political_view_desc": { + "text": "Il punto di vista del Marocco sul Sahara occidentale" + }, + "russia_political_view_desc": { + "text": "Il punto di vista della Russia sulla Crimea" + }, + "sudan_political_view_desc": { + "text": "Il punto di vista del Sudan sul Triangolo di Halaib" + }, + "serbia_political_view_desc": { + "text": "Il punto di vista della Serbia su Kosovo, Vukovar e Isole Sarengrad" + }, + "suriname_political_view_desc": { + "text": "Vista del Suriname sulle sorgenti di Courantyne e Lawa" + }, + "syria_political_view_desc": { + "text": "La vista della Siria sulle alture del Golan" + }, + "turkey_political_view_desc": { + "text": "Il punto di vista della Turchia su Cipro e Cipro del Nord" + }, + "tanzania_political_view_desc": { + "text": "Vista della Tanzania sul lago Malawi" + }, + "uruguay_political_view_desc": { + "text": "Il punto di vista dell'Uruguay su Rincon de Artigas" + }, + "vietnam_political_view_desc": { + "text": "Vista del Vietnam sulle isole Paracel e sulle isole Spratly" + }, + "political_view_satellite_disclaimer": { + "text": "Non disponibile nella visualizzazione satellitare" } } \ No newline at end of file diff --git a/src/locales/ja/ja.json b/src/locales/ja/ja.json index b0e0176f..8701f6c8 100644 --- a/src/locales/ja/ja.json +++ b/src/locales/ja/ja.json @@ -3814,5 +3814,53 @@ }, "description_demo": { "text": "Amazon ロケーションサービスの機能を紹介するデモアプリ" + }, + "no_political_view": { + "text": "政治的見解はない" + }, + "argentina_political_view_desc": { + "text": "フォークランド諸島、サウスジョージア、サウスサンドイッチ諸島を含む南パタゴニア氷原とティエラデルフエゴに関するアルゼンチンの眺め" + }, + "egypt_political_view_desc": { + "text": "ビル・タウィルに対するエジプトの見解" + }, + "india_political_view_desc": { + "text": "ギルギット・バルティスタンに関するインドの見解" + }, + "kenya_political_view_desc": { + "text": "イレミ・トライアングルに関するケニアの眺め" + }, + "morocco_political_view_desc": { + "text": "西サハラに対するモロッコの眺め" + }, + "russia_political_view_desc": { + "text": "クリミアに対するロシアの見解" + }, + "sudan_political_view_desc": { + "text": "ハライブトライアングルに関するスーダンの眺め" + }, + "serbia_political_view_desc": { + "text": "コソボ、ヴコヴァル、サレングラード諸島に関するセルビアの眺め" + }, + "suriname_political_view_desc": { + "text": "クーランタイン源流とラワ源流からのスリナムの眺め" + }, + "syria_political_view_desc": { + "text": "ゴラン高原のシリアの眺め" + }, + "turkey_political_view_desc": { + "text": "キプロスと北キプロスに関するトルコの見解" + }, + "tanzania_political_view_desc": { + "text": "タンザニアのマラウイ湖の眺め" + }, + "uruguay_political_view_desc": { + "text": "リンコン・デ・アルティガスに関するウルグアイの見解" + }, + "vietnam_political_view_desc": { + "text": "西沙諸島と南沙諸島に関するベトナムの眺め" + }, + "political_view_satellite_disclaimer": { + "text": "サテライトビューでは使用できません" } } \ No newline at end of file diff --git a/src/locales/ko/ko.json b/src/locales/ko/ko.json index 0a10b592..34ba183c 100644 --- a/src/locales/ko/ko.json +++ b/src/locales/ko/ko.json @@ -3814,5 +3814,53 @@ }, "description_demo": { "text": "Amazon 위치 서비스의 기능을 보여주는 데모 앱" + }, + "no_political_view": { + "text": "정치적 견해 없음" + }, + "argentina_political_view_desc": { + "text": "포클랜드 제도, 사우스조지아, 사우스샌드위치 제도를 포함한 남부 파타고니아 빙원과 티에라 델 푸에고에 대한 아르헨티나의 견해" + }, + "egypt_political_view_desc": { + "text": "비르 타윌에 대한 이집트의 견해" + }, + "india_political_view_desc": { + "text": "길기트-발티스탄에 대한 인도의 견해" + }, + "kenya_political_view_desc": { + "text": "일레미 삼각지대에 대한 케냐의 견해" + }, + "morocco_political_view_desc": { + "text": "서사하라에 대한 모로코의 견해" + }, + "russia_political_view_desc": { + "text": "크리미아에 대한 러시아의 견해" + }, + "sudan_political_view_desc": { + "text": "할라비 삼각지대에 대한 수단의 견해" + }, + "serbia_political_view_desc": { + "text": "코소보, 부코바르, 사렌그라드 제도에 대한 세르비아의 견해" + }, + "suriname_political_view_desc": { + "text": "쿠란타인 상류와 라와 상류에 대한 수리남의 전망" + }, + "syria_political_view_desc": { + "text": "골란 고원에 대한 시리아의 견해" + }, + "turkey_political_view_desc": { + "text": "키프로스와 북키프로스에 대한 터키의 견해" + }, + "tanzania_political_view_desc": { + "text": "말라위 호수에서 바라본 탄자니아의 전망" + }, + "uruguay_political_view_desc": { + "text": "린콘 데 아르티가스에 대한 우루과이의 견해" + }, + "vietnam_political_view_desc": { + "text": "파라셀 제도와 스프래틀리 제도에 대한 베트남의 견해" + }, + "political_view_satellite_disclaimer": { + "text": "위성 보기에서는 사용할 수 없습니다." } } \ No newline at end of file diff --git a/src/locales/pt-BR/pt-BR.json b/src/locales/pt-BR/pt-BR.json index 0ad3f31c..c9542cae 100644 --- a/src/locales/pt-BR/pt-BR.json +++ b/src/locales/pt-BR/pt-BR.json @@ -3814,5 +3814,53 @@ }, "description_demo": { "text": "Aplicativo de demonstração que mostra os recursos do Amazon Location Service" + }, + "no_political_view": { + "text": "Sem visão política" + }, + "argentina_political_view_desc": { + "text": "A visão da Argentina sobre o campo de gelo do sul da Patagônia e a Terra do Fogo, incluindo as Ilhas Malvinas, Geórgia do Sul e Ilhas Sandwich do Sul" + }, + "egypt_political_view_desc": { + "text": "A visão do Egito sobre Bir Tawil" + }, + "india_political_view_desc": { + "text": "A visão da Índia sobre Gilgit-Baltistan" + }, + "kenya_political_view_desc": { + "text": "A visão do Quênia sobre o Triângulo Ilemi" + }, + "morocco_political_view_desc": { + "text": "A visão de Marrocos sobre o Sahara Ocidental" + }, + "russia_political_view_desc": { + "text": "A visão da Rússia sobre a Crimeia" + }, + "sudan_political_view_desc": { + "text": "A visão do Sudão sobre o Triângulo Halaib" + }, + "serbia_political_view_desc": { + "text": "A visão da Sérvia sobre as ilhas Kosovo, Vukovar e Sarengrado" + }, + "suriname_political_view_desc": { + "text": "A visão do Suriname sobre as cabeceiras de Courantyne e Lawa" + }, + "syria_political_view_desc": { + "text": "A visão da Síria sobre as Colinas de Golã" + }, + "turkey_political_view_desc": { + "text": "A visão da Turquia sobre Chipre e o Norte de Chipre" + }, + "tanzania_political_view_desc": { + "text": "Vista da Tanzânia sobre o Lago Malawi" + }, + "uruguay_political_view_desc": { + "text": "A visão do Uruguai sobre Rincon de Artigas" + }, + "vietnam_political_view_desc": { + "text": "Vista do Vietnã sobre as Ilhas Paracel e as Ilhas Spratly" + }, + "political_view_satellite_disclaimer": { + "text": "Não disponível na visualização de satélite" } } \ No newline at end of file diff --git a/src/locales/zh-CN/zh-CN.json b/src/locales/zh-CN/zh-CN.json index 9350c45e..4cd67192 100644 --- a/src/locales/zh-CN/zh-CN.json +++ b/src/locales/zh-CN/zh-CN.json @@ -3810,5 +3810,53 @@ }, "description_demo": { "text": "演示应用程序展示了亚马逊定位服务的功能" + }, + "no_political_view": { + "text": "没有政治观点" + }, + "argentina_political_view_desc": { + "text": "阿根廷对南巴塔哥尼亚冰原和火地岛,包括福克兰群岛、南乔治亚岛和南桑威奇群岛的看法" + }, + "egypt_political_view_desc": { + "text": "埃及对比尔塔维尔的看法" + }, + "india_political_view_desc": { + "text": "印度对吉尔吉特-巴尔蒂斯坦的看法" + }, + "kenya_political_view_desc": { + "text": "肯尼亚对伊莱米三角的看法" + }, + "morocco_political_view_desc": { + "text": "摩洛哥对西撒哈拉的看法" + }, + "russia_political_view_desc": { + "text": "俄罗斯对克里米亚的看法" + }, + "sudan_political_view_desc": { + "text": "苏丹对哈莱布三角的看法" + }, + "serbia_political_view_desc": { + "text": "塞尔维亚对科索沃、武科瓦尔和萨伦格勒岛的看法" + }, + "suriname_political_view_desc": { + "text": "苏里南对库兰坦源头和拉瓦源头的看法" + }, + "syria_political_view_desc": { + "text": "叙利亚对戈兰高地的看法" + }, + "turkey_political_view_desc": { + "text": "土耳其对塞浦路斯和北塞浦路斯的看法" + }, + "tanzania_political_view_desc": { + "text": "坦桑尼亚对马拉维湖的看法" + }, + "uruguay_political_view_desc": { + "text": "乌拉圭对林孔·德·阿蒂加斯的看法" + }, + "vietnam_political_view_desc": { + "text": "越南对西沙群岛和南沙群岛的看法" + }, + "political_view_satellite_disclaimer": { + "text": "在卫星视图中不可用" } } \ No newline at end of file diff --git a/src/locales/zh-TW/zh-TW.json b/src/locales/zh-TW/zh-TW.json index 76644f13..b0bcecc2 100644 --- a/src/locales/zh-TW/zh-TW.json +++ b/src/locales/zh-TW/zh-TW.json @@ -3814,5 +3814,53 @@ }, "description_demo": { "text": "展示亞馬遜定位服務功能的演示應用程序" + }, + "no_political_view": { + "text": "沒有政治觀點" + }, + "argentina_political_view_desc": { + "text": "阿根廷對南巴塔哥尼亞冰場和火地的觀點,包括福克蘭群島、南喬治亞群島和南桑威奇群島" + }, + "egypt_political_view_desc": { + "text": "埃及對比爾塔維爾的看法" + }, + "india_political_view_desc": { + "text": "印度對吉爾吉特-巴爾蒂斯坦的看法" + }, + "kenya_political_view_desc": { + "text": "肯尼亞對伊萊米三角形的觀點" + }, + "morocco_political_view_desc": { + "text": "摩洛哥對西撒哈拉的看法" + }, + "russia_political_view_desc": { + "text": "俄羅斯對克里米亞的看法" + }, + "sudan_political_view_desc": { + "text": "蘇丹對哈萊布三角形的看法" + }, + "serbia_political_view_desc": { + "text": "塞爾維亞對科索沃、武科瓦爾和薩倫格拉德群島的看法" + }, + "suriname_political_view_desc": { + "text": "蘇利南對庫蘭蒂恩河源頭和拉瓦河源頭的看法" + }, + "syria_political_view_desc": { + "text": "敘利亞對戈蘭高地的觀點" + }, + "turkey_political_view_desc": { + "text": "土耳其對塞浦路斯和北塞浦路斯的看法" + }, + "tanzania_political_view_desc": { + "text": "坦桑尼亞對馬拉維湖的視野" + }, + "uruguay_political_view_desc": { + "text": "烏拉圭對林孔德阿蒂加斯的看法" + }, + "vietnam_political_view_desc": { + "text": "越南對帕拉塞爾群島和普拉特利群島的看法" + }, + "political_view_satellite_disclaimer": { + "text": "在衛星視圖中不可用" } } \ No newline at end of file diff --git a/src/services/usePlaceService.ts b/src/services/usePlaceService.ts index 21b730ad..13f71837 100644 --- a/src/services/usePlaceService.ts +++ b/src/services/usePlaceService.ts @@ -23,7 +23,7 @@ const { const usePlaceService = () => { const { placesClient } = useClient(); - const { viewpoint } = useMap(); + const { viewpoint, mapPoliticalView } = useMap(); const { i18n } = useTranslation(); const Language = i18n.language; @@ -34,7 +34,8 @@ const usePlaceService = () => { QueryText, BiasPosition: [viewpoint?.longitude as number, viewpoint?.latitude as number], Language, - AdditionalFeatures: ["Core"] + AdditionalFeatures: ["Core"], + PoliticalView: mapPoliticalView.alpha3 || undefined }; const command = new SuggestCommand(input); return await placesClient?.send(command); @@ -43,7 +44,8 @@ const usePlaceService = () => { const input: GetPlaceCommandInput = { PlaceId, Language, - AdditionalFeatures: ["Contact"] + AdditionalFeatures: ["Contact"], + PoliticalView: mapPoliticalView.alpha3 || undefined }; const command = new GetPlaceCommand(input); return await placesClient?.send(command); @@ -53,7 +55,8 @@ const usePlaceService = () => { QueryText: isQueryId ? undefined : QueryTextOrId, QueryId: isQueryId ? QueryTextOrId : undefined, BiasPosition: isQueryId ? undefined : [viewpoint?.longitude as number, viewpoint?.latitude as number], - Language: isQueryId ? undefined : Language + Language: isQueryId ? undefined : Language, + PoliticalView: mapPoliticalView.alpha3 || undefined }; const command = new SearchTextCommand(input); return await placesClient?.send(command); @@ -61,7 +64,8 @@ const usePlaceService = () => { getPlaceByCoordinates: async (QueryPosition: number[]) => { const input: ReverseGeocodeCommandInput = { QueryPosition, - Language + Language, + PoliticalView: mapPoliticalView.alpha3 || undefined }; const command = new ReverseGeocodeCommand(input); return await placesClient?.send(command); @@ -90,7 +94,7 @@ const usePlaceService = () => { return responseBody; } }), - [viewpoint, Language, placesClient] + [viewpoint, Language, mapPoliticalView, placesClient] ); }; diff --git a/src/setupTests.ts b/src/setupTests.ts index aced83ff..fa4ff4cb 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -108,22 +108,22 @@ jest.mock("@demo/core/constants/appConfig", () => ({ { id: "light", name: "Light" }, { id: "dark", name: "Dark" } ], - MAP_POLITICAL_VIEWS: { - ARG: "Argentina's view on the Southern Patagonian Ice Field and Tierra Del Fuego, including the Falkland Islands, South Georgia, and South Sandwich Islands", - EGY: "Egypt's view on Bir Tawil", - IND: "India's view on Gilgit-Baltistan", - KEN: "Kenya's view on the Ilemi Triangle", - MAR: "Morocco's view on Western Sahara", - RUS: "Russia's view on Crimea", - SDN: "Sudan's view on the Halaib Triangle", - SRB: "Serbia's view on Kosovo, Vukovar, and Sarengrad Islands", - SUR: "Suriname's view on the Courantyne Headwaters and Lawa Headwaters", - SYR: "Syria's view on the Golan Heights", - TUR: "Turkey's view on Cyprus and Northern Cyprus", - TZA: "Tanzania's view on Lake Malawi", - URY: "Uruguay's view on Rincon de Artigas", - VNM: "Vietnam's view on the Paracel Islands and Spratly Islands" - }, + MAP_POLITICAL_VIEWS: [ + { alpha2: "", alpha3: "", desc: "no_political_view.text" }, + { alpha2: "AR", alpha3: "ARG", desc: "argentina_political_view_desc.text" }, + { alpha2: "EG", alpha3: "EGY", desc: "egypt_political_view_desc.text" }, + { alpha2: "IN", alpha3: "IND", desc: "india_political_view_desc.text" }, + { alpha2: "KE", alpha3: "KEN", desc: "kenya_political_view_desc.text" }, + { alpha2: "MA", alpha3: "MAR", desc: "morocco_political_view_desc.text" }, + { alpha2: "RU", alpha3: "RUS", desc: "russia_political_view_desc.text" }, + { alpha2: "SD", alpha3: "SDN", desc: "sudan_political_view_desc.text" }, + { alpha2: "RS", alpha3: "SRB", desc: "serbia_political_view_desc.text" }, + { alpha2: "SR", alpha3: "SUR", desc: "suriname_political_view_desc.text" }, + { alpha2: "SY", alpha3: "SYR", desc: "syria_political_view_desc.text" }, + { alpha2: "TR", alpha3: "TUR", desc: "turkey_political_view_desc.text" }, + { alpha2: "TZ", alpha3: "TZA", desc: "tanzania_political_view_desc.text" }, + { alpha2: "UY", alpha3: "URY", desc: "uruguay_political_view_desc.text" } + ], GEOFENCE_COLLECTION: "location.aws.com.demo.geofences.GeofenceCollection", DEVICE_ID_WEB: "web_browser_device", TRACKER: "location.aws.com.demo.trackers.Tracker", @@ -286,7 +286,7 @@ jest.mock("@demo/core/constants/appConfig", () => ({ AWS_LOCATION_TRAVEL_AND_HOSPITALITY_URL: "https://aws.amazon.com/location/industry/travel-and-hospitality/", AWS_LOCATION_REAL_ESTATE_URL: "https://aws.amazon.com/location/real-estate/", AWS_LOCATION_RESOURCES_URL: "https://aws.amazon.com/location/resources/", - AWS_LOCATION_CUSTOMERS_URL: "https://aws.amazon.com/location/resources/customers/", + AWS_LOCATION_CUSTOMERS_URL: "https://aws.amazon.com/location/customers/", AWS_LOCATION_PRODUCT_RESOURCES_URL: "https://aws.amazon.com/location/resources/product-resources/", AWS_LOCATION_DEVELOPER_RESOURCES_URL: "https://aws.amazon.com/location/resources/developer-resources/", AMAZON_LOCATION_AUTH_SDK_IOS_URL: "https://github.com/aws-geospatial/amazon-location-mobile-auth-sdk-ios", diff --git a/src/stores/useMapStore.ts b/src/stores/useMapStore.ts index dccc6804..a5c2b490 100644 --- a/src/stores/useMapStore.ts +++ b/src/stores/useMapStore.ts @@ -31,7 +31,7 @@ interface MapStoreProps { mapUnit: MapUnitEnum; mapStyle: MapStyleEnum; mapColorScheme: MapColorSchemeEnum; - mapPoliticalView?: string; + mapPoliticalView: { alpha2: string; alpha3: string; desc: string }; } const initialState: IStateProps = { @@ -42,7 +42,12 @@ const initialState: IStateProps = { }, mapUnit: MapUnitEnum.IMPERIAL, mapStyle: MapStyleEnum.STANDARD, - mapColorScheme: MapColorSchemeEnum.LIGHT + mapColorScheme: MapColorSchemeEnum.LIGHT, + mapPoliticalView: { + alpha2: "", + alpha3: "", + desc: "no_political_view.text" + } }; export default createStore(initialState, true, localStorageKey); diff --git a/src/theme/styles/global.scss b/src/theme/styles/global.scss index e7c089b8..cc3de0b5 100644 --- a/src/theme/styles/global.scss +++ b/src/theme/styles/global.scss @@ -72,7 +72,7 @@ .regular-text { // 16px - font-size: 1.24rem; + font-size: 1.23rem; } .small-text { diff --git a/src/utils/getFlagEmoji.ts b/src/utils/getFlagEmoji.ts new file mode 100644 index 00000000..8aae6fef --- /dev/null +++ b/src/utils/getFlagEmoji.ts @@ -0,0 +1,7 @@ +export const getFlagEmoji = (countryCode: string): string => { + const codePoints = countryCode + .toUpperCase() + .split("") + .map(char => 127397 + char.charCodeAt(0)); + return String.fromCodePoint(...codePoints); +}; diff --git a/src/utils/index.ts b/src/utils/index.ts index b3a58e46..9317e9cf 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -13,3 +13,4 @@ export * from "./getDomainName"; export * from "./regionUtils"; export * from "./distanceUtil"; export * from "./turfUtils"; +export * from "./getFlagEmoji";