+
{isEditable && (
@@ -169,57 +169,62 @@ export default function ProfileComments({
-
Discussions
- {isEditable || session?.user?.name ? (
-
);
}
diff --git a/apps/portal/src/components/offers/profile/comments/CommentCard.tsx b/apps/portal/src/components/offers/profile/comments/CommentCard.tsx
index c94d7b5a..9f0a0bef 100644
--- a/apps/portal/src/components/offers/profile/comments/CommentCard.tsx
+++ b/apps/portal/src/components/offers/profile/comments/CommentCard.tsx
@@ -1,14 +1,9 @@
import { signIn, useSession } from 'next-auth/react';
import { useState } from 'react';
-import {
- ChatBubbleBottomCenterIcon,
- TrashIcon,
-} from '@heroicons/react/24/outline';
-import { Button, Dialog, HorizontalDivider, TextArea, useToast } from '@tih/ui';
+import { Button, Dialog, TextArea, useToast } from '@tih/ui';
import { timeSinceNow } from '~/utils/offers/time';
-
-import { trpc } from '../../../../utils/trpc';
+import { trpc } from '~/utils/trpc';
import type { Reply } from '~/types/offers';
@@ -125,80 +120,97 @@ export default function CommentCard({
}
return (
- <>
-
-
-
+
+ {/*
+
+
*/}
+
+
+
{user?.name ?? 'unknown user'}
-
-
{message}
-
-
{`${timeSinceNow(
- createdAt,
- )} ago`}
- {replyLength > 0 && (
-
+
+
+
+
+ {timeSinceNow(createdAt)} ago
+ {' '}
+ ·{' '}
+ {replyLength > 0 && (
+ <>
+
- )}
- {!disableReply && (
-
-
- )}
- {deletable && (
- <>
-
- {!disableReply && isReplying && (
-
+
+
·{' '}
+ >
+ )}
+ {!disableReply && (
+ <>
+
setIsReplying(!isReplying)}>
+ Reply
+
+
·{' '}
+ >
+ )}
+ {deletable && (
+ <>
+
setIsDialogOpen(true)}>
+ {deleteCommentMutation.isLoading ? 'Deleting...' : 'Delete'}
+
+ {isDialogOpen && (
+
+ )}
+ >
+ )}
+
+ {!disableReply && isReplying && (
+
+
-
- )}
-
+
+
+ )}
-
- >
+
);
}
diff --git a/apps/portal/src/components/offers/profile/comments/ExpandableCommentCard.tsx b/apps/portal/src/components/offers/profile/comments/ExpandableCommentCard.tsx
index 22736196..0eb2d96c 100644
--- a/apps/portal/src/components/offers/profile/comments/ExpandableCommentCard.tsx
+++ b/apps/portal/src/components/offers/profile/comments/ExpandableCommentCard.tsx
@@ -26,18 +26,22 @@ export default function ExpandableCommentCard({
replyLength={comment.replies?.length ?? 0}
token={token}
/>
- {comment.replies && (
-
- {isExpanded &&
- comment.replies.map((reply) => (
-
- ))}
+ {comment.replies && comment.replies.length > 0 && isExpanded && (
+
+
+
+ {comment.replies.map((reply) => (
+ -
+
+
+ ))}
+
+
)}