Skip to content

Commit 5a1edb7

Browse files
committed
folder structure
1 parent 2432f2c commit 5a1edb7

File tree

15 files changed

+69
-50
lines changed

15 files changed

+69
-50
lines changed

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,8 @@
2828
"*.{css,sass,scss}.d.ts": true
2929
},
3030
"editor.formatOnSave": true,
31-
"editor.defaultFormatter": "esbenp.prettier-vscode"
31+
"editor.defaultFormatter": "esbenp.prettier-vscode",
32+
"[typescript]": {
33+
"editor.defaultFormatter": "esbenp.prettier-vscode"
34+
}
3235
}

src/renderer/App.tsx

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,12 @@
1-
import { Container } from '@chakra-ui/react';
2-
import { useState } from 'react';
3-
41
import { MemoryRouter as Router, Routes, Route } from 'react-router-dom';
52
import './App.css';
6-
import List from './components/List';
7-
import Searchbar from './components/Searchbar';
8-
import SearchEngineModal from './components/Settings/SearchEngineModal';
9-
import { SearchContextProvider } from './context/SearchContext';
10-
import { TabContextProvider } from './context/TabContext';
11-
import ShortcutKeys from './hooks/shortcut/ShortcutKeys';
12-
import useHotkeys from './hooks/shortcut/useHotkeys';
13-
14-
const Hello = () => {
15-
//Shorcut: Window Move
16-
useHotkeys(`${ShortcutKeys.CTRL}+${ShortcutKeys.LeftArrow}`, () => {
17-
window.electron.ipcRenderer.sendMessage('window-move', 'topLeft');
18-
});
19-
20-
useHotkeys(`${ShortcutKeys.CTRL}+${ShortcutKeys.RightArrow}`, () => {
21-
window.electron.ipcRenderer.sendMessage('window-move', 'topRight');
22-
});
23-
24-
return (
25-
<div id="container">
26-
<SearchContextProvider>
27-
<Container centerContent paddingTop="10px">
28-
<TabContextProvider>
29-
<Searchbar />
30-
<List />
31-
<SearchEngineModal />
32-
</TabContextProvider>
33-
</Container>
34-
</SearchContextProvider>
35-
</div>
36-
);
37-
};
3+
import { BrowserPage } from './views/Browser';
384

395
export default function App() {
406
return (
417
<Router>
428
<Routes>
43-
<Route path="/" element={<Hello />} />
9+
<Route path="/" element={<BrowserPage />} />
4410
</Routes>
4511
</Router>
4612
);

src/renderer/components/BrowserCollapse.tsx renamed to src/renderer/components/BrowserCollapse/BrowserCollapse.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import { FindInPageContext } from 'renderer/context/FindInPageContext';
1414
import { TabContext } from 'renderer/context/TabContext';
1515
import ShortcutKeys from 'renderer/hooks/shortcut/ShortcutKeys';
1616
import useHotkeys from 'renderer/hooks/shortcut/useHotkeys';
17-
import { SearchContext } from '../context/SearchContext';
18-
import FindInPage from './FindInPage/FindInPage';
19-
import Webview from './Webview';
17+
import { SearchContext } from '../../context/SearchContext';
18+
import FindInPage from '../FindInPage/FindInPage';
19+
import Webview from '../Webview/Webview';
2020

2121
type BrowserCollapseTypes = {
2222
name: string;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import BrowserCollapse from "./BrowserCollapse";
2+
export {BrowserCollapse};

src/renderer/components/FindInPage/FindInPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { AiOutlineClose, AiOutlineLeft, AiOutlineRight } from 'react-icons/ai';
2525
import { FindInPageContext } from 'renderer/context/FindInPageContext';
2626
import { TabContext } from 'renderer/context/TabContext';
2727
import useWebviewReady from 'renderer/hooks/webview/useWebviewReady';
28-
import { WebViewOverride } from '../BrowserCollapse';
28+
import { WebViewOverride } from '../BrowserCollapse/BrowserCollapse';
2929

3030
type FindInPageProps = {
3131
children: ReactNode;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import FindInPage from './FindInPage';
2+
export { FindInPage };

src/renderer/components/Searchbar.tsx renamed to src/renderer/components/Searchbar/Searchbar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import { useCallback, useContext, useEffect, useState } from 'react';
1111
import { FcGoogle } from 'react-icons/fc';
1212
import { SiDuckduckgo } from 'react-icons/si';
1313
import { FaYandexInternational } from 'react-icons/fa';
14-
import '../App.css';
15-
import { SearchContext } from '../context/SearchContext';
16-
import { TabContext } from '../context/TabContext';
14+
import '../../App.css';
15+
import { SearchContext } from '../../context/SearchContext';
16+
import { TabContext } from '../../context/TabContext';
1717

1818
const Searchbar = () => {
1919
const { onChange, search, searchEngine } = useContext(SearchContext);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Searchbar from './Searchbar';
2+
export { Searchbar };
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import SearchEngineModal from './SearchEngineModal';
2+
export { SearchEngineModal };

src/renderer/components/List.tsx renamed to src/renderer/components/TabList/TabList.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { useContext } from 'react';
33
import { FindInPageProvider } from 'renderer/context/FindInPageContext';
44
import ShortcutKeys from 'renderer/hooks/shortcut/ShortcutKeys';
55
import useHotkeys from 'renderer/hooks/shortcut/useHotkeys';
6-
import { SearchContext } from '../context/SearchContext';
7-
import { TabContext } from '../context/TabContext';
8-
import BrowserCollapse from './BrowserCollapse';
9-
import FindInPage from './FindInPage/FindInPage';
6+
import { SearchContext } from '../../context/SearchContext';
7+
import { TabContext } from '../../context/TabContext';
8+
import BrowserCollapse from '../BrowserCollapse/BrowserCollapse';
9+
import FindInPage from '../FindInPage/FindInPage';
1010

11-
const List = () => {
11+
const TabList = () => {
1212
const { tabs, setTabs } = useContext(SearchContext);
1313

1414
const { currentTabIndex, setTabIndex } = useContext(TabContext);
@@ -66,4 +66,4 @@ const List = () => {
6666
);
6767
};
6868

69-
export default List;
69+
export default TabList;

0 commit comments

Comments
 (0)