Skip to content

Commit 2afaf89

Browse files
committed
new: dev: refactored code
new: dev: Added auto socket reconnect new: dev: Added browser notification
1 parent 83579cc commit 2afaf89

25 files changed

+825
-784
lines changed

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
"react-dom": "^18.2.0",
2020
"react-howler": "^5.2.0",
2121
"react-qr-code": "^2.0.11",
22+
"react-redux": "^8.1.2",
2223
"react-scripts": "5.0.1",
2324
"react-socks": "^2.2.0",
25+
"react-use-websocket": "^4.3.1",
2426
"uuid": "^9.0.0",
2527
"web-vitals": "^2.1.4"
2628
},
File renamed without changes.

public/index.html

+18-38
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,23 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="favicon/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="favicon/android-chrome-192x192.png" />
313

4-
<head>
5-
<meta charset="utf-8" />
6-
<link rel="icon" href="favicon/favicon.ico" />
7-
<meta name="viewport" content="width=device-width, initial-scale=1" />
8-
<meta name="theme-color" content="#000000" />
9-
<meta name="description" content="Web site created using create-react-app" />
10-
<link rel="apple-touch-icon" href="favicon/android-chrome-192x192.png" />
11-
<!--
12-
manifest.json provides metadata used when your web app is installed on a
13-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
14-
-->
15-
<link rel="manifest" href="favicon/site.webmanifest" />
16-
<!--
17-
Notice the use of %PUBLIC_URL% in the tags above.
18-
It will be replaced with the URL of the `public` folder during the build.
19-
Only files inside the `public` folder can be referenced from the HTML.
14+
<link rel="manifest" href="favicon/site.webmanifest" />
2015

21-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
22-
work correctly both with client-side routing and a non-root public URL.
23-
Learn how to configure a non-root public URL by running `npm run build`.
24-
-->
25-
<title>Deku Web</title>
26-
</head>
16+
<title>Deku Web</title>
17+
</head>
2718

28-
<body>
29-
<noscript>You need to enable JavaScript to run this app.</noscript>
30-
<div id="root"></div>
31-
<!--
32-
This HTML file is a template.
33-
If you open it directly in the browser, you will see an empty page.
34-
35-
You can add webfonts, meta tags, or analytics to this file.
36-
The build step will place the bundled scripts into the <body> tag.
37-
38-
To begin the development, run `npm start` or `yarn start`.
39-
To create a production bundle, use `npm run build` or `yarn build`.
40-
-->
41-
</body>
42-
43-
</html>
19+
<body>
20+
<noscript>You need to enable JavaScript to run this app.</noscript>
21+
<div id="root"></div>
22+
</body>
23+
</html>

src/App.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
import Messages from "./Messages";
2-
import { SocketProvider } from "./SocketContext";
1+
import { SocketProvider, MainProvider } from "./contexts";
2+
import Layout from "./Layout";
3+
import { ThreadList, ThreadView } from "./components";
34

4-
function App() {
5+
const App = () => {
56
return (
67
<SocketProvider>
7-
<Messages />
8+
<MainProvider>
9+
<Layout>
10+
<ThreadList />
11+
<ThreadView />
12+
</Layout>
13+
</MainProvider>
814
</SocketProvider>
915
);
10-
}
16+
};
1117

1218
export default App;

src/Authenticate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import "./App.css";
33
import { Box, Typography, Grid, List, ListItem, AppBar } from "@mui/material";
44
import QRCode from "react-qr-code";
55
import CssBaseline from "@mui/material/CssBaseline";
6-
import icon from "./Icon.png";
6+
import icon from "./assets/Icon.png";
77
import Switch from "@mui/material/Switch";
88
import { useNavigate } from "react-router-dom";
99

src/Layout.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Box, Grid, Divider } from "@mui/material";
2+
3+
const Layout = ({ children }) => (
4+
<Box sx={{ flexGrow: 1 }}>
5+
<Grid container>
6+
<Grid item xs={3}>
7+
{children[0]}
8+
</Grid>
9+
10+
<Divider flexItem orientation="vertical" sx={{ mr: "-1px" }} />
11+
12+
<Grid item xs={9}>
13+
{children[1]}
14+
</Grid>
15+
</Grid>
16+
</Box>
17+
);
18+
19+
export default Layout;

0 commit comments

Comments
 (0)