diff options
Diffstat (limited to 'src/components/settings/settings/EditSettingsForm.tsx')
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.tsx | 92 |
1 files changed, 48 insertions, 44 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.tsx b/src/components/settings/settings/EditSettingsForm.tsx index 1d89b53a9..e796a48ec 100644 --- a/src/components/settings/settings/EditSettingsForm.tsx +++ b/src/components/settings/settings/EditSettingsForm.tsx | |||
@@ -6,7 +6,7 @@ import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl'; | |||
6 | import { mdiGithub, mdiOpenInNew, mdiPowerPlug } from '@mdi/js'; | 6 | import { mdiGithub, mdiOpenInNew, mdiPowerPlug } from '@mdi/js'; |
7 | import Form from '../../../lib/Form'; | 7 | import Form from '../../../lib/Form'; |
8 | import Button from '../../ui/button'; | 8 | import Button from '../../ui/button'; |
9 | import Toggle from '../../ui/Toggle.js'; | 9 | import Toggle from '../../ui/toggle'; |
10 | import Select from '../../ui/Select'; | 10 | import Select from '../../ui/Select'; |
11 | import Input from '../../ui/input/index'; | 11 | import Input from '../../ui/input/index'; |
12 | import ColorPickerInput from '../../ui/ColorPickerInput'; | 12 | import ColorPickerInput from '../../ui/ColorPickerInput'; |
@@ -522,26 +522,30 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
522 | <H2 className="settings__section_header"> | 522 | <H2 className="settings__section_header"> |
523 | {intl.formatMessage(messages.sectionMain)} | 523 | {intl.formatMessage(messages.sectionMain)} |
524 | </H2> | 524 | </H2> |
525 | <Toggle field={form.$('autoLaunchOnStart')} /> | 525 | <Toggle {...form.$('autoLaunchOnStart').bind()} /> |
526 | <Toggle field={form.$('runInBackground')} /> | 526 | <Toggle {...form.$('runInBackground').bind()} /> |
527 | <Toggle field={form.$('confirmOnQuit')} /> | 527 | <Toggle {...form.$('confirmOnQuit').bind()} /> |
528 | <Toggle field={form.$('enableSystemTray')} /> | 528 | <Toggle {...form.$('enableSystemTray').bind()} /> |
529 | {reloadAfterResume && <Hr />} | 529 | {reloadAfterResume && <Hr />} |
530 | <Toggle field={form.$('reloadAfterResume')} /> | 530 | <Toggle {...form.$('reloadAfterResume').bind()} /> |
531 | {reloadAfterResume && ( | 531 | {reloadAfterResume && ( |
532 | <div> | 532 | <div> |
533 | <Input {...form.$('reloadAfterResumeTime').bind()} /> | 533 | <Input {...form.$('reloadAfterResumeTime').bind()} /> |
534 | <Hr /> | 534 | <Hr /> |
535 | </div> | 535 | </div> |
536 | )} | 536 | )} |
537 | <Toggle field={form.$('startMinimized')} /> | 537 | <Toggle {...form.$('startMinimized').bind()} /> |
538 | {isWindows && <Toggle field={form.$('minimizeToSystemTray')} />} | 538 | {isWindows && ( |
539 | {isWindows && <Toggle field={form.$('closeToSystemTray')} />} | 539 | <Toggle {...form.$('minimizeToSystemTray').bind()} /> |
540 | )} | ||
541 | {isWindows && ( | ||
542 | <Toggle {...form.$('closeToSystemTray').bind()} /> | ||
543 | )} | ||
540 | 544 | ||
541 | <Toggle field={form.$('keepAllWorkspacesLoaded')} /> | 545 | <Toggle {...form.$('keepAllWorkspacesLoaded').bind()} /> |
542 | 546 | ||
543 | {isTodosActivated && <Hr />} | 547 | {isTodosActivated && <Hr />} |
544 | <Toggle field={form.$('enableTodos')} /> | 548 | <Toggle {...form.$('enableTodos').bind()} /> |
545 | {isTodosActivated && ( | 549 | {isTodosActivated && ( |
546 | <div> | 550 | <div> |
547 | <Select field={form.$('predefinedTodoServer')} /> | 551 | <Select field={form.$('predefinedTodoServer')} /> |
@@ -571,7 +575,7 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
571 | {isTodosActivated && <Hr />} | 575 | {isTodosActivated && <Hr />} |
572 | 576 | ||
573 | {scheduledDNDEnabled && <Hr />} | 577 | {scheduledDNDEnabled && <Hr />} |
574 | <Toggle field={form.$('scheduledDNDEnabled')} /> | 578 | <Toggle {...form.$('scheduledDNDEnabled').bind()} /> |
575 | 579 | ||
576 | {scheduledDNDEnabled && ( | 580 | {scheduledDNDEnabled && ( |
577 | <> | 581 | <> |
@@ -632,12 +636,12 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
632 | {intl.formatMessage(messages.sectionServiceIconsSettings)} | 636 | {intl.formatMessage(messages.sectionServiceIconsSettings)} |
633 | </H2> | 637 | </H2> |
634 | 638 | ||
635 | <Toggle field={form.$('showDisabledServices')} /> | 639 | <Toggle {...form.$('showDisabledServices').bind()} /> |
636 | <Toggle field={form.$('showServiceName')} /> | 640 | <Toggle {...form.$('showServiceName').bind()} /> |
637 | 641 | ||
638 | {isUseGrayscaleServicesEnabled && <Hr />} | 642 | {isUseGrayscaleServicesEnabled && <Hr />} |
639 | 643 | ||
640 | <Toggle field={form.$('useGrayscaleServices')} /> | 644 | <Toggle {...form.$('useGrayscaleServices').bind()} /> |
641 | 645 | ||
642 | {isUseGrayscaleServicesEnabled && ( | 646 | {isUseGrayscaleServicesEnabled && ( |
643 | <> | 647 | <> |
@@ -650,8 +654,8 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
650 | </> | 654 | </> |
651 | )} | 655 | )} |
652 | 656 | ||
653 | <Toggle field={form.$('showMessageBadgeWhenMuted')} /> | 657 | <Toggle {...form.$('showMessageBadgeWhenMuted').bind()} /> |
654 | <Toggle field={form.$('enableLongPressServiceHint')} /> | 658 | <Toggle {...form.$('enableLongPressServiceHint').bind()} /> |
655 | <Select field={form.$('iconSize')} /> | 659 | <Select field={form.$('iconSize')} /> |
656 | 660 | ||
657 | <Select field={form.$('navigationBarBehaviour')} /> | 661 | <Select field={form.$('navigationBarBehaviour')} /> |
@@ -662,7 +666,7 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
662 | {intl.formatMessage(messages.sectionHibernation)} | 666 | {intl.formatMessage(messages.sectionHibernation)} |
663 | </H2> | 667 | </H2> |
664 | <Select field={form.$('hibernationStrategy')} /> | 668 | <Select field={form.$('hibernationStrategy')} /> |
665 | <Toggle field={form.$('hibernateOnStartup')} /> | 669 | <Toggle {...form.$('hibernateOnStartup').bind()} /> |
666 | <p | 670 | <p |
667 | className="settings__message" | 671 | className="settings__message" |
668 | style={{ | 672 | style={{ |
@@ -677,7 +681,7 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
677 | 681 | ||
678 | <Select field={form.$('wakeUpStrategy')} /> | 682 | <Select field={form.$('wakeUpStrategy')} /> |
679 | <Select field={form.$('wakeUpHibernationStrategy')} /> | 683 | <Select field={form.$('wakeUpHibernationStrategy')} /> |
680 | <Toggle field={form.$('wakeUpHibernationSplay')} /> | 684 | <Toggle {...form.$('wakeUpHibernationSplay').bind()} /> |
681 | </div> | 685 | </div> |
682 | )} | 686 | )} |
683 | 687 | ||
@@ -687,15 +691,15 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
687 | <H2 className="settings__section_header"> | 691 | <H2 className="settings__section_header"> |
688 | {intl.formatMessage(messages.sectionGeneralUi)} | 692 | {intl.formatMessage(messages.sectionGeneralUi)} |
689 | </H2> | 693 | </H2> |
690 | {isMac && <Toggle field={form.$('showDragArea')} />} | 694 | {isMac && <Toggle {...form.$('showDragArea').bind()} />} |
691 | 695 | ||
692 | <Toggle field={form.$('adaptableDarkMode')} /> | 696 | <Toggle {...form.$('adaptableDarkMode').bind()} /> |
693 | {!isAdaptableDarkModeEnabled && ( | 697 | {!isAdaptableDarkModeEnabled && ( |
694 | <Toggle field={form.$('darkMode')} /> | 698 | <Toggle {...form.$('darkMode').bind()} /> |
695 | )} | 699 | )} |
696 | {(isDarkmodeEnabled || isAdaptableDarkModeEnabled) && ( | 700 | {(isDarkmodeEnabled || isAdaptableDarkModeEnabled) && ( |
697 | <> | 701 | <> |
698 | <Toggle field={form.$('universalDarkMode')} /> | 702 | <Toggle {...form.$('universalDarkMode').bind()} /> |
699 | <p | 703 | <p |
700 | className="settings__message" | 704 | className="settings__message" |
701 | style={{ | 705 | style={{ |
@@ -713,7 +717,7 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
713 | )} | 717 | )} |
714 | 718 | ||
715 | {isSplitModeEnabled && <Hr />} | 719 | {isSplitModeEnabled && <Hr />} |
716 | <Toggle field={form.$('splitMode')} /> | 720 | <Toggle {...form.$('splitMode').bind()} /> |
717 | {isSplitModeEnabled && ( | 721 | {isSplitModeEnabled && ( |
718 | <Input | 722 | <Input |
719 | type="number" | 723 | type="number" |
@@ -776,21 +780,21 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
776 | 780 | ||
777 | <Select field={form.$('sidebarServicesLocation')} /> | 781 | <Select field={form.$('sidebarServicesLocation')} /> |
778 | 782 | ||
779 | <Toggle field={form.$('useHorizontalStyle')} /> | 783 | <Toggle {...form.$('useHorizontalStyle').bind()} /> |
780 | 784 | ||
781 | <Toggle field={form.$('hideCollapseButton')} /> | 785 | <Toggle {...form.$('hideCollapseButton').bind()} /> |
782 | 786 | ||
783 | <Toggle field={form.$('hideRecipesButton')} /> | 787 | <Toggle {...form.$('hideRecipesButton').bind()} /> |
784 | 788 | ||
785 | <Toggle field={form.$('hideSplitModeButton')} /> | 789 | <Toggle {...form.$('hideSplitModeButton').bind()} /> |
786 | 790 | ||
787 | <Toggle field={form.$('hideWorkspacesButton')} /> | 791 | <Toggle {...form.$('hideWorkspacesButton').bind()} /> |
788 | 792 | ||
789 | <Toggle field={form.$('hideNotificationsButton')} /> | 793 | <Toggle {...form.$('hideNotificationsButton').bind()} /> |
790 | 794 | ||
791 | <Toggle field={form.$('hideSettingsButton')} /> | 795 | <Toggle {...form.$('hideSettingsButton').bind()} /> |
792 | 796 | ||
793 | <Toggle field={form.$('alwaysShowWorkspaces')} /> | 797 | <Toggle {...form.$('alwaysShowWorkspaces').bind()} /> |
794 | </div> | 798 | </div> |
795 | )} | 799 | )} |
796 | 800 | ||
@@ -801,17 +805,17 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
801 | {intl.formatMessage(messages.sectionPrivacy)} | 805 | {intl.formatMessage(messages.sectionPrivacy)} |
802 | </H2> | 806 | </H2> |
803 | 807 | ||
804 | <Toggle field={form.$('privateNotifications')} /> | 808 | <Toggle {...form.$('privateNotifications').bind()} /> |
805 | <Toggle field={form.$('clipboardNotifications')} /> | 809 | <Toggle {...form.$('clipboardNotifications').bind()} /> |
806 | {(isWindows || isMac) && ( | 810 | {(isWindows || isMac) && ( |
807 | <Toggle field={form.$('notifyTaskBarOnMessage')} /> | 811 | <Toggle {...form.$('notifyTaskBarOnMessage').bind()} /> |
808 | )} | 812 | )} |
809 | 813 | ||
810 | <Hr /> | 814 | <Hr /> |
811 | 815 | ||
812 | <Select field={form.$('webRTCIPHandlingPolicy')} /> | 816 | <Select field={form.$('webRTCIPHandlingPolicy')} /> |
813 | 817 | ||
814 | <Toggle field={form.$('sentry')} /> | 818 | <Toggle {...form.$('sentry').bind()} /> |
815 | <p className="settings__help"> | 819 | <p className="settings__help"> |
816 | {intl.formatMessage(messages.sentryInfo)} | 820 | {intl.formatMessage(messages.sentryInfo)} |
817 | </p> | 821 | </p> |
@@ -830,11 +834,11 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
830 | 834 | ||
831 | <Hr /> | 835 | <Hr /> |
832 | 836 | ||
833 | <Toggle field={form.$('lockingFeatureEnabled')} /> | 837 | <Toggle {...form.$('lockingFeatureEnabled').bind()} /> |
834 | {lockingFeatureEnabled && ( | 838 | {lockingFeatureEnabled && ( |
835 | <> | 839 | <> |
836 | {isMac && systemPreferences.canPromptTouchID() && ( | 840 | {isMac && systemPreferences.canPromptTouchID() && ( |
837 | <Toggle field={form.$('useTouchIdToUnlock')} /> | 841 | <Toggle {...form.$('useTouchIdToUnlock').bind()} /> |
838 | )} | 842 | )} |
839 | 843 | ||
840 | <Input | 844 | <Input |
@@ -885,7 +889,7 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
885 | 889 | ||
886 | <Hr /> | 890 | <Hr /> |
887 | 891 | ||
888 | <Toggle field={form.$('enableSpellchecking')} /> | 892 | <Toggle {...form.$('enableSpellchecking').bind()} /> |
889 | {!isMac && form.$('enableSpellchecking').value && ( | 893 | {!isMac && form.$('enableSpellchecking').value && ( |
890 | <Select field={form.$('spellcheckerLanguage')} /> | 894 | <Select field={form.$('spellcheckerLanguage')} /> |
891 | )} | 895 | )} |
@@ -901,7 +905,7 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
901 | 905 | ||
902 | <Hr /> | 906 | <Hr /> |
903 | 907 | ||
904 | <Toggle field={form.$('enableTranslator')} /> | 908 | <Toggle {...form.$('enableTranslator').bind()} /> |
905 | 909 | ||
906 | {form.$('enableTranslator').value && ( | 910 | {form.$('enableTranslator').value && ( |
907 | <Select field={form.$('translatorEngine')} /> | 911 | <Select field={form.$('translatorEngine')} /> |
@@ -931,8 +935,8 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
931 | {intl.formatMessage(messages.sectionAdvanced)} | 935 | {intl.formatMessage(messages.sectionAdvanced)} |
932 | </H2> | 936 | </H2> |
933 | 937 | ||
934 | <Toggle field={form.$('enableGPUAcceleration')} /> | 938 | <Toggle {...form.$('enableGPUAcceleration').bind()} /> |
935 | <Toggle field={form.$('enableGlobalHideShortcut')} /> | 939 | <Toggle {...form.$('enableGlobalHideShortcut').bind()} /> |
936 | <p className="settings__help indented__help"> | 940 | <p className="settings__help indented__help"> |
937 | {intl.formatMessage(messages.appRestartRequired)} | 941 | {intl.formatMessage(messages.appRestartRequired)} |
938 | </p> | 942 | </p> |
@@ -1036,12 +1040,12 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
1036 | {intl.formatMessage(messages.sectionUpdates)} | 1040 | {intl.formatMessage(messages.sectionUpdates)} |
1037 | </H2> | 1041 | </H2> |
1038 | 1042 | ||
1039 | <Toggle field={form.$('automaticUpdates')} /> | 1043 | <Toggle {...form.$('automaticUpdates').bind()} /> |
1040 | {automaticUpdates && ( | 1044 | {automaticUpdates && ( |
1041 | <> | 1045 | <> |
1042 | <> | 1046 | <> |
1043 | <div> | 1047 | <div> |
1044 | <Toggle field={form.$('beta')} /> | 1048 | <Toggle {...form.$('beta').bind()} /> |
1045 | {updateIsReadyToInstall ? ( | 1049 | {updateIsReadyToInstall ? ( |
1046 | <Button | 1050 | <Button |
1047 | label={intl.formatMessage( | 1051 | label={intl.formatMessage( |