From 5ccc094ad15176f1812f2c815921fae44d9bed41 Mon Sep 17 00:00:00 2001 From: Tagaishi Date: Thu, 24 Aug 2023 00:21:02 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90=20Search=20engine=20custom=20butto?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../locales/en/settings/general/search-engine.json | 1 + .../Common/SearchEngine/SearchEngineSelector.tsx | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/public/locales/en/settings/general/search-engine.json b/public/locales/en/settings/general/search-engine.json index a7a40fc83..13acf8694 100644 --- a/public/locales/en/settings/general/search-engine.json +++ b/public/locales/en/settings/general/search-engine.json @@ -1,6 +1,7 @@ { "title": "Search engine", "configurationName": "Search engine configuration", + "custom": "Custom", "tips": { "generalTip": "There are multiple prefixes you can use! Adding these in front of your query will filter the results. !s (Web), !t (Torrents), !y (YouTube), and !m (Media).", "placeholderTip": "%s can be used as a placeholder for the query." diff --git a/src/components/Settings/Common/SearchEngine/SearchEngineSelector.tsx b/src/components/Settings/Common/SearchEngine/SearchEngineSelector.tsx index eb0fa634d..54270f0b2 100644 --- a/src/components/Settings/Common/SearchEngine/SearchEngineSelector.tsx +++ b/src/components/Settings/Common/SearchEngine/SearchEngineSelector.tsx @@ -35,6 +35,13 @@ export const SearchEngineSelector = ({ searchEngine }: Props) => { updateSearchEngineConfig(engine, url); }; + const searchEngineOptions: { label: string; value: EngineType }[] = [ + { label: 'Google', value: 'google' }, + { label: 'DuckDuckGo', value: 'duckDuckGo' }, + { label: 'Bing', value: 'bing' }, + { label: t('custom'), value: 'custom' }, + ]; + return ( @@ -77,13 +84,6 @@ export const SearchEngineSelector = ({ searchEngine }: Props) => { ); }; -const searchEngineOptions: { label: string; value: EngineType }[] = [ - { label: 'Google', value: 'google' }, - { label: 'DuckDuckGo', value: 'duckDuckGo' }, - { label: 'Bing', value: 'bing' }, - { label: 'Custom', value: 'custom' }, -]; - export const searchUrls: { [key in CommonSearchEngineCommonSettingsType['type']]: string } = { google: 'https://google.com/search?q=', duckDuckGo: 'https://duckduckgo.com/?q=',