From c41669ee0adae77114898a6822e328e084929951 Mon Sep 17 00:00:00 2001
From: Terence Ho <>
Date: Fri, 7 Oct 2022 14:11:22 +0800
Subject: [PATCH] [resumes][refactor] Add check for user session in comments
---
.../resumes/comments/CommentsForm.tsx | 7 ++-
.../resumes/comments/CommentsList.tsx | 14 ++----
.../resumes/comments/CommentsListButton.tsx | 48 +++++++++++++++++++
3 files changed, 58 insertions(+), 11 deletions(-)
create mode 100644 apps/portal/src/components/resumes/comments/CommentsListButton.tsx
diff --git a/apps/portal/src/components/resumes/comments/CommentsForm.tsx b/apps/portal/src/components/resumes/comments/CommentsForm.tsx
index da8f7c59..98ff8d82 100644
--- a/apps/portal/src/components/resumes/comments/CommentsForm.tsx
+++ b/apps/portal/src/components/resumes/comments/CommentsForm.tsx
@@ -65,8 +65,11 @@ export default function CommentsForm({
};
return (
- <>
+
Add your review
+
+ Please fill in at least one section to submit your review
+
);
}
diff --git a/apps/portal/src/components/resumes/comments/CommentsList.tsx b/apps/portal/src/components/resumes/comments/CommentsList.tsx
index 924a5011..0b1d2d35 100644
--- a/apps/portal/src/components/resumes/comments/CommentsList.tsx
+++ b/apps/portal/src/components/resumes/comments/CommentsList.tsx
@@ -1,8 +1,9 @@
import { useState } from 'react';
-import { Button, Tabs } from '@tih/ui';
+import { Tabs } from '@tih/ui';
import { trpc } from '~/utils/trpc';
+import CommentsListButton from './CommentsListButton';
import { COMMENTS_SECTIONS } from './constants';
type CommentsListProps = Readonly<{
@@ -23,13 +24,8 @@ export default function CommentsList({
/* eslint-enable no-console */
return (
- <>
-