diff --git a/src/components/MapPopup/i18n.json b/src/components/MapPopup/i18n.json deleted file mode 100644 index 36e06a2a..00000000 --- a/src/components/MapPopup/i18n.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "namespace": "common", - "strings": { - "messagePopupClose": "Close" - } -} diff --git a/src/components/MapPopup/index.tsx b/src/components/MapPopup/index.tsx deleted file mode 100644 index 2961bb25..00000000 --- a/src/components/MapPopup/index.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import { CloseLineIcon } from '@ifrc-go/icons'; -import { - Button, - Container, - ContainerProps, -} from '@ifrc-go/ui'; -import { useTranslation } from '@ifrc-go/ui/hooks'; -import { _cs } from '@togglecorp/fujs'; -import { MapPopup as BasicMapPopup } from '@togglecorp/re-map'; - -import i18n from './i18n.json'; -import styles from './styles.module.css'; - -const popupOptions: mapboxgl.PopupOptions = { - closeButton: false, - closeOnClick: false, - closeOnMove: false, - offset: 8, - className: styles.mapPopup, - maxWidth: 'unset', -}; - -interface Props extends ContainerProps { - coordinates: mapboxgl.LngLatLike; - children: React.ReactNode; - onCloseButtonClick: () => void; -} - -function MapPopup(props: Props) { - const { - children, - coordinates, - onCloseButtonClick, - actions, - childrenContainerClassName, - ...containerProps - } = props; - - const strings = useTranslation(i18n); - - return ( - - ); -} - -export default MapPopup; diff --git a/src/components/MapPopup/styles.module.css b/src/components/MapPopup/styles.module.css deleted file mode 100644 index 7afdb2c7..00000000 --- a/src/components/MapPopup/styles.module.css +++ /dev/null @@ -1,49 +0,0 @@ -.map-popup { - display: flex; - padding: 0; - width: 20rem; - min-height: 10rem; - max-height: 20rem; - overflow: auto; - font-family: var(--go-ui-font-family-sans-serif); - font-size: var(--go-ui-font-size-md); - - :global { - .mapboxgl-tip { - flex-shrink: 0; - } - - .mapboxgl-popup-content { - display: flex; - flex-direction: column; - flex-grow: 1; - padding: 0; - overflow: auto; - - >div { - display: flex; - flex-direction: column; - flex-grow: 1; - padding: 0; - overflow: auto; - } - } - } - - .container { - flex-grow: 1; - border: var(--go-ui-width-separator-thin) solid var(--go-ui-color-separator); - width: 100%; - height: 100%; - overflow: auto; - - .close-button { - font-size: var(--go-ui-height-icon-multiplier); - } - - .content { - overflow: auto; - } - } -} - diff --git a/src/hooks/useInputState.ts b/src/hooks/useInputState.ts deleted file mode 100644 index f731be64..00000000 --- a/src/hooks/useInputState.ts +++ /dev/null @@ -1,43 +0,0 @@ -import React, { - useEffect, - useRef, -} from 'react'; - -type ValueOrSetterFn = T | ((value: T) => T); -function isSetterFn(value: ValueOrSetterFn): value is ((value: T) => T) { - return typeof value === 'function'; -} - -function useInputState( - initialValue: T, - sideEffect?: (newValue: T, oldValue: T) => T, -) { - const [value, setValue] = React.useState(initialValue); - const sideEffectRef = useRef(sideEffect); - - useEffect( - () => { - sideEffectRef.current = sideEffect; - }, - [sideEffect], - ); - - type SetValue = React.Dispatch>; - const setValueSafe: SetValue = React.useCallback((newValueOrSetter) => { - setValue((oldValue) => { - const newValue = isSetterFn(newValueOrSetter) - ? newValueOrSetter(oldValue) - : newValueOrSetter; - - if (sideEffectRef.current) { - return sideEffectRef.current(newValue, oldValue); - } - - return newValue; - }); - }, []); - - return [value, setValueSafe] as const; -} - -export default useInputState; diff --git a/src/views/Home/AlertsView/index.tsx b/src/views/Home/AlertsView/index.tsx index 6741b419..81bf5193 100644 --- a/src/views/Home/AlertsView/index.tsx +++ b/src/views/Home/AlertsView/index.tsx @@ -21,7 +21,7 @@ import styles from './styles.module.css'; const COUNTRIES_LIST = gql` query CountryList { public { - allCountries { + allCountries(alertFilters: {}) { name id iso3