Skip to content

Commit 5c2c4a1

Browse files
committed
bug fix
1 parent 79d183e commit 5c2c4a1

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"postinstall": "ts-node .erb/scripts/check-native-dep.js && electron-builder install-app-deps && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts",
1414
"lint": "cross-env NODE_ENV=development eslint . --ext .js,.jsx,.ts,.tsx",
1515
"package": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish never",
16+
"package:win": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish never --win",
17+
"package:linux": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish never --linux",
1618
"prepare": "husky install",
1719
"rebuild": "electron-rebuild --parallel --types prod,dev,optional --module-dir release/app",
1820
"start": "ts-node ./.erb/scripts/check-port-in-use.js && npm run start:renderer",

src/renderer/components/Searchbar.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
import {useCallback, useContext, useEffect,useState} from 'react';
1212
import { SearchContext } from 'renderer/context/SearchContext';
1313
import {FcGoogle} from 'react-icons/fc';
14+
import {SiDuckduckgo} from 'react-icons/si';
15+
import {FaYandexInternational} from 'react-icons/fa';
1416
import '../App.css';
1517
import SearchEngineModal from './Settings/SearchEngineModal';
1618

@@ -26,7 +28,8 @@ const Searchbar = ({}) => {
2628
keyword,
2729
setKeyword,
2830
onChange,
29-
search
31+
search,
32+
searchEngine
3033
} = useContext(SearchContext);
3134

3235

@@ -44,12 +47,23 @@ const Searchbar = ({}) => {
4447
}
4548
},[])
4649

50+
const getEngineIcon = () => {
51+
switch(searchEngine){
52+
case "https://www.google.com/search?q=":
53+
return <FcGoogle />
54+
case "https://yandex.com.tr/search/?text=":
55+
return <FaYandexInternational/>
56+
case "https://duckduckgo.com/?q=":
57+
return <SiDuckduckgo />
58+
}
59+
}
60+
4761
return (
4862
<>
4963
<HStack w='95vw' >
5064
<InputGroup size='md' h='40px' id='search-bar-container'
5165
>
52-
<InputLeftAddon h='40px' children={<FcGoogle />} color='white' backgroundColor='#32363e' border='none' onClick={onClose} />
66+
<InputLeftAddon h='40px' children={getEngineIcon()} color='white' backgroundColor='#32363e' border='none' onClick={onClose} />
5367
<Input variant='filled' placeholder='Search' autoFocus
5468
onKeyDown={e => e.key === 'Enter' && search()}
5569
onChange={onChange}

0 commit comments

Comments
 (0)