diff options
author | 2021-05-15 22:49:34 +0530 | |
---|---|---|
committer | 2021-05-15 19:19:34 +0200 | |
commit | 60378397678090d26193ba54e94db9814d4a0b5c (patch) | |
tree | 5b2c4606e8a411e6a24345a4e28e273e530467e3 /src/components | |
parent | New Crowdin updates (#1415) (diff) | |
download | ferdium-app-60378397678090d26193ba54e94db9814d4a0b5c.tar.gz ferdium-app-60378397678090d26193ba54e94db9814d4a0b5c.tar.zst ferdium-app-60378397678090d26193ba54e94db9814d4a0b5c.zip |
Separated privacy & security settings into its own tab in the preferences screen (#1416)
* Separated privacy & security settings into its own tab in the preferences screen.
* Fixing review comments.
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 120 |
1 files changed, 69 insertions, 51 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index e0687be12..eef529730 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -88,6 +88,10 @@ const messages = defineMessages({ | |||
88 | id: 'settings.app.accentColorInfo', | 88 | id: 'settings.app.accentColorInfo', |
89 | defaultMessage: '!!!Write your accent color in a CSS-compatible format. (Default: {defaultAccentColor})', | 89 | defaultMessage: '!!!Write your accent color in a CSS-compatible format. (Default: {defaultAccentColor})', |
90 | }, | 90 | }, |
91 | headlinePrivacy: { | ||
92 | id: 'settings.app.headlinePrivacy', | ||
93 | defaultMessage: '!!!Privacy', | ||
94 | }, | ||
91 | headlineAdvanced: { | 95 | headlineAdvanced: { |
92 | id: 'settings.app.headlineAdvanced', | 96 | id: 'settings.app.headlineAdvanced', |
93 | defaultMessage: '!!!Advanced', | 97 | defaultMessage: '!!!Advanced', |
@@ -291,6 +295,13 @@ export default @observer class EditSettingsForm extends Component { | |||
291 | {intl.formatMessage(messages.headlineAppearance)} | 295 | {intl.formatMessage(messages.headlineAppearance)} |
292 | </h2> | 296 | </h2> |
293 | <h2 | 297 | <h2 |
298 | id="privacy" | ||
299 | className={this.state.activeSetttingsTab === 'privacy' ? 'badge badge--primary' : 'badge'} | ||
300 | onClick={() => { this.setActiveSettingsTab('privacy'); }} | ||
301 | > | ||
302 | {intl.formatMessage(messages.headlinePrivacy)} | ||
303 | </h2> | ||
304 | <h2 | ||
294 | id="language" | 305 | id="language" |
295 | className={this.state.activeSetttingsTab === 'language' ? 'badge badge--primary' : 'badge'} | 306 | className={this.state.activeSetttingsTab === 'language' ? 'badge badge--primary' : 'badge'} |
296 | onClick={() => { this.setActiveSettingsTab('language'); }} | 307 | onClick={() => { this.setActiveSettingsTab('language'); }} |
@@ -327,19 +338,10 @@ export default @observer class EditSettingsForm extends Component { | |||
327 | {isWindows && ( | 338 | {isWindows && ( |
328 | <Toggle field={form.$('closeToSystemTray')} /> | 339 | <Toggle field={form.$('closeToSystemTray')} /> |
329 | )} | 340 | )} |
330 | <Toggle field={form.$('privateNotifications')} /> | ||
331 | {(isWindows || isMac) && ( | ||
332 | <Toggle field={form.$('notifyTaskBarOnMessage')} />)} | ||
333 | <Select field={form.$('navigationBarBehaviour')} /> | 341 | <Select field={form.$('navigationBarBehaviour')} /> |
334 | 342 | ||
335 | <Hr /> | 343 | <Hr /> |
336 | 344 | ||
337 | <Select field={form.$('searchEngine')} /> | ||
338 | <Toggle field={form.$('sentry')} /> | ||
339 | <p>{intl.formatMessage(messages.sentryInfo)}</p> | ||
340 | |||
341 | <Hr /> | ||
342 | |||
343 | <Toggle field={form.$('hibernate')} /> | 345 | <Toggle field={form.$('hibernate')} /> |
344 | {hibernationEnabled && ( | 346 | {hibernationEnabled && ( |
345 | <> | 347 | <> |
@@ -394,48 +396,6 @@ export default @observer class EditSettingsForm extends Component { | |||
394 | </> | 396 | </> |
395 | )} | 397 | )} |
396 | 398 | ||
397 | <Hr /> | ||
398 | |||
399 | <Toggle field={form.$('lockingFeatureEnabled')} /> | ||
400 | {lockingFeatureEnabled && ( | ||
401 | <> | ||
402 | {isMac && systemPreferences.canPromptTouchID() && ( | ||
403 | <Toggle field={form.$('useTouchIdToUnlock')} /> | ||
404 | )} | ||
405 | |||
406 | <Input | ||
407 | placeholder={intl.formatMessage(messages.lockedPassword)} | ||
408 | onChange={e => this.submit(e)} | ||
409 | field={form.$('lockedPassword')} | ||
410 | type="password" | ||
411 | scorePassword | ||
412 | showPasswordToggle | ||
413 | /> | ||
414 | <p> | ||
415 | { intl.formatMessage(messages.lockedPasswordInfo) } | ||
416 | </p> | ||
417 | |||
418 | <Input | ||
419 | placeholder="Lock after inactivity" | ||
420 | onChange={e => this.submit(e)} | ||
421 | field={form.$('inactivityLock')} | ||
422 | autoFocus | ||
423 | /> | ||
424 | <p> | ||
425 | { intl.formatMessage(messages.inactivityLockInfo) } | ||
426 | </p> | ||
427 | </> | ||
428 | )} | ||
429 | <p | ||
430 | className="settings__message" | ||
431 | style={{ | ||
432 | borderTop: 0, marginTop: 0, paddingTop: 0, marginBottom: '2rem', | ||
433 | }} | ||
434 | > | ||
435 | <span> | ||
436 | { intl.formatMessage(messages.lockInfo) } | ||
437 | </span> | ||
438 | </p> | ||
439 | 399 | ||
440 | <Hr /> | 400 | <Hr /> |
441 | 401 | ||
@@ -543,6 +503,64 @@ export default @observer class EditSettingsForm extends Component { | |||
543 | </div> | 503 | </div> |
544 | )} | 504 | )} |
545 | 505 | ||
506 | {/* Privacy */} | ||
507 | { this.state.activeSetttingsTab === 'privacy' && ( | ||
508 | <div> | ||
509 | <Toggle field={form.$('privateNotifications')} /> | ||
510 | {(isWindows || isMac) && ( | ||
511 | <Toggle field={form.$('notifyTaskBarOnMessage')} />)} | ||
512 | |||
513 | <Hr /> | ||
514 | |||
515 | <Select field={form.$('searchEngine')} /> | ||
516 | <Toggle field={form.$('sentry')} /> | ||
517 | <p>{intl.formatMessage(messages.sentryInfo)}</p> | ||
518 | |||
519 | <Hr /> | ||
520 | |||
521 | <Toggle field={form.$('lockingFeatureEnabled')} /> | ||
522 | {lockingFeatureEnabled && ( | ||
523 | <> | ||
524 | {isMac && systemPreferences.canPromptTouchID() && ( | ||
525 | <Toggle field={form.$('useTouchIdToUnlock')} /> | ||
526 | )} | ||
527 | |||
528 | <Input | ||
529 | placeholder={intl.formatMessage(messages.lockedPassword)} | ||
530 | onChange={e => this.submit(e)} | ||
531 | field={form.$('lockedPassword')} | ||
532 | type="password" | ||
533 | scorePassword | ||
534 | showPasswordToggle | ||
535 | /> | ||
536 | <p> | ||
537 | { intl.formatMessage(messages.lockedPasswordInfo) } | ||
538 | </p> | ||
539 | |||
540 | <Input | ||
541 | placeholder="Lock after inactivity" | ||
542 | onChange={e => this.submit(e)} | ||
543 | field={form.$('inactivityLock')} | ||
544 | autoFocus | ||
545 | /> | ||
546 | <p> | ||
547 | { intl.formatMessage(messages.inactivityLockInfo) } | ||
548 | </p> | ||
549 | </> | ||
550 | )} | ||
551 | <p | ||
552 | className="settings__message" | ||
553 | style={{ | ||
554 | borderTop: 0, marginTop: 0, paddingTop: 0, marginBottom: '2rem', | ||
555 | }} | ||
556 | > | ||
557 | <span> | ||
558 | { intl.formatMessage(messages.lockInfo) } | ||
559 | </span> | ||
560 | </p> | ||
561 | </div> | ||
562 | )} | ||
563 | |||
546 | {/* Language */} | 564 | {/* Language */} |
547 | { this.state.activeSetttingsTab === 'language' && ( | 565 | { this.state.activeSetttingsTab === 'language' && ( |
548 | <div> | 566 | <div> |