mirror of
https://github.com/DerTyp7/teamspeak-obs-overlay.git
synced 2025-10-29 04:42:08 +01:00
add router
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ts5-obs-overlay",
|
"name": "ts5-obs-overlay",
|
||||||
"version": "1.3.1",
|
"version": "2.0.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ts5-obs-overlay",
|
"name": "ts5-obs-overlay",
|
||||||
"version": "1.3.1",
|
"version": "2.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "^20.8.3",
|
"@types/node": "^20.8.3",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
|
|||||||
31
src/App.tsx
31
src/App.tsx
@@ -1,6 +1,6 @@
|
|||||||
import "@styles/App.scss";
|
import "@styles/App.scss";
|
||||||
|
|
||||||
import { useSearchParams } from "react-router-dom";
|
import { Route, Routes, useSearchParams } from "react-router-dom";
|
||||||
import useTSRemoteApp, { IClient } from "react-ts5-remote-app-api";
|
import useTSRemoteApp, { IClient } from "react-ts5-remote-app-api";
|
||||||
import Viewer from "./Viewer";
|
import Viewer from "./Viewer";
|
||||||
|
|
||||||
@@ -18,20 +18,25 @@ export default function App() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<Routes>
|
||||||
<Viewer
|
<Route
|
||||||
showChannelName={searchParams.get("showChannelName") === "true"}
|
path="/"
|
||||||
hideNonTalking={searchParams.get("hideNonTalking") === "true"}
|
element={
|
||||||
clientLimit={searchParams.get("clientLimit") ? parseInt(searchParams.get("clientLimit") ?? "0") : 0}
|
<Viewer
|
||||||
clients={
|
showChannelName={searchParams.get("showChannelName") === "true"}
|
||||||
clients.map((client) => {
|
hideNonTalking={searchParams.get("hideNonTalking") === "true"}
|
||||||
if (client.channel?.id === currentChannel?.id && client.channel.connection.id === activeConnectionId) {
|
clientLimit={searchParams.get("clientLimit") ? parseInt(searchParams.get("clientLimit") ?? "0") : 0}
|
||||||
return client;
|
clients={
|
||||||
|
clients.map((client) => {
|
||||||
|
if (client.channel?.id === currentChannel?.id && client.channel.connection.id === activeConnectionId) {
|
||||||
|
return client;
|
||||||
|
}
|
||||||
|
}) as IClient[]
|
||||||
}
|
}
|
||||||
}) as IClient[]
|
channel={currentChannel}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
channel={currentChannel}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</Routes>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import ReactDOM from "react-dom/client";
|
import ReactDOM from "react-dom/client";
|
||||||
import { BrowserRouter } from "react-router-dom";
|
|
||||||
import App from "./App.tsx";
|
import App from "./App.tsx";
|
||||||
import "@styles/index.scss";
|
import "@styles/index.scss";
|
||||||
|
import { BrowserRouter } from "react-router-dom";
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<App />
|
<App />
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
/* Bundler mode */
|
/* Bundler mode */
|
||||||
"moduleResolution": "Node",
|
"moduleResolution": "Node",
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user