diff options
author | 2021-05-15 18:34:25 +0530 | |
---|---|---|
committer | 2021-05-15 15:04:25 +0200 | |
commit | 8ef5380b941a8f1483ee5d30e61a5086e669b12e (patch) | |
tree | 8e4db26f558722622738c17c21f97187cdb23ea0 /src/containers/settings/EditSettingsScreen.js | |
parent | Minor refactoring to have consistent command-line invocations. (diff) | |
download | ferdium-app-8ef5380b941a8f1483ee5d30e61a5086e669b12e.tar.gz ferdium-app-8ef5380b941a8f1483ee5d30e61a5086e669b12e.tar.zst ferdium-app-8ef5380b941a8f1483ee5d30e61a5086e669b12e.zip |
Adding DuckDuckGo as an alternative search engine (#1414)
* Adding DuckDuckGo as an alternative search engine.
* Fixing review comments.
* Fixing review comments.
Diffstat (limited to 'src/containers/settings/EditSettingsScreen.js')
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 49ef03664..831732940 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -10,7 +10,7 @@ import TodosStore from '../../features/todos/store'; | |||
10 | import Form from '../../lib/Form'; | 10 | import Form from '../../lib/Form'; |
11 | import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; | 11 | import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; |
12 | import { | 12 | import { |
13 | DEFAULT_APP_SETTINGS, HIBERNATION_STRATEGIES, SIDEBAR_WIDTH, ICON_SIZES, NAVIGATION_BAR_BEHAVIOURS, TODO_APPS, | 13 | DEFAULT_APP_SETTINGS, HIBERNATION_STRATEGIES, SIDEBAR_WIDTH, ICON_SIZES, NAVIGATION_BAR_BEHAVIOURS, SEARCH_ENGINE_NAMES, TODO_APPS, |
14 | } from '../../config'; | 14 | } from '../../config'; |
15 | import { config as spellcheckerConfig } from '../../features/spellchecker'; | 15 | import { config as spellcheckerConfig } from '../../features/spellchecker'; |
16 | 16 | ||
@@ -71,6 +71,10 @@ const messages = defineMessages({ | |||
71 | id: 'settings.app.form.navigationBarBehaviour', | 71 | id: 'settings.app.form.navigationBarBehaviour', |
72 | defaultMessage: '!!!Navigation bar behaviour', | 72 | defaultMessage: '!!!Navigation bar behaviour', |
73 | }, | 73 | }, |
74 | searchEngine: { | ||
75 | id: 'settings.app.form.searchEngine', | ||
76 | defaultMessage: '!!!Search engine', | ||
77 | }, | ||
74 | sentry: { | 78 | sentry: { |
75 | id: 'settings.app.form.sentry', | 79 | id: 'settings.app.form.sentry', |
76 | defaultMessage: '!!!Send telemetry data', | 80 | defaultMessage: '!!!Send telemetry data', |
@@ -241,6 +245,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
241 | privateNotifications: settingsData.privateNotifications, | 245 | privateNotifications: settingsData.privateNotifications, |
242 | notifyTaskBarOnMessage: settingsData.notifyTaskBarOnMessage, | 246 | notifyTaskBarOnMessage: settingsData.notifyTaskBarOnMessage, |
243 | navigationBarBehaviour: settingsData.navigationBarBehaviour, | 247 | navigationBarBehaviour: settingsData.navigationBarBehaviour, |
248 | searchEngine: settingsData.searchEngine, | ||
244 | sentry: settingsData.sentry, | 249 | sentry: settingsData.sentry, |
245 | hibernate: settingsData.hibernate, | 250 | hibernate: settingsData.hibernate, |
246 | hibernateOnStartup: settingsData.hibernateOnStartup, | 251 | hibernateOnStartup: settingsData.hibernateOnStartup, |
@@ -313,6 +318,11 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
313 | sort: false, | 318 | sort: false, |
314 | }); | 319 | }); |
315 | 320 | ||
321 | const searchEngines = getSelectOptions({ | ||
322 | locales: SEARCH_ENGINE_NAMES, | ||
323 | sort: false, | ||
324 | }); | ||
325 | |||
316 | const hibernationStrategies = getSelectOptions({ | 326 | const hibernationStrategies = getSelectOptions({ |
317 | locales: HIBERNATION_STRATEGIES, | 327 | locales: HIBERNATION_STRATEGIES, |
318 | sort: false, | 328 | sort: false, |
@@ -396,6 +406,12 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
396 | default: DEFAULT_APP_SETTINGS.navigationBarBehaviour, | 406 | default: DEFAULT_APP_SETTINGS.navigationBarBehaviour, |
397 | options: navigationBarBehaviours, | 407 | options: navigationBarBehaviours, |
398 | }, | 408 | }, |
409 | searchEngine: { | ||
410 | label: intl.formatMessage(messages.searchEngine), | ||
411 | value: settings.all.app.searchEngine, | ||
412 | default: DEFAULT_APP_SETTINGS.searchEngine, | ||
413 | options: searchEngines, | ||
414 | }, | ||
399 | sentry: { | 415 | sentry: { |
400 | label: intl.formatMessage(messages.sentry), | 416 | label: intl.formatMessage(messages.sentry), |
401 | value: settings.all.app.sentry, | 417 | value: settings.all.app.sentry, |