diff --git a/src/components/TilingItem.tsx b/src/components/TilingItem.tsx new file mode 100644 index 0000000..bde20bd --- /dev/null +++ b/src/components/TilingItem.tsx @@ -0,0 +1,21 @@ +import * as React from "react"; + +interface Props { + titlebarName: str; + children: React.ReactNode; +} + +export default function Navbar({ children, titlebarName }: Props) { + return ( + <> +
+ {titlebarName ? ( +
+

{titlebarName}

+
+ ) : null} + {children} +
+ + ); +} diff --git a/src/pages/Blog.tsx b/src/pages/Blog.tsx new file mode 100644 index 0000000..14fa383 --- /dev/null +++ b/src/pages/Blog.tsx @@ -0,0 +1,39 @@ +import * as React from "react"; + +import BlogEntryCard from "./../components/BlogEntryCard.tsx"; + +export default function Home() { + // A mock of what the data from the getBlogEntries JSON return would look like + const blogEntries = [ + { + blogImage: + "https://git.cspark.dev/avatars/1c230bfe7494b1a62932d94ed8558dc61189437b1b6e0cecdb0c45c3d899bea4?size=512", + blogTitle: "Test Blog Entry 1", + blogDatePosted: "12/04/2024 4PM", // In reality this would probably be an actual correct format/standardised timestamp + blogDescription: "This is a first blog entry test", // If no description, we'd want to get a small snippet of the intro of the blog + }, + { + blogImage: + "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png", + blogTitle: "Test Blog Entry 2", + blogDatePosted: "8/04/2024 6PM", // In reality this would probably be an actual correct format/standardised timestamp + blogDescription: "This is a test blog entry number 2", // If no description, we'd want to get a small snippet of the intro of the blog + }, + ]; + + return ( + <> +
+ {blogEntries.map((item, index) => ( + + ))} +
+ + ); +} diff --git a/src/pages/BlogEditor.tsx b/src/pages/BlogEditor.tsx new file mode 100644 index 0000000..a223706 --- /dev/null +++ b/src/pages/BlogEditor.tsx @@ -0,0 +1,22 @@ +import * as React from "react"; +import { Navigate } from "react-router-dom"; +import { authTokenStorageHandlerInit } from "../components/storageHandler.ts"; + +import TilingItem from "../components/TilingItem.tsx"; + +export default function Home() { + const authTokenStorageHandler = authTokenStorageHandlerInit(); + + if (!authTokenStorageHandler.authTokenValue) { + return ; + } + + return ( + <> +
+ + +
+ + ); +} diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx new file mode 100644 index 0000000..bbe17e5 --- /dev/null +++ b/src/pages/Settings.tsx @@ -0,0 +1,21 @@ +import * as React from "react"; +import { Navigate } from "react-router-dom"; +import { authTokenStorageHandlerInit } from "../components/storageHandler.ts"; + +import TilingItem from "../components/TilingItem.tsx"; + +export default function Home() { + const authTokenStorageHandler = authTokenStorageHandlerInit(); + + if (!authTokenStorageHandler.authTokenValue) { + return ; + } + + return ( + <> +
+ +
+ + ); +}