+ );
+}
diff --git a/client-solid/src/Primary.tsx b/client-solid/src/Primary.tsx
new file mode 100644
index 0000000..13d0eae
--- /dev/null
+++ b/client-solid/src/Primary.tsx
@@ -0,0 +1,16 @@
+import { Route, Routes } from "@solidjs/router";
+import { Posts } from "./Posts";
+import { SinglePost } from "./SinglePost";
+import { NewPostInputArea } from "./Root";
+
+// Primary is the section of the page that holds the main content
+export function Primary() {
+ return (
+
+ } />
+ } />
+ } />
+ 404} />
+
+ );
+}
diff --git a/client-solid/src/Root.tsx b/client-solid/src/Root.tsx
index 254424a..ef7aaa7 100644
--- a/client-solid/src/Root.tsx
+++ b/client-solid/src/Root.tsx
@@ -1,143 +1,111 @@
-import { createSignal } from "solid-js";
+import { Accessor, Show, createSignal, useContext } from "solid-js";
import { createContext } from "solid-js";
-import { Route, Routes, A } from "@solidjs/router";
+import { createPost } from "./api";
+import { NewPost } from "./api";
+import { Navbar } from "./Navbar";
+import { Primary } from "./Primary";
+import { Login } from "./Navbar";
+import { useNavigate } from "@solidjs/router";
-import { createPost, getPosts } from "./api";
-import { Post, NewPost } from "./api";
+// Representing the state of varoious modals.
+// So far we only have one modal, but we can add more later
+// by adding more fields to this interface, or maybe an enum
+interface ModalContextType {
+ loginModalOpen: Accessor;
+ setLoginModalOpen: (value: boolean) => void;
+}
-export const TestContext = createContext("Test123");
+interface LoginContextType {
+ token: Accessor;
+ setToken: (value: string) => void;
+ username: Accessor;
+ setUsername: (value: string) => void;
+}
+
+// It is unclear to me if this is the idiomatic way to do this in Solid
+export const ModalContext = createContext();
+export const LoginContext = createContext();
function Root() {
+ // All of these are passed into context providers
+ const [loginModalOpen, setLoginModalOpen] = createSignal(false);
+ const [token, setToken] = createSignal("");
+ const [username, setUsername] = createSignal("");
+
+ // This may not be the best place to do this.
+ localStorage.getItem("token") && setToken(localStorage.getItem("token")!);
+ localStorage.getItem("username") &&
+ setUsername(localStorage.getItem("username")!);
+
return (
<>
-
-