Skip to content

Commit

Permalink
Only allow auth'd users to comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dthyresson committed Mar 27, 2022
1 parent 07d868a commit 680b3cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SUPABASE_URL=
SUPABASE_ANON_KEY=
8 changes: 5 additions & 3 deletions app/lib/comment-item.tsx
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion app/pages/item/[postId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const Item: NextPage = () => {
<FeedItem post={post.node} key={post.cursor} />

<div className="max-w-md">
<PostCommentForm postId={post.node.id} />
{user && <PostCommentForm postId={post.node.id} />}

<div className="mt-10">
{post.node?.comments?.edges.map((edge) => (
Expand Down

0 comments on commit 680b3cc

Please sign in to comment.