Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions public/config/app-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ window.AppConfig = {
ALERTS_PLAYER_CONFIDENCE_THRESHOLD: 0.15,
ALERTS_SOUND_FILE: 'notification-alert.mp3',
ALERTS_CAMERA_RANGE_KM: 30,
USER_GUIDE_URL:
'https://pyronear.notion.site/Guide-d-utilisation-plateforme-Pyronear-376425b63668818ebd17da60b20cc770',
HISTORY_NB_ALERTS_PER_PAGE: 15,
};
19 changes: 17 additions & 2 deletions src/components/Topbar/Preferences/PreferencesMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import LogoutIcon from '@mui/icons-material/Logout';
import MapIcon from '@mui/icons-material/Map';
import MenuBookIcon from '@mui/icons-material/MenuBook';
import SatelliteAltIcon from '@mui/icons-material/SatelliteAlt';
import TerrainIcon from '@mui/icons-material/Terrain';
import {
Expand All @@ -15,6 +16,7 @@ import { useTranslation } from 'react-i18next';

import { useAuth } from '@/context/useAuth';
import { usePreferences } from '@/context/usePreferences';
import appConfig from '@/services/appConfig';

import { AlertVolumeToggle } from './AlertVolumeToggle';

Expand Down Expand Up @@ -83,9 +85,7 @@ export const PreferencesMenu: React.FC<PreferencesMenuProps> = ({
</ToggleButton>
</ToggleButtonGroup>
</Stack>

<Divider />

<Stack spacing={1}>
<Typography>{t('preferences.enableAudioAlerts')}</Typography>
<AlertVolumeToggle
Expand All @@ -94,6 +94,21 @@ export const PreferencesMenu: React.FC<PreferencesMenuProps> = ({
/>
</Stack>

<Divider />

<Stack>
<Button
href={appConfig.getConfig().USER_GUIDE_URL}
target="_blank"
rel="noopener noreferrer"
variant="outlined"
startIcon={<MenuBookIcon />}
fullWidth
>
{t('preferences.userGuide')}
</Button>
</Stack>

{
<>
<Divider />
Expand Down
3 changes: 2 additions & 1 deletion src/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
"mapOsm": "OpenStreetMap",
"mapIgn": "IGN (France)",
"mapSatellite": "Satellit",
"enableAudioAlerts": "Audio-Warnungen aktivieren"
"enableAudioAlerts": "Audio-Warnungen aktivieren",
"userGuide": "Benutzerhandbuch"
}
}
3 changes: 2 additions & 1 deletion src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@
"mapOsm": "OpenStreetMap",
"mapIgn": "IGN (France)",
"mapSatellite": "Satellite",
"enableAudioAlerts": "Enable Audio Alerts"
"enableAudioAlerts": "Enable Audio Alerts",
"userGuide": "User guide"
},
"map": {
"layerControl": "Map Layers",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@
"mapOsm": "OpenStreetMap",
"mapIgn": "IGN (Francia)",
"mapSatellite": "Satélite",
"enableAudioAlerts": "Activar el sonido de las alertas"
"enableAudioAlerts": "Activar el sonido de las alertas",
"userGuide": "Guía del usuario"
},
"map": {
"layerControl": "Capas",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@
"mapOsm": "OpenStreetMap",
"mapIgn": "IGN (France)",
"mapSatellite": "Satellite",
"enableAudioAlerts": "Activer le son des alertes"
"enableAudioAlerts": "Activer le son des alertes",
"userGuide": "Guide utilisateur"
},
"map": {
"layerControl": "Couches",
Expand Down
3 changes: 3 additions & 0 deletions src/services/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface AppConfigType {
readonly ALERTS_PLAYER_CONFIDENCE_THRESHOLD: number;
readonly ALERTS_SOUND_FILE: string;
readonly ALERTS_CAMERA_RANGE_KM: number;
readonly USER_GUIDE_URL: string;

readonly HISTORY_NB_ALERTS_PER_PAGE: number;
}
Expand Down Expand Up @@ -52,6 +53,8 @@ export class AppConfig {
// @ts-expect-error config is fetched from a JS file
ALERTS_CAMERA_RANGE_KM: window.AppConfig?.ALERTS_CAMERA_RANGE_KM ?? 30,
// @ts-expect-error config is fetched from a JS file
USER_GUIDE_URL: window.AppConfig?.USER_GUIDE_URL,
// @ts-expect-error config is fetched from a JS file
HISTORY_NB_ALERTS_PER_PAGE: window.AppConfig?.HISTORY_NB_ALERTS_PER_PAGE,
};
}
Expand Down
Loading