diff options
Diffstat (limited to 'src/components/settings/settings/EditSettingsForm.js')
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index c1e812008..52bd18603 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -38,6 +38,14 @@ const messages = defineMessages({ | |||
38 | id: 'settings.app.lockedPasswordInfo', | 38 | id: 'settings.app.lockedPasswordInfo', |
39 | defaultMessage: '!!!Please make sure to set a password you\'ll remember.\nIf you loose this password, you will have to reinstall Ferdi.', | 39 | defaultMessage: '!!!Please make sure to set a password you\'ll remember.\nIf you loose this password, you will have to reinstall Ferdi.', |
40 | }, | 40 | }, |
41 | scheduledDNDTimeInfo: { | ||
42 | id: 'settings.app.scheduledDNDTimeInfo', | ||
43 | defaultMessage: '!!!Times in 24-Hour-Format. End time can be before start time (e.g. start 17:00, end 09:00) to enable Do-not-Disturb overnight.', | ||
44 | }, | ||
45 | scheduledDNDInfo: { | ||
46 | id: 'settings.app.scheduledDNDInfo', | ||
47 | defaultMessage: '!!!Scheduled Do-not-Disturb allows you to define a period of time in which you do not want to get Notifications from Ferdi.', | ||
48 | }, | ||
41 | headlineLanguage: { | 49 | headlineLanguage: { |
42 | id: 'settings.app.headlineLanguage', | 50 | id: 'settings.app.headlineLanguage', |
43 | defaultMessage: '!!!Language', | 51 | defaultMessage: '!!!Language', |
@@ -167,7 +175,11 @@ export default @observer class EditSettingsForm extends Component { | |||
167 | } | 175 | } |
168 | 176 | ||
169 | const isLoggedIn = Boolean(localStorage.getItem('authToken')); | 177 | const isLoggedIn = Boolean(localStorage.getItem('authToken')); |
170 | const lockingFeatureEnabled = window.ferdi.stores.settings.all.app.lockingFeatureEnabled; | 178 | |
179 | const { | ||
180 | lockingFeatureEnabled, | ||
181 | scheduledDNDEnabled, | ||
182 | } = window.ferdi.stores.settings.all.app; | ||
171 | 183 | ||
172 | return ( | 184 | return ( |
173 | <div className="settings__main"> | 185 | <div className="settings__main"> |
@@ -273,6 +285,56 @@ export default @observer class EditSettingsForm extends Component { | |||
273 | </p> | 285 | </p> |
274 | 286 | ||
275 | 287 | ||
288 | <Toggle field={form.$('scheduledDNDEnabled')} /> | ||
289 | {scheduledDNDEnabled && ( | ||
290 | <> | ||
291 | <div style={{ | ||
292 | display: 'flex', | ||
293 | justifyContent: 'center', | ||
294 | }} | ||
295 | > | ||
296 | <div style={{ | ||
297 | padding: '0 1rem', | ||
298 | width: '100%', | ||
299 | }} | ||
300 | > | ||
301 | <Input | ||
302 | placeholder="17:00" | ||
303 | onChange={e => this.submit(e)} | ||
304 | field={form.$('scheduledDNDStart')} | ||
305 | type="time" | ||
306 | /> | ||
307 | </div> | ||
308 | <div style={{ | ||
309 | padding: '0 1rem', | ||
310 | width: '100%', | ||
311 | }} | ||
312 | > | ||
313 | <Input | ||
314 | placeholder="09:00" | ||
315 | onChange={e => this.submit(e)} | ||
316 | field={form.$('scheduledDNDEnd')} | ||
317 | type="time" | ||
318 | /> | ||
319 | </div> | ||
320 | </div> | ||
321 | <p> | ||
322 | { intl.formatMessage(messages.scheduledDNDTimeInfo) } | ||
323 | </p> | ||
324 | </> | ||
325 | )} | ||
326 | <p | ||
327 | className="settings__message" | ||
328 | style={{ | ||
329 | borderTop: 0, marginTop: 0, paddingTop: 0, marginBottom: '2rem', | ||
330 | }} | ||
331 | > | ||
332 | <span> | ||
333 | { intl.formatMessage(messages.scheduledDNDInfo) } | ||
334 | </span> | ||
335 | </p> | ||
336 | |||
337 | |||
276 | {/* Appearance */} | 338 | {/* Appearance */} |
277 | <h2 id="apperance">{intl.formatMessage(messages.headlineAppearance)}</h2> | 339 | <h2 id="apperance">{intl.formatMessage(messages.headlineAppearance)}</h2> |
278 | <Toggle field={form.$('showDisabledServices')} /> | 340 | <Toggle field={form.$('showDisabledServices')} /> |