From 485b237dd7acaa8818e94f5989cc6e85da4a8567 Mon Sep 17 00:00:00 2001 From: amyhuycu Date: Mon, 22 Jun 2020 17:01:49 -0700 Subject: [PATCH 01/16] sample comment --- pages/article/[pid].tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/article/[pid].tsx b/pages/article/[pid].tsx index 7d2b7f0..b794146 100644 --- a/pages/article/[pid].tsx +++ b/pages/article/[pid].tsx @@ -1,3 +1,5 @@ +// EDIT HERE + import marked from "marked"; import Router, { useRouter } from "next/router"; import React from "react"; From af108383f5be0d13a625bda627150005b4af37e8 Mon Sep 17 00:00:00 2001 From: amyhuycu Date: Tue, 23 Jun 2020 22:07:42 -0700 Subject: [PATCH 02/16] wip, error message if not logged in, wip for input box --- components/article/ArticlePreview.tsx | 3 + components/comment/CommentList.tsx | 101 +++++++++++++++++++++++++- pages/article/[pid].tsx | 13 ++++ 3 files changed, 114 insertions(+), 3 deletions(-) diff --git a/components/article/ArticlePreview.tsx b/components/article/ArticlePreview.tsx index 2668532..7ad716a 100644 --- a/components/article/ArticlePreview.tsx +++ b/components/article/ArticlePreview.tsx @@ -26,8 +26,11 @@ const ArticlePreview = ({ article }) => { const handleClickFavorite = async (slug) => { if (!isLoggedIn) { + console.log("[ARTICLEPREVIEW] not logged in") Router.push(`/user/login`); return; + } else { + console.log("[ARTICLEPREVIEW] already logged in") } setPreview({ diff --git a/components/comment/CommentList.tsx b/components/comment/CommentList.tsx index d3ccdad..f26d1d7 100644 --- a/components/comment/CommentList.tsx +++ b/components/comment/CommentList.tsx @@ -2,6 +2,15 @@ import { useRouter } from "next/router"; import React from "react"; import useSWR from "swr"; + +// ADDED +import {message, Form, Button, List, Input} from 'antd'; +const { TextArea } = Input; +import checkLogin from "../../lib/utils/checkLogin"; +import storage from "../../lib/utils/storage"; +//import handleClickReplyTo from "../../pages/article/[pid]" +// END ADDED + import CommentInput from "./CommentInput"; import ErrorMessage from "../common/ErrorMessage"; import LoadingSpinner from "../common/LoadingSpinner"; @@ -11,7 +20,41 @@ import { SERVER_BASE_URL } from "../../lib/utils/constant"; import fetcher from "../../lib/utils/fetcher"; import { Comment, Avatar } from 'antd'; +// ADDED +const Editor = ({onChange, onSubmit, submitting, value }) => ( + <> + +