Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
Sir-Thom committed Nov 11, 2023
1 parent 7b71b6b commit 6c58ef2
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 185 deletions.
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function App() {

return (
<>
{/*https://react.dev/reference/react-dom/createPortal*/}
{createPortal(<Titlebar/> , document.getElementById("titlebar")!)}
{/*https://react.dev/reference/react-dom/createPortal*/}
{createPortal(<Titlebar />, document.getElementById("titlebar")!)}
<VidPlayer />
</>
);
Expand Down
24 changes: 11 additions & 13 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
// main.tsx
import React from "react";
import { createRoot } from "react-dom/client";
import { BrowserRouter} from "react-router-dom"; // Import BrowserRouter
import { BrowserRouter } from "react-router-dom"; // Import BrowserRouter
import "./styles.css";
import { AnimatePresence } from "framer-motion";
import Router from "./router";



const rootDomNode = document.getElementById('root');
const root = createRoot(rootDomNode);
root.render(
<BrowserRouter basename="/">
<React.StrictMode>
<AnimatePresence
initial={true}
onExitComplete={() => null}
mode={"sync"}
> <Router></Router>
</AnimatePresence>
</React.StrictMode>
</BrowserRouter>
<BrowserRouter basename="/">
<React.StrictMode>
<AnimatePresence
initial={true}
onExitComplete={() => null}
mode={"sync"}
> <Router></Router>
</AnimatePresence>
</React.StrictMode>
</BrowserRouter>
);
8 changes: 4 additions & 4 deletions src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { Route, Routes } from "react-router-dom";

export default function Router() {
return (<Routes>
<Route path="/settings" element={<Settings />} />
<Route path="/server" element={<Server />} />
<Route path="/" element={<App />} />
</Routes>);
<Route path="/settings" element={<Settings />} />
<Route path="/server" element={<Server />} />
<Route path="/" element={<App />} />
</Routes>);
}

7 changes: 3 additions & 4 deletions src/views/Server.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import {useState } from "react";

import { useState } from "react";
import SideMenu from "../components/sideMenu/sideMenu";
import Toast from "../components/toast/Toast";
import RtspServerInfo from "./ServerInfoView/RtspServerInfo";
import { createPortal } from "react-dom";
import Titlebar from "../components/titlebar/titlebar";
import RtmpConnInfo from "./ServerInfoView/RtmpServerInfo";
import HLsConnInfo from "./ServerInfoView/HlsServerInfo";
import Toast from "../components/toast/Toast";
export default function ServerInfo() {
const [error, setError] = useState<string | null>(null);
const [currentSetting, setCurrentSetting] = useState("RTSP"); // Initially show the "API Setting" component
Expand All @@ -25,7 +24,7 @@ export default function ServerInfo() {

return (
<>
{createPortal(<Titlebar/> , document.getElementById("titlebar")!)}
{createPortal(<Titlebar />, document.getElementById("titlebar")!)}
<div className="flex flex-col h-screen">
<div className="flex">
<div className="w-1/4 mx-auto fixed h-full">
Expand Down
Loading

0 comments on commit 6c58ef2

Please sign in to comment.