Forum: whom a reply answers, icon badges, the new features on the pages
- Replies stay two levels deep, but a reply to a reply says whom it is
for ("↪ Holdfény"): posts.reply_to_id.
- The question stands apart on its own card; the listening reminder above
the reply box is gone.
- Every rank and badge has its own line icon (Vándor, Kereső, Fonó,
Csillagfonó, Sorsfonó; Moderátor, Meghallgató, Támogató, Szálindító).
- Pages for the new features: own avatar upload and the moderator's reset,
the listener and supporter switches, mention and weekly summary e-mails
(the weekly one off by default), "@" suggestions and mention links, the
daily sky thread by "Sorsfonalak", "Most itt vannak", joining restricted
topics, and the moderators' Témák tab (requests; topics for the admin).
- Members-only topics say so to members too.
- The privacy notice (HU, EN) and point 8.1 of the terms cover own
pictures, badges, mentions, restricted topics and the weekly summary;
the data export and account deletion include them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -1,5 +1,33 @@
|
||||
/** A post's text: paragraphs and line breaks as typed; links stay plain text. */
|
||||
export function PostBody({ text }: { text: string }) {
|
||||
import Link from "next/link";
|
||||
|
||||
import { memberHref } from "@/lib/forum";
|
||||
|
||||
/** "@Holdfény" as a link to the profile, for the nicknames the post names. */
|
||||
function withMentions(line: string, mentions: string[]): React.ReactNode[] {
|
||||
if (mentions.length === 0) return [line];
|
||||
const escaped = [...mentions]
|
||||
.sort((a, b) => b.length - a.length)
|
||||
.map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
||||
const pattern = new RegExp(`@(${escaped.join("|")})`, "gi");
|
||||
const out: React.ReactNode[] = [];
|
||||
let last = 0;
|
||||
for (const match of line.matchAll(pattern)) {
|
||||
const at = match.index ?? 0;
|
||||
if (at > last) out.push(line.slice(last, at));
|
||||
const nickname = mentions.find((n) => n.toLowerCase() === match[1].toLowerCase()) ?? match[1];
|
||||
out.push(
|
||||
<Link key={at} href={memberHref(nickname)} className="fp-mention">
|
||||
@{match[1]}
|
||||
</Link>,
|
||||
);
|
||||
last = at + match[0].length;
|
||||
}
|
||||
if (last < line.length) out.push(line.slice(last));
|
||||
return out;
|
||||
}
|
||||
|
||||
/** A post's text: paragraphs and line breaks as typed; links stay plain text; mentions link to profiles. */
|
||||
export function PostBody({ text, mentions = [] }: { text: string; mentions?: string[] }) {
|
||||
return (
|
||||
<div className="fp-body">
|
||||
{text.split(/\n{2,}/).map((para, i) => (
|
||||
@@ -7,7 +35,7 @@ export function PostBody({ text }: { text: string }) {
|
||||
{para.split("\n").map((line, j) => (
|
||||
<span key={j}>
|
||||
{j > 0 && <br />}
|
||||
{line}
|
||||
{withMentions(line, mentions)}
|
||||
</span>
|
||||
))}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user