diff --git a/src/preferences/components/AddPreferenceComponent/AddPreferenceComponent.js b/src/preferences/components/AddPreferenceComponent/AddPreferenceComponent.js index 176157415388849b1a1aabc137c9b233f5bc569f..80dbcda173d7f7603621615fa86222186770c20f 100644 --- a/src/preferences/components/AddPreferenceComponent/AddPreferenceComponent.js +++ b/src/preferences/components/AddPreferenceComponent/AddPreferenceComponent.js @@ -13,6 +13,12 @@ import { useParams } from "react-router-dom"; import * as showSnackBarActionCreators from "../../../common/actions/Snackbar"; import * as updatePreferencesActionCreators from "../../actions/UpdatePreferences"; +const NotificationPriorityTypes = Object.freeze({ + IMPORTANT: "IMPORTANT", + NORMAL: "NORMAL", + LOW: "LOW", +}); + const AddPreferenceComponent = ({ updatePreferences, showSnackbar }) => { const hours = [...Array(24)].map((e, i) => ({ key: i, @@ -77,8 +83,8 @@ const AddPreferenceComponent = ({ updatePreferences, showSnackbar }) => { <label>Notification priority</label> <Checkbox label="Important" - name="notificatioPrioritylGroup" - value="IMPORTANT" + name="notificatioPriorityGroup" + value={NotificationPriorityTypes.IMPORTANT} checked={notificationPriority.important} onClick={() => { setNotificationPriority({ @@ -89,8 +95,8 @@ const AddPreferenceComponent = ({ updatePreferences, showSnackbar }) => { /> <Checkbox label="Normal" - name="notificationPrioritylGroup" - value="NORMAL" + name="notificationPriorityGroup" + value={NotificationPriorityTypes.NORMAL} checked={notificationPriority.normal} onClick={() => { setNotificationPriority({ @@ -101,8 +107,8 @@ const AddPreferenceComponent = ({ updatePreferences, showSnackbar }) => { /> <Checkbox label="Low" - name="notificationPrioritylGroup" - value="LOW" + name="notificationPriorityGroup" + value={NotificationPriorityTypes.LOW} checked={notificationPriority.low} onClick={() => { setNotificationPriority({