-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ea29d1
commit eb48fa0
Showing
20 changed files
with
709 additions
and
2,345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { defineConfig, Schema } from '@julr/vite-plugin-validate-env'; | ||
|
||
// TODO: Integrate .env for CI and remove optional() call on required fields | ||
export default defineConfig({ | ||
APP_TITLE: Schema.string.optional(), | ||
APP_MAPBOX_ACCESS_TOKEN: Schema.string(), | ||
APP_MAPBOX_ACCESS_TOKEN: Schema.string.optional(), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"namespace": "common", | ||
"strings": { | ||
"messagePopupClose": "Close" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
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 ( | ||
<BasicMapPopup | ||
coordinates={coordinates} | ||
popupOptions={popupOptions} | ||
hidden={false} | ||
trackPointer={false} | ||
> | ||
<Container | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...containerProps} | ||
className={styles.container} | ||
withoutWrapInHeading | ||
childrenContainerClassName={_cs(styles.content, childrenContainerClassName)} | ||
withHeaderBorder | ||
withInternalPadding | ||
actions={( | ||
<> | ||
{actions} | ||
<Button | ||
className={styles.closeButton} | ||
name={undefined} | ||
variant="tertiary" | ||
onClick={onCloseButtonClick} | ||
title={strings.messagePopupClose} | ||
> | ||
<CloseLineIcon /> | ||
</Button> | ||
</> | ||
)} | ||
> | ||
{children} | ||
</Container> | ||
</BasicMapPopup> | ||
); | ||
} | ||
|
||
export default MapPopup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.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; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/// <reference types="vite/client" /> | ||
|
||
type ImportMetaEnvAugmented = import('@julr/vite-plugin-validate-env').ImportMetaEnvAugmented< | ||
typeof import('../../env').default | ||
> | ||
|
||
interface ImportMetaEnv extends ImportMetaEnvAugmented { | ||
// The custom environment variables that are passed through the vite | ||
APP_COMMIT_HASH: string; | ||
APP_VERSION: string; | ||
} | ||
|
||
interface ImportMeta { | ||
readonly env: ImportMetaEnv | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,9 @@ | ||
export const defaultChartMargin = { | ||
top: 0, | ||
right: 0, | ||
bottom: 0, | ||
left: 0, | ||
}; | ||
|
||
export const defaultChartPadding = { | ||
top: 10, | ||
right: 10, | ||
bottom: 10, | ||
left: 10, | ||
}; | ||
|
||
// Map | ||
export const DURATION_MAP_ZOOM = 1000; | ||
export const DEFAULT_MAP_PADDING = 50; | ||
|
||
// Storage | ||
|
||
export const KEY_USER_STORAGE = 'user'; | ||
export const KEY_LANGUAGE_STORAGE = 'language'; | ||
|
||
// Search page | ||
|
||
export const KEY_URL_SEARCH = 'keyword'; | ||
export const SEARCH_TEXT_LENGTH_MIN = 3; | ||
|
||
// Colors | ||
|
||
export const COLOR_WHITE = '#ffffff'; | ||
export const COLOR_TEXT = '#313131'; | ||
export const COLOR_TEXT_ON_DARK = COLOR_WHITE; | ||
export const COLOR_LIGHT_GREY = '#e0e0e0'; | ||
export const COLOR_DARK_GREY = '#a5a5a5'; | ||
export const COLOR_BLACK = '#000000'; | ||
export const COLOR_LIGHT_YELLOW = '#ffd470'; | ||
export const COLOR_YELLOW = '#ff9e00'; | ||
export const COLOR_BLUE = '#4c5d9b'; | ||
export const COLOR_LIGHT_BLUE = '#c7d3e0'; | ||
export const COLOR_ORANGE = '#ff8000'; | ||
export const COLOR_RED = '#f5333f'; | ||
export const COLOR_DARK_RED = '#730413'; | ||
export const COLOR_PRIMARY_BLUE = '#011e41'; | ||
export const COLOR_PRIMARY_RED = '#f5333f'; |
Oops, something went wrong.