diff --git a/src/App.tsx b/src/App.tsx index 440d46b..aa44ed7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,6 +4,7 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools" import Home from "@/pages/home" import "./App.css" import Tag from "./templates/Tag" +import Entry from "./templates/Entry" const queryClient = new QueryClient({ defaultOptions: { @@ -21,6 +22,7 @@ export default function App() { } /> + } /> } /> diff --git a/src/components/EntriesListSidebar.tsx b/src/components/EntriesListSidebar.tsx index e59c848..031b154 100644 --- a/src/components/EntriesListSidebar.tsx +++ b/src/components/EntriesListSidebar.tsx @@ -5,6 +5,7 @@ import { CollapsibleContent } from "../components/ui/collapsible" import { Badge } from "./ui/badge" import { useQuery } from "@tanstack/react-query" import api from "../api/eolas-api" +import { Link } from "react-router" export default function EntriesListSidebar() { const { data: entries, isLoading } = useQuery({ @@ -12,6 +13,7 @@ export default function EntriesListSidebar() { queryFn: () => api.get("/entries").then((res) => res.data), }) + console.log(entries) return ( @@ -31,10 +33,12 @@ export default function EntriesListSidebar() {
{entries?.data.map((item, i) => ( - - - {item.title.replace(/_/g, " ")} - + + + + {item.title.replace(/_/g, " ")} + + ))} diff --git a/src/templates/Entry.tsx b/src/templates/Entry.tsx new file mode 100644 index 0000000..72f5963 --- /dev/null +++ b/src/templates/Entry.tsx @@ -0,0 +1,25 @@ +import Main from "@/templates/Main" +import { useParams } from "react-router" + +export default function Entry() { + const { entry } = useParams() + return ( +
+
+
+
+
+
+

+ {entry?.replace(/_/g, " ")} +

+
+ +
+
+
+
+
+
+ ) +}