Skip to main content

Overview

The forum system supports emoji reactions on posts, allowing users to express their feelings and engagement without writing a full reply. The system also includes topic upvoting for content curation.

Emoji Reactions

Default Emoji Set

The system provides these default emojis: 👍 🔥 🤔 👀 🎉 ❤️ 👏 😄 🤝

Using the EmojiReactions Component

src/components/Forum/EmojiReactions.tsx

Component Features

The component uses optimistic UI updates with server sync:
Emojis are normalized to NFC form for consistent storage:
This handles complex emojis with skin tones and ZWJ sequences.
The system tracks which users reacted with which emojis:

Server Actions

Add Reaction

src/lib/actions/forum/reactions.ts

Remove Reaction

src/lib/actions/forum/reactions.ts

Topic Upvoting

Topics can be upvoted to show support and help surface quality content.

Implementation

Upvotes are stored as votes on the first post of a topic:

Upvote a Topic

src/lib/actions/forum/topics.ts

Remove Upvote

Get Upvote Count

React Hook Integration

src/hooks/useForum.ts

Voting Power Requirements

Users need sufficient voting power to add reactions unless they have the forums.posts.create RBAC permission.

Insufficient VP Modal

Display a helpful modal when users lack voting power:
src/components/Forum/InsufficientVPModal.tsx

Database Schema

Best Practices

Always normalize emoji to NFC form to ensure consistent storage and matching.
Update UI immediately and revert on error for better UX.
Use upsert for adding reactions so duplicate requests don’t cause errors.
Always verify wallet signatures before modifying reaction data.
Verify users have sufficient VP before allowing reactions (unless they have RBAC permissions).

Next Steps

Topics & Posts

Learn about creating topics and posts

Moderation

Set up content moderation and admin tools