From 680b3cc9ca0c1a8ead5e24f7d452d7abe63eefd2 Mon Sep 17 00:00:00 2001 From: "A. David Thyresson" Date: Sun, 27 Mar 2022 08:33:11 -0400 Subject: [PATCH] Only allow auth'd users to comment --- .env.example | 2 ++ app/lib/comment-item.tsx | 8 +++++--- app/pages/item/[postId].tsx | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index e69de29..b779b70 100644 --- a/.env.example +++ b/.env.example @@ -0,0 +1,2 @@ +SUPABASE_URL= +SUPABASE_ANON_KEY= diff --git a/app/lib/comment-item.tsx b/app/lib/comment-item.tsx index 99515f3..db579b7 100644 --- a/app/lib/comment-item.tsx +++ b/app/lib/comment-item.tsx @@ -1,10 +1,12 @@ -import { TrashIcon } from "@heroicons/react/outline"; -import { Auth } from "@supabase/ui"; +import React from "react"; import Link from "next/link"; import { useRouter } from "next/router"; -import React from "react"; + import { useMutation } from "urql"; +import { Auth } from "@supabase/ui"; +import { TrashIcon } from "@heroicons/react/outline"; + import { DocumentType, gql } from "../gql"; import { timeAgo } from "./time-ago"; diff --git a/app/pages/item/[postId].tsx b/app/pages/item/[postId].tsx index a7173ed..9ad8c98 100644 --- a/app/pages/item/[postId].tsx +++ b/app/pages/item/[postId].tsx @@ -117,7 +117,7 @@ const Item: NextPage = () => {
- + {user && }
{post.node?.comments?.edges.map((edge) => (