mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-16 09:04:45 +01:00
fix: remove libs and use preact-router
This commit is contained in:
@@ -10,13 +10,9 @@
|
|||||||
"tauri": "tauri"
|
"tauri": "tauri"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "npm:@preact/compat",
|
|
||||||
"react-dom": "npm:@preact/compat",
|
|
||||||
"@fluentui/react-components": "^9.41.0",
|
|
||||||
"@tauri-apps/api": "^1.5.1",
|
"@tauri-apps/api": "^1.5.1",
|
||||||
"preact": "^10.16.0",
|
"preact": "^10.16.0",
|
||||||
"react-icons": "^4.12.0",
|
"preact-router": "^4.1.2",
|
||||||
"react-router-dom": "^6.20.0",
|
|
||||||
"zustand": "^4.4.6"
|
"zustand": "^4.4.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
1
src-tauri/.gitignore
vendored
1
src-tauri/.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
# will have compiled files and executables
|
# will have compiled files and executables
|
||||||
/target/
|
/target/
|
||||||
|
|
||||||
|
WixTools/**/*
|
||||||
|
|||||||
11
src/main.tsx
11
src/main.tsx
@@ -1,14 +1,5 @@
|
|||||||
import { render } from "preact";
|
import { render } from "preact";
|
||||||
|
|
||||||
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
||||||
|
|
||||||
import App from "@ui/App";
|
import App from "@ui/App";
|
||||||
|
|
||||||
export const router = createBrowserRouter([
|
render(<App />, document.getElementById("root")!);
|
||||||
{ path: "*", element: <App /> }
|
|
||||||
]);
|
|
||||||
|
|
||||||
render(
|
|
||||||
<RouterProvider router={router} />,
|
|
||||||
document.getElementById("root")!
|
|
||||||
);
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Route, Routes } from "react-router-dom";
|
import { Route, Router } from "preact-router";
|
||||||
|
|
||||||
import TopBar from "@components/TopBar.tsx";
|
import TopBar from "@components/TopBar.tsx";
|
||||||
import Launcher from "@ui/layout/Launcher.tsx";
|
import Launcher from "@ui/layout/Launcher.tsx";
|
||||||
@@ -12,9 +12,9 @@ function App() {
|
|||||||
<div className={"App"}>
|
<div className={"App"}>
|
||||||
<TopBar />
|
<TopBar />
|
||||||
|
|
||||||
<Routes>
|
<Router>
|
||||||
<Route path={PageRoutes.HOME} element={<Launcher />} />
|
<Route path={PageRoutes.HOME} component={Launcher} />
|
||||||
</Routes>
|
</Router>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
import NewsFeed from "@components/NewsFeed.tsx";
|
import NewsFeed from "@components/NewsFeed.tsx";
|
||||||
import InfoBoard from "@components/InfoBoard.tsx";
|
import InfoBoard from "@components/InfoBoard.tsx";
|
||||||
import { Button } from "@fluentui/react-components";
|
|
||||||
|
|
||||||
function Launcher() {
|
interface Props {}
|
||||||
|
|
||||||
|
function Launcher(_props: Props) {
|
||||||
return (
|
return (
|
||||||
<div className={"App_Body"}>
|
<div className={"App_Body"}>
|
||||||
<div>
|
<div>
|
||||||
<NewsFeed />
|
<NewsFeed />
|
||||||
<InfoBoard />
|
<InfoBoard />
|
||||||
|
|
||||||
<Button>
|
|
||||||
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -29,8 +29,6 @@
|
|||||||
"@css/*": ["src/ui/css/*"],
|
"@css/*": ["src/ui/css/*"],
|
||||||
"@components/*": ["src/ui/components/*"],
|
"@components/*": ["src/ui/components/*"],
|
||||||
"@backend/*": ["src/backend/*"],
|
"@backend/*": ["src/backend/*"],
|
||||||
"react": ["./node_modules/preact/compat/"],
|
|
||||||
"react-dom": ["./node_modules/preact/compat/"]
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"],
|
||||||
|
|||||||
Reference in New Issue
Block a user