Skip to content

Commit c4bbcf8

Browse files
authored
Merge pull request #200 from medyo/develop
Fix custom search engine feature
2 parents de7b76d + 9d5b39d commit c4bbcf8

File tree

14 files changed

+3
-67
lines changed

14 files changed

+3
-67
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/components/Elements/SearchBar/SearchBar.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ export const SearchBar = () => {
3131
) : (
3232
<img
3333
className={'searchBarIcon'}
34-
src={`src/assets/${usedSearchEngine.label.toLowerCase()}_logo.svg`}
35-
onError={({ currentTarget }) => {
36-
currentTarget.onerror = null
37-
currentTarget.src = `src/assets/search_logo.svg`
38-
}}
34+
src={`/searchengine_logos/${usedSearchEngine.label.toLowerCase()}_logo.svg`}
3935
/>
4036
)}
4137
<input

src/components/Elements/SearchBarWithLogo/SearchBarWithLogo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const SearchBarWithLogo = () => {
1919
) : (
2020
<img
2121
className={'searchEngineLogo ' + userSearchEngine.className}
22-
src={`src/assets/${userSearchEngine.label.toLowerCase()}_logo.svg`}
22+
src={`/searchengine_logos/${userSearchEngine.label.toLowerCase()}_logo.svg`}
2323
/>
2424
)}
2525

src/config/index.tsx

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
import { ReactComponent as BaiduLogo } from 'src/assets/baidu_logo.svg'
2-
import { ReactComponent as BingLogo } from 'src/assets/bing_logo.svg'
3-
import { ReactComponent as DuckDuckGoLogo } from 'src/assets/duckduckgo_logo.svg'
4-
import { ReactComponent as GoogleLogo } from 'src/assets/google_logo.svg'
5-
import { ReactComponent as PhindLogo } from 'src/assets/phind_logo.svg'
6-
import { ReactComponent as StartPageLogo } from 'src/assets/startpage_logo.svg'
7-
import { ReactComponent as YahooLogo } from 'src/assets/yahoo_logo.svg'
8-
import { ReactComponent as YandexLogo } from 'src/assets/yandex_logo.svg'
9-
import { ReactComponent as KagiLogo} from 'src/assets/kagi_logo.svg'
10-
111
// Keys
122
export const ANALYTICS_ENDPOINT = import.meta.env.VITE_AMPLITUDE_URL as string
133
export const ANALYTICS_SDK_KEY = import.meta.env.VITE_AMPLITUDE_KEY as string
@@ -27,56 +17,6 @@ export const dataSourcesLink = 'https://www.hackertab.dev/data-sources'
2717
export const changeLogLink = 'https://api.github.com/repos/medyo/hackertab.dev/releases'
2818
export const twitterHandle = '@hackertabdev'
2919
export const reportLink = 'https://www.hackertab.dev/report'
30-
// Cfgs
31-
export const SUPPORTED_SEARCH_ENGINES = [
32-
{
33-
label: 'Google',
34-
url: 'https://google.com/search?q=',
35-
logo: GoogleLogo,
36-
},
37-
{
38-
label: 'DuckDuckGo',
39-
url: 'https://duckduckgo.com?q=',
40-
logo: DuckDuckGoLogo,
41-
},
42-
{
43-
label: 'Bing',
44-
url: 'https://bing.com/search?q=',
45-
logo: BingLogo,
46-
},
47-
{
48-
label: 'Yahoo',
49-
url: 'https://search.yahoo.com/search?p=',
50-
logo: YahooLogo,
51-
},
52-
{
53-
label: 'Baidu',
54-
url: 'https://baidu.com/s?wd=',
55-
logo: BaiduLogo,
56-
},
57-
{
58-
label: 'Yandex',
59-
url: 'https://yandex.ru/search/?text=',
60-
logo: YandexLogo,
61-
className: 'themeAdaptiveFillColor',
62-
},
63-
{
64-
label: 'Startpage',
65-
url: 'https://www.startpage.com/sp/search?query=',
66-
logo: StartPageLogo,
67-
},
68-
{
69-
label: 'Phind',
70-
url: 'https://phind.com/search?q=',
71-
logo: PhindLogo,
72-
className: 'themeAdaptiveFillColor',
73-
},
74-
{
75-
label: 'Kagi',
76-
url: 'https://kagi.com/search?q=',
77-
logo: KagiLogo,
78-
},
79-
]
8020

8121
export const LS_PREFERENCES_KEY = 'hackerTabPrefs'
8222
export const GLOBAL_TAG = {

src/features/settings/components/SearchEngineSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const SearchEngineSettings = () => {
2929
) : (
3030
<img
3131
className="lang_icon"
32-
src={`src/assets/${engine.label.toLowerCase()}_logo.svg`}
32+
src={`/searchengine_logos/${engine.label.toLowerCase()}_logo.svg`}
3333
/>
3434
),
3535
}

0 commit comments

Comments
 (0)