basic routing

This commit is contained in:
caranicas 2022-09-15 16:25:02 -04:00
parent 0e5b01f897
commit b8823ade29
5 changed files with 52 additions and 10 deletions

View File

@ -0,0 +1,30 @@
import {
Link,
MakeGenerics,
Outlet,
ReactLocation,
Router,
useMatch,
} from "@tanstack/react-location";
import Home from "./components/layouts/Home";
import Settings from "./components/layouts/Settings";
const location = new ReactLocation();
function App() {
return (
<Router
location={location}
routes={[
{path: "/", element: <Home />},
{path: "settings", element: <Settings />},
]}
>
</Router>
);
}
export default App;

View File

@ -6,19 +6,19 @@ import {
CreateLayout,
DisplayLayout,
FooterLayout, // @ts-ignore
} from "./app.css.ts";
} from "./home.css.ts";
import { useQuery } from "@tanstack/react-query";
import { getSaveDirectory } from "../../api";
import { useImageCreate } from "../../store/imageCreateStore";
import { getSaveDirectory } from "../../../api";
import { useImageCreate } from "../../../store/imageCreateStore";
// Todo - import components here
import HeaderDisplay from "../organisms/headerDisplay";
import CreationPanel from "../organisms/creationPanel";
import DisplayPanel from "../organisms/displayPanel";
import FooterDisplay from "../organisms/footerDisplay";
import HeaderDisplay from "../../organisms/headerDisplay";
import CreationPanel from "../../organisms/creationPanel";
import DisplayPanel from "../../organisms/displayPanel";
import FooterDisplay from "../../organisms/footerDisplay";
function App() {
function Editor() {
// Get the original save directory
const setRequestOption = useImageCreate((state) => state.setRequestOptions);
const { status, data } = useQuery(["SaveDir"], getSaveDirectory);
@ -46,4 +46,4 @@ function App() {
);
}
export default App;
export default Editor;

View File

@ -0,0 +1,9 @@
import React from "react";
export default function Settings() {
return (
<div>
<h1>Settings</h1>
</div>
);
}

View File

@ -6,7 +6,10 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { enableMapSet } from "immer";
import App from "./components/layouts/App";
import Editor from "./components/layouts/Home";
import App from "./App";
import "./styles.css.ts";