-
Uh oh!
-
There's nothing here :(
+
+
+ <- Back Home
+
+
+
+
+
+
Alex
+
I'm Alex, a QA Engineer by day and developer by night
+
- }
+
+
+
+ {
+ links && links.length > 0 ? links :
Uh oh, there are no links here!
+ }
+
-
+
)
}
\ No newline at end of file
diff --git a/src/pages/reviews/[name].tsx b/src/pages/reviews/[name].tsx
deleted file mode 100644
index ccd9fac..0000000
--- a/src/pages/reviews/[name].tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import RootLayout from '@/components/RootLayout';
-
-// next modules
-import Router, {useRouter} from 'next/router';
-import Link from 'next/link';
-import {useSession} from 'next-auth/react';
-import Image from 'next/image';
-
-// api
-import {api} from '@/utils/api'
-
-// icons
-import { Trash } from 'grommet-icons';
-
-export default function ReviewPage() {
- const router = useRouter()
- const name = router.query.name as string
- const { status } = useSession()
-
- // trpc stuff
- const {data: bookData} = api.post.getOne.useQuery(name)
- const deletionMutation = api.post.delete.useMutation()
-
- function deleteItem() {
- if (bookData) {
- deletionMutation.mutate(bookData.id)
- Router.replace("/").catch(() => {
- console.error("Failed to reroute user!")
- })
- }
- }
-
- if (bookData) {
- return (
-
-
-
-
-
-
-
{bookData.name} { status == "authenticated" ? : ""}
-
-
-
-
-
- {bookData.reviewContents}
-
-
- )
- } else {
- return (
-
-
-
Well, that's not good..
-
-
-
-
You've reached a page that doesn't exist. Lets fix that.
-
- Head Home
-
-
-
- )
- }
-}
\ No newline at end of file
diff --git a/src/pages/reviews/index.tsx b/src/pages/reviews/index.tsx
deleted file mode 100644
index d119de4..0000000
--- a/src/pages/reviews/index.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-import RootLayout from "@/components/RootLayout"
-import ReviewCard from "@/components/ReviewCard"
-import React, {useState, useEffect} from 'react';
-import { api } from "@/utils/api";
-
-type GenericItemType = {
- name: string,
- image: string
-}
-
-export default function Reviews() {
- const {data: itemData} = api.post.getAll.useQuery()
- const [list, setList] = useState
(null)
- const [type, setType] = useState("Book")
-
- function onCatClick() {
- // probably gonna rework this eventually if needed
- switch(type) {
- case 'Book':
- setType("Movie")
- break;
- case 'Movie':
- setType("TV")
- break;
- case 'TV':
- setType("Game")
- break;
- case 'Game':
- setType("Book")
- break;
- }
- }
-
- function sanitizeTitleForLink(title: string) {
- return title.replaceAll(" ", "-").toLowerCase()
- }
-
- useEffect(() => {
- if (itemData) {
- const filteredArray = itemData.filter(v => v.type == type.toLowerCase())
-
- if (filteredArray.length <= 0) {
- setList(null)
- } else {
- setList(
- filteredArray.map((v: GenericItemType, k) => {
- return
- })
- )
- }
- }
- }, [itemData, type])
-
- return (
-
-
-
- {type}
-
-
-
- {
- list ? list
- :
-
Nothing here!
-
Try again later :(
-
- }
-
-
-
- )
-}
\ No newline at end of file