+
+ {/* Top line: Complaint ID, Category Badge, Status Badge */}
+
+
+
+ #{post.id}
+
+
+ {isElectrical ? : }
+ {post.type_of_post}
+
+
+
+
+
+ {status.label}
+
+
- {/* Title + description */}
-
{post.title}
-
{post.description}
+ {/* Title & Description */}
+
+ {post.title}
+
+
+ {post.description}
+
+
-
-
- {formatDate(post.created_at)}
+ {/* Footer row: Date, Info fields, Comments and hover arrow */}
+
+
+
+ {formatDate(post.created_at)}
+
{isFaculty && post.place && (
-
- {post.place}
+
+ {post.place}
)}
+
{isWarden && post.room_number && (
-
- {post.room_number}
+
+ Room {post.room_number}
)}
-
+
{comments.length > 0 && (
-
- {comments.length}
+
+ {comments.length}
)}
-
+
);
diff --git a/app/src/index.css b/app/src/index.css
index f7ae390..2add21e 100644
--- a/app/src/index.css
+++ b/app/src/index.css
@@ -1,6 +1,7 @@
@import "tailwindcss";
@theme {
+ --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
--color-primary: #003366; /* Deep Blue typical of NITH */
--color-primary-light: #00509e;
--color-secondary: #f0f4f8; /* Light gray for backgrounds */
diff --git a/app/src/pages/admin/AdminPostView.tsx b/app/src/pages/admin/AdminPostView.tsx
index fa9fdc2..fd990fd 100644
--- a/app/src/pages/admin/AdminPostView.tsx
+++ b/app/src/pages/admin/AdminPostView.tsx
@@ -22,6 +22,7 @@ import {
Users,
} from 'lucide-react';
import { MainLayout } from '../../components/layout/MainLayout';
+import { CommentBox } from '../../components/CommentBox';
// ── Types ──────────────────────────────────────────────────────────────────────
@@ -856,84 +857,29 @@ export function AdminPostView() {
);
} else {
const c = item.data;
- const who = c.role ? c.role.replace(/_/g, ' ') : 'Staff';
const isMyComment = adminComments.some((ac) => ac.id === c.id);
const isEditing = editingCommentId === c.id;
const isBusy = commentActionLoadingId === c.id;
const editExpired = isEditWindowExpired(c.created_at);
return (
-
- {/* Comment Bubble in GitHub Style */}
-
-
-
- {who}
- {c.email && {c.email}}
-
-
- {formatDateTime(c.created_at)}
-
- {isMyComment && !isEditing && !editExpired && (
-
-
-
-
- )}
-
-
-
-
- {isEditing ? (
-
- ) : (
-
{c.comment_text}
- )}
-
-
-
+
{
+ setEditingCommentId(c.id);
+ setEditingText(c.comment_text);
+ }}
+ onCancelEdit={() => setEditingCommentId(null)}
+ onSaveEdit={() => handleEditComment(c.id)}
+ onDeleteComment={() => handleDeleteComment(c.id)}
+ onEditingTextChange={(text) => setEditingText(text)}
+ />
);
}
})
@@ -941,137 +887,144 @@ export function AdminPostView() {
{/* ── Comment + action area ── */}
-
-
+ {/* Precision-aligned Connector Dot */}
+
+
+
diff --git a/app/src/pages/post/PostView.tsx b/app/src/pages/post/PostView.tsx
index c6dd273..32b5006 100644
--- a/app/src/pages/post/PostView.tsx
+++ b/app/src/pages/post/PostView.tsx
@@ -7,6 +7,7 @@ import {
} from 'lucide-react';
import { MainLayout } from '../../components/layout/MainLayout';
import { POST_PLACES } from '../../constants/models';
+import { CommentBox } from '../../components/CommentBox';
type Role = 'faculty' | 'warden' | 'centrehead';
@@ -562,7 +563,7 @@ export function PostView() {
{eventText}
-
+
{formatDateTime(audit.timestamp)}
@@ -570,27 +571,8 @@ export function PostView() {
);
} else {
const c = item.data;
- const author = c.role ? roleLabel(c.role) : 'Staff';
-
return (
-
- {/* Comment Bubble in GitHub Style */}
-
-
-
- {author}
- {c.email && {c.email}}
-
-
-
- {formatDateTime(c.created_at)}
-
-
-
- {c.comment_text}
-
-
-
+
);
}
})
@@ -598,35 +580,49 @@ export function PostView() {
{/* Composer */}
-
diff --git a/app/src/pages/profile/Profile.tsx b/app/src/pages/profile/Profile.tsx
index b8ae5a7..5f62f84 100644
--- a/app/src/pages/profile/Profile.tsx
+++ b/app/src/pages/profile/Profile.tsx
@@ -66,7 +66,13 @@ export function Profile() {
if (!res.ok) throw new Error(`Server error (${res.status})`);
return res.json();
})
- .then((data) => { setPosts(data.posts ?? []); setPostsLoading(false); })
+ .then((data) => {
+ setPosts(data.posts ?? []);
+ setPostsLoading(false);
+ if (data.name) {
+ setProfile((prev) => prev ? { ...prev, name: data.name } : null);
+ }
+ })
.catch((err: Error) => { setPostsError(err.message); setPostsLoading(false); });
}, [profile]);
@@ -215,7 +221,7 @@ export function Profile() {
{/* Identity row */}
-
{profile.name || profile.email?.split('@')[0] || ''}
+
{profile.name}
{profile.email}