Skip to content

feat(frontend): redesign product reviews and add admin mail system#26

Merged
T4RuN05 merged 1 commit into
mainfrom
preprod
May 27, 2026
Merged

feat(frontend): redesign product reviews and add admin mail system#26
T4RuN05 merged 1 commit into
mainfrom
preprod

Conversation

@T4RuN05

@T4RuN05 T4RuN05 commented May 27, 2026

Copy link
Copy Markdown
Owner

feat(frontend): redesign product reviews and add admin mail system

  • Product Reviews: Completely redesigned the review UI with summary statistics, interactive stars, and premium user cards.
  • Admin Mails: Created a new admin/mails page to track inbound/outbound emails with type filtering and expandable details. Added a "Mails" link to the admin Navbar.
  • Internationalization: Added full Japanese (ja.json) and Simplified Chinese (zh.json) translations and updated the LanguageCurrencyPopup to include them.

Copilot AI review requested due to automatic review settings May 27, 2026 17:57
@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lgi Ready Ready Preview, Comment May 27, 2026 5:57pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the storefront reviews UI and adds new admin tooling for managing reviews and auditing platform emails, alongside expanding i18n language support.

Changes:

  • Redesign the product reviews section with rating summary/breakdown, improved review cards, and updated add-review UX.
  • Add new admin pages for managing customer reviews (including email replies) and for viewing inbound/outbound mail logs, plus corresponding admin navbar links.
  • Add Japanese (ja) and Simplified Chinese (zh) translations and expose them in the language selector.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/app/globals.css Adds a global keyframe used for modal entrance animation.
src/app/components/ui/LanguageCurrencyPopup.jsx Adds ja and zh options to the language selector.
src/app/components/products/ProductDetails.jsx Reworks the product reviews UI (summary header, form styling, review cards).
src/app/components/layout/Navbar.jsx Adds admin navigation links for Reviews and Mails pages.
src/app/admin/users/page.jsx Updates loading state with a skeleton table UI.
src/app/admin/reviews/page.jsx New admin reviews management page with filtering, reply-by-email, and delete modal.
src/app/admin/mails/page.jsx New admin mail log page with filtering and expandable details.
messages/ja.json Adds full Japanese translation strings.
messages/zh.json Adds full Simplified Chinese translation strings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +600 to +649
{/* ─── REVIEW SUMMARY HEADER ─── */}
<div className="flex flex-col sm:flex-row gap-6 sm:items-center mb-8 pb-6 border-b border-[#e0dbd4]">
{/* Left: Big rating */}
<div className="flex flex-col items-center sm:items-start sm:min-w-[120px]">
<p className="text-4xl font-bold text-[#2D2319] leading-none">
{reviews.length > 0
? (reviews.reduce((s, r) => s + r.rating, 0) / reviews.length).toFixed(1)
: "0.0"}
</p>
<div className="flex items-center gap-0.5 mt-1.5">
{[1, 2, 3, 4, 5].map((s) => (
<span
key={s}
className={`text-sm ${
s <= Math.round(reviews.length > 0 ? reviews.reduce((sum, r) => sum + r.rating, 0) / reviews.length : 0)
? "text-amber-500"
: "text-[#d8d3cc]"
}`}
>
</span>
))}
</div>
<p className="text-xs text-[#8a7d71] mt-1">
{reviews.length} {reviews.length === 1 ? "review" : "reviews"}
</p>
</div>

{/* Right: Star breakdown bars */}
<div className="flex-1 flex flex-col gap-1.5">
{[5, 4, 3, 2, 1].map((star) => {
const count = reviews.filter((r) => r.rating === star).length;
const pct = reviews.length > 0 ? (count / reviews.length) * 100 : 0;
return (
<div key={star} className="flex items-center gap-2 text-xs">
<span className="w-3 text-right text-[#6b5e52] font-medium">{star}</span>
<span className="text-amber-500 text-[10px]">★</span>
<div className="flex-1 h-2 bg-[#e6e1da] rounded-full overflow-hidden">
<div
className="h-full bg-amber-500 rounded-full transition-all duration-700 ease-out"
style={{ width: `${pct}%` }}
/>
</div>
<span className="w-5 text-right text-[#8a7d71]">{count}</span>
</div>
);
})}
</div>
</div>

Comment on lines 689 to +698
{[1, 2, 3, 4, 5].map((star) => (
<span
<button
key={star}
onClick={() => setRating(star)}
className={`cursor-pointer text-2xl transition transform hover:scale-110 ${
star <= rating ? "text-black" : "text-gray-400"
className={`text-2xl transition-all duration-150 hover:scale-125 ${
star <= rating ? "text-amber-500" : "text-[#d8d3cc] hover:text-amber-300"
}`}
>
</span>
</button>
Comment on lines +796 to +797
setLocalImages(localImages.filter((_, index) => index !== i));
setImages(images.filter((_, index) => index !== i));
Comment on lines +52 to +56
<div key={col} className="flex-1 px-6 py-4">
<div
className="h-4 skeleton-shimmer rounded"
style={{ width: `${50 + Math.random() * 40}%` }}
/>
Comment on lines +4 to +11
import { useAuth } from "@/context/AuthContext";
import { Star, Trash2, Mail, Search, X, ChevronDown, ChevronUp, ExternalLink, AlertTriangle } from "lucide-react";
import Image from "next/image";
import Link from "next/link";
import toast from "react-hot-toast";

export default function AdminReviewsPage() {
const { user } = useAuth();
Comment on lines +309 to +316
<Link
href={`/products/${review.product?.slug || ""}`}
target="_blank"
className="text-sm font-medium text-[#2D2319] hover:underline flex items-center gap-1"
>
{review.product?.title || "Deleted Product"}
<ExternalLink size={12} className="text-[#8a7d71]" />
</Link>
Comment on lines +11 to +18
Star,
MessageSquare,
ShieldCheck,
KeyRound,
ExternalLink,
ChevronDown,
ChevronUp,
} from "lucide-react";
Comment on lines +48 to +55
export default function AdminMailsPage() {
const { user } = useAuth();
const [mails, setMails] = useState([]);
const [loading, setLoading] = useState(true);
const [searchQuery, setSearchQuery] = useState("");
const [typeFilter, setTypeFilter] = useState("all");
const [directionFilter, setDirectionFilter] = useState("all");
const [expandedMail, setExpandedMail] = useState(null);
Comment on lines +421 to +428
<Link
href={`/products/${mail.metadata.productSlug}`}
target="_blank"
className="text-xs text-[#6b5e52] hover:text-[#2D2319] flex items-center gap-1 transition"
>
View
<ExternalLink size={10} />
</Link>
@T4RuN05
T4RuN05 merged commit 95b137e into main May 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants